From 6c971df24dc9d15d4d30a3f3ab91a70b448be83b Mon Sep 17 00:00:00 2001 From: steffnay Date: Wed, 17 Jun 2020 21:30:22 -0700 Subject: [PATCH 001/105] chore: add initial files for launch --- .../CODE_OF_CONDUCT.md | 43 ++++ .../CONTRIBUTING.md | 65 ++++++ .../google-cloud-bigquery-reservation/LICENSE | 202 ++++++++++++++++++ .../README.md | 1 + .../synth.py | 44 ++++ 5 files changed, 355 insertions(+) create mode 100644 packages/google-cloud-bigquery-reservation/CODE_OF_CONDUCT.md create mode 100644 packages/google-cloud-bigquery-reservation/CONTRIBUTING.md create mode 100644 packages/google-cloud-bigquery-reservation/LICENSE create mode 100644 packages/google-cloud-bigquery-reservation/README.md create mode 100644 packages/google-cloud-bigquery-reservation/synth.py diff --git a/packages/google-cloud-bigquery-reservation/CODE_OF_CONDUCT.md b/packages/google-cloud-bigquery-reservation/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..46b2a08ea6d --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/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-bigquery-reservation/CONTRIBUTING.md b/packages/google-cloud-bigquery-reservation/CONTRIBUTING.md new file mode 100644 index 00000000000..f6c4cf010e3 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/CONTRIBUTING.md @@ -0,0 +1,65 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + gcloud auth application-default login + npm run samples-test + + # Run all system tests. + gcloud auth application-default login + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup diff --git a/packages/google-cloud-bigquery-reservation/LICENSE b/packages/google-cloud-bigquery-reservation/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/google-cloud-bigquery-reservation/README.md b/packages/google-cloud-bigquery-reservation/README.md new file mode 100644 index 00000000000..03e19927b99 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/README.md @@ -0,0 +1 @@ +Reservation: Nodejs Client diff --git a/packages/google-cloud-bigquery-reservation/synth.py b/packages/google-cloud-bigquery-reservation/synth.py new file mode 100644 index 00000000000..462e4b6c2d4 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/synth.py @@ -0,0 +1,44 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""This script is used to synthesize generated parts of this library.""" + +import synthtool as s +import synthtool.gcp as gcp +import subprocess +import logging + +logging.basicConfig(level=logging.DEBUG) + +# run the gapic generator +gapic = gcp.GAPICMicrogenerator() +versions = ['v1'] +for version in versions: + library = gapic.typescript_library( + 'bigquery-reservation', + generator_args={ + 'package-name': '@google-cloud/bigquery-reservation' + }, + proto_path='/google/cloud/bigquery/reservation/v1', + version=version) +s.copy(library, excludes=[]) + +# Copy common templates +common_templates = gcp.CommonTemplates() +templates = common_templates.node_library(source_location='build/src') +s.copy(templates, excludes=[]) + +# Node.js specific cleanup +subprocess.run(['npm', 'install']) +subprocess.run(['npm', 'run', 'fix']) +subprocess.run(['npx', 'compileProtos', 'src']) \ No newline at end of file From fc3c039d077fd2962e382ccc07a9dd6158dfc352 Mon Sep 17 00:00:00 2001 From: Steffany Brown <30247553+steffnay@users.noreply.github.com> Date: Mon, 13 Jul 2020 17:04:31 -0700 Subject: [PATCH 002/105] feat: generate v1 of the API (#2) --- .../.eslintignore | 6 + .../.eslintrc.json | 3 + .../.gitattributes | 3 + .../.gitignore | 14 + .../.jsdoc.js | 55 + .../.mocharc.js | 28 + .../google-cloud-bigquery-reservation/.nycrc | 24 + .../.prettierignore | 6 + .../.prettierrc.js | 17 + .../.repo-metadata.json | 13 + .../README.md | 171 +- .../linkinator.config.json | 11 + .../package.json | 66 + .../bigquery/reservation/v1/reservation.proto | 875 + .../protos/protos.d.ts | 7424 +++++++ .../protos/protos.js | 18517 ++++++++++++++++ .../protos/protos.json | 1878 ++ .../samples/README.md | 50 + .../samples/package.json | 23 + .../samples/quickstart.js | 61 + .../samples/test/quickstart.js | 35 + .../src/index.ts | 24 + .../src/v1/index.ts | 19 + .../src/v1/reservation_service_client.ts | 3099 +++ .../v1/reservation_service_client_config.json | 121 + .../v1/reservation_service_proto_list.json | 3 + .../synth.metadata | 37 + .../synth.py | 14 +- .../system-test/fixtures/sample/src/index.js | 26 + .../system-test/fixtures/sample/src/index.ts | 25 + .../system-test/install.ts | 51 + .../test/gapic_reservation_service_v1.ts | 3557 +++ .../tsconfig.json | 19 + .../webpack.config.js | 64 + 34 files changed, 36329 insertions(+), 10 deletions(-) create mode 100644 packages/google-cloud-bigquery-reservation/.eslintignore create mode 100644 packages/google-cloud-bigquery-reservation/.eslintrc.json create mode 100644 packages/google-cloud-bigquery-reservation/.gitattributes create mode 100644 packages/google-cloud-bigquery-reservation/.gitignore create mode 100644 packages/google-cloud-bigquery-reservation/.jsdoc.js create mode 100644 packages/google-cloud-bigquery-reservation/.mocharc.js create mode 100644 packages/google-cloud-bigquery-reservation/.nycrc create mode 100644 packages/google-cloud-bigquery-reservation/.prettierignore create mode 100644 packages/google-cloud-bigquery-reservation/.prettierrc.js create mode 100644 packages/google-cloud-bigquery-reservation/.repo-metadata.json create mode 100644 packages/google-cloud-bigquery-reservation/linkinator.config.json create mode 100644 packages/google-cloud-bigquery-reservation/package.json create mode 100644 packages/google-cloud-bigquery-reservation/protos/google/cloud/bigquery/reservation/v1/reservation.proto create mode 100644 packages/google-cloud-bigquery-reservation/protos/protos.d.ts create mode 100644 packages/google-cloud-bigquery-reservation/protos/protos.js create mode 100644 packages/google-cloud-bigquery-reservation/protos/protos.json create mode 100644 packages/google-cloud-bigquery-reservation/samples/README.md create mode 100644 packages/google-cloud-bigquery-reservation/samples/package.json create mode 100644 packages/google-cloud-bigquery-reservation/samples/quickstart.js create mode 100644 packages/google-cloud-bigquery-reservation/samples/test/quickstart.js create mode 100644 packages/google-cloud-bigquery-reservation/src/index.ts create mode 100644 packages/google-cloud-bigquery-reservation/src/v1/index.ts create mode 100644 packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts create mode 100644 packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client_config.json create mode 100644 packages/google-cloud-bigquery-reservation/src/v1/reservation_service_proto_list.json create mode 100644 packages/google-cloud-bigquery-reservation/synth.metadata create mode 100644 packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.js create mode 100644 packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.ts create mode 100644 packages/google-cloud-bigquery-reservation/system-test/install.ts create mode 100644 packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts create mode 100644 packages/google-cloud-bigquery-reservation/tsconfig.json create mode 100644 packages/google-cloud-bigquery-reservation/webpack.config.js diff --git a/packages/google-cloud-bigquery-reservation/.eslintignore b/packages/google-cloud-bigquery-reservation/.eslintignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.eslintignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-bigquery-reservation/.eslintrc.json b/packages/google-cloud-bigquery-reservation/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-bigquery-reservation/.gitattributes b/packages/google-cloud-bigquery-reservation/.gitattributes new file mode 100644 index 00000000000..d4f4169b28b --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.gitattributes @@ -0,0 +1,3 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated diff --git a/packages/google-cloud-bigquery-reservation/.gitignore b/packages/google-cloud-bigquery-reservation/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +.coverage +coverage +.nyc_output +docs/ +out/ +build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/packages/google-cloud-bigquery-reservation/.jsdoc.js b/packages/google-cloud-bigquery-reservation/.jsdoc.js new file mode 100644 index 00000000000..1f221730902 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2020 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/bigquery-reservation', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-bigquery-reservation/.mocharc.js b/packages/google-cloud-bigquery-reservation/.mocharc.js new file mode 100644 index 00000000000..ff7b34fa5d1 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.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 diff --git a/packages/google-cloud-bigquery-reservation/.nycrc b/packages/google-cloud-bigquery-reservation/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-bigquery-reservation/.prettierignore b/packages/google-cloud-bigquery-reservation/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-bigquery-reservation/.prettierrc.js b/packages/google-cloud-bigquery-reservation/.prettierrc.js new file mode 100644 index 00000000000..d1b95106f4c --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-bigquery-reservation/.repo-metadata.json b/packages/google-cloud-bigquery-reservation/.repo-metadata.json new file mode 100644 index 00000000000..f476a3e9a21 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.repo-metadata.json @@ -0,0 +1,13 @@ +{ + "name": "bigqueryreservation", + "name_pretty": "Google BigQuery Reservation", + "product_documentation": "https://cloud.google.com/bigquery/docs/reference/reservations", + "client_documentation": "https://googleapis.dev/nodejs/bigqueryreservation/latest", + "issue_tracker": "https://b.corp.google.com/savedsearches/559654", + "release_level": "ga", + "language": "nodejs", + "repo": "googleapis/nodejs-bigquery-reservation", + "distribution_name": "@google-cloud/bigquery-reservation", + "api_id": "bigqueryreservation.googleapis.com", + "requires_billing": true +} \ No newline at end of file diff --git a/packages/google-cloud-bigquery-reservation/README.md b/packages/google-cloud-bigquery-reservation/README.md index 03e19927b99..f2ca0e63228 100644 --- a/packages/google-cloud-bigquery-reservation/README.md +++ b/packages/google-cloud-bigquery-reservation/README.md @@ -1 +1,170 @@ -Reservation: Nodejs Client +[//]: # "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 + +# [Google BigQuery Reservation: Node.js Client](https://github.com/googleapis/nodejs-bigquery-reservation) + +[![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/bigquery-reservation.svg)](https://www.npmjs.org/package/@google-cloud/bigquery-reservation) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-bigquery-reservation/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-bigquery-reservation) + + + + +BigQuery Reservation client for Node.js + + +* [Google BigQuery Reservation Node.js Client API Reference][client-docs] +* [Google BigQuery Reservation Documentation][product-docs] +* [github.com/googleapis/nodejs-bigquery-reservation](https://github.com/googleapis/nodejs-bigquery-reservation) + +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) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google BigQuery Reservation API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/bigquery-reservation +``` + + +### Using the client library + +```javascript +// Imports the Google Cloud client library +const { + ReservationServiceClient, +} = require('@google-cloud/bigquery-reservation'); + +// Creates a client +const client = new ReservationServiceClient(); + +// project = 'my-project' // Project to list reservations for. +// location = 'US' // BigQuery location. + +async function listReservations() { + const [reservations] = await client.listReservations({ + parent: `projects/${project}/locations/${location}`, + }); + + console.info(`found ${reservations.length} reservations`); + console.info(reservations); +} + +async function listCapacityCommitments() { + const [commitments] = await client.listCapacityCommitments({ + parent: `projects/${project}/locations/${location}`, + }); + + console.info(`found ${commitments.length} commitments`); + console.info(commitments); +} + +listReservations(); +listCapacityCommitments(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-bigquery-reservation/tree/master/samples) directory. The samples' `README.md` +has instructions for running the samples. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Quickstart | [source code](https://github.com/googleapis/nodejs-bigquery-reservation/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-bigquery-reservation&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | + + + +The [Google BigQuery Reservation Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. + +Client libraries targetting some end-of-life versions of Node.js are available, and +can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. + +_Legacy Node.js versions are supported as a best effort:_ + +* Legacy versions will not be tested in continuous integration. +* Some security patches may not be able to be backported. +* Dependencies will not be kept up-to-date, and features will not be backported. + +#### Legacy tags available + +* `legacy-8`: install client libraries from this dist-tag for versions + compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + +This library is considered to be **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. + + + + + +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-bigquery-reservation/blob/master/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its template in this +[directory](https://github.com/googleapis/synthtool/tree/master/synthtool/gcp/templates/node_library). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-bigquery-reservation/blob/master/LICENSE) + +[client-docs]: https://googleapis.dev/nodejs/bigqueryreservation/latest +[product-docs]: https://cloud.google.com/bigquery/docs/reference/reservations +[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=bigqueryreservation.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-bigquery-reservation/linkinator.config.json b/packages/google-cloud-bigquery-reservation/linkinator.config.json new file mode 100644 index 00000000000..6049287911d --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/linkinator.config.json @@ -0,0 +1,11 @@ +{ + "recurse": true, + "skip": [ + "img.shields.io", + "https://googleapis.dev/nodejs/bigqueryreservation/latest", + "https://github.com/googleapis/nodejs-bigquery-reservation/tree/master/samples", + "https://github.com/googleapis/nodejs-bigquery-reservation/blob/master/samples/quickstart.js" + ], + "silent": true, + "concurrency": 10 +} diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json new file mode 100644 index 00000000000..219b85c72cd --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -0,0 +1,66 @@ +{ + "name": "@google-cloud/bigquery-reservation", + "version": "0.1.0", + "description": "BigQuery Reservation client for Node.js", + "repository": "googleapis/nodejs-bigquery-reservation", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google reservation", + "reservation", + "reservation service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "prelint": "cd samples; npm link ../; npm i", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^2.6.2" + }, + "devDependencies": { + "@types/mocha": "^7.0.2", + "@types/node": "^14.0.19", + "@types/sinon": "^9.0.4", + "c8": "^7.2.0", + "gts": "^2.0.2", + "jsdoc": "^3.6.4", + "jsdoc-fresh": "^1.0.2", + "jsdoc-region-tag": "^1.0.4", + "linkinator": "^2.1.1", + "mocha": "^8.0.1", + "null-loader": "^4.0.0", + "pack-n-play": "^1.0.0-2", + "sinon": "^9.0.2", + "ts-loader": "^7.0.5", + "typescript": "^3.9.6", + "webpack": "^4.43.0", + "webpack-cli": "^3.3.12" + }, + "engines": { + "node": ">=10.0.0" + } +} diff --git a/packages/google-cloud-bigquery-reservation/protos/google/cloud/bigquery/reservation/v1/reservation.proto b/packages/google-cloud-bigquery-reservation/protos/google/cloud/bigquery/reservation/v1/reservation.proto new file mode 100644 index 00000000000..62a237f2b6e --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/protos/google/cloud/bigquery/reservation/v1/reservation.proto @@ -0,0 +1,875 @@ +// 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.bigquery.reservation.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.BigQuery.Reservation.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/reservation/v1;reservation"; +option java_multiple_files = true; +option java_outer_classname = "ReservationProto"; +option java_package = "com.google.cloud.bigquery.reservation.v1"; + +// This API allows users to manage their flat-rate BigQuery reservations. +// +// A reservation provides computational resource guarantees, in the form of +// [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a +// unit of computational power in BigQuery, and serves as the basic unit of +// parallelism. In a scan of a multi-partitioned table, a single slot operates +// on a single partition of the table. A reservation resource exists as a child +// resource of the admin project and location, e.g.: +// `projects/myproject/locations/US/reservations/reservationName`. +// +// A capacity commitment is a way to purchase compute capacity for BigQuery jobs +// (in the form of slots) with some committed period of usage. A capacity +// commitment resource exists as a child resource of the admin project and +// location, e.g.: +// `projects/myproject/locations/US/capacityCommitments/id`. +service ReservationService { + option (google.api.default_host) = "bigqueryreservation.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigquery," + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a new reservation resource. + rpc CreateReservation(CreateReservationRequest) returns (Reservation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/reservations" + body: "reservation" + }; + option (google.api.method_signature) = "parent,reservation,reservation_id"; + } + + // Lists all the reservations for the project in the specified location. + rpc ListReservations(ListReservationsRequest) returns (ListReservationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/reservations" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns information about the reservation. + rpc GetReservation(GetReservationRequest) returns (Reservation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/reservations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes a reservation. + // Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has + // assignments. + rpc DeleteReservation(DeleteReservationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/reservations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates an existing reservation resource. + rpc UpdateReservation(UpdateReservationRequest) returns (Reservation) { + option (google.api.http) = { + patch: "/v1/{reservation.name=projects/*/locations/*/reservations/*}" + body: "reservation" + }; + option (google.api.method_signature) = "reservation,update_mask"; + } + + // Creates a new capacity commitment resource. + rpc CreateCapacityCommitment(CreateCapacityCommitmentRequest) returns (CapacityCommitment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/capacityCommitments" + body: "capacity_commitment" + }; + option (google.api.method_signature) = "parent,capacity_commitment"; + } + + // Lists all the capacity commitments for the admin project. + rpc ListCapacityCommitments(ListCapacityCommitmentsRequest) returns (ListCapacityCommitmentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/capacityCommitments" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns information about the capacity commitment. + rpc GetCapacityCommitment(GetCapacityCommitmentRequest) returns (CapacityCommitment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/capacityCommitments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes a capacity commitment. Attempting to delete capacity commitment + // before its commitment_end_time will fail with the error code + // `google.rpc.Code.FAILED_PRECONDITION`. + rpc DeleteCapacityCommitment(DeleteCapacityCommitmentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/capacityCommitments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates an existing capacity commitment. + // + // Only `plan` and `renewal_plan` fields can be updated. + // + // Plan can only be changed to a plan of a longer commitment period. + // Attempting to change to a plan with shorter commitment period will fail + // with the error code `google.rpc.Code.FAILED_PRECONDITION`. + rpc UpdateCapacityCommitment(UpdateCapacityCommitmentRequest) returns (CapacityCommitment) { + option (google.api.http) = { + patch: "/v1/{capacity_commitment.name=projects/*/locations/*/capacityCommitments/*}" + body: "capacity_commitment" + }; + option (google.api.method_signature) = "capacity_commitment,update_mask"; + } + + // Splits capacity commitment to two commitments of the same plan and + // `commitment_end_time`. + // + // A common use case is to enable downgrading commitments. + // + // For example, in order to downgrade from 10000 slots to 8000, you might + // split a 10000 capacity commitment into commitments of 2000 and 8000. Then, + // you would change the plan of the first one to `FLEX` and then delete it. + rpc SplitCapacityCommitment(SplitCapacityCommitmentRequest) returns (SplitCapacityCommitmentResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/capacityCommitments/*}:split" + body: "*" + }; + option (google.api.method_signature) = "name,slot_count"; + } + + // Merges capacity commitments of the same plan into a single commitment. + // + // The resulting capacity commitment has the greater commitment_end_time + // out of the to-be-merged capacity commitments. + // + // Attempting to merge capacity commitments of different plan will fail + // with the error code `google.rpc.Code.FAILED_PRECONDITION`. + rpc MergeCapacityCommitments(MergeCapacityCommitmentsRequest) returns (CapacityCommitment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/capacityCommitments:merge" + body: "*" + }; + option (google.api.method_signature) = "parent,capacity_commitment_ids"; + } + + // Creates an assignment object which allows the given project to submit jobs + // of a certain type using slots from the specified reservation. + // + // Currently a + // resource (project, folder, organization) can only have one assignment per + // each (job_type, location) combination, and that reservation will be used + // for all jobs of the matching type. + // + // Different assignments can be created on different levels of the + // projects, folders or organization hierarchy. During query execution, + // the assignment is looked up at the project, folder and organization levels + // in that order. The first assignment found is applied to the query. + // + // When creating assignments, it does not matter if other assignments exist at + // higher levels. + // + // Example: + // + // * The organization `organizationA` contains two projects, `project1` + // and `project2`. + // * Assignments for all three entities (`organizationA`, `project1`, and + // `project2`) could all be created and mapped to the same or different + // reservations. + // + // Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have + // 'bigquery.admin' permissions on the project using the reservation + // and the project that owns this reservation. + // + // Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment + // does not match location of the reservation. + rpc CreateAssignment(CreateAssignmentRequest) returns (Assignment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/reservations/*}/assignments" + body: "assignment" + }; + option (google.api.method_signature) = "parent,assignment"; + } + + // Lists assignments. + // + // Only explicitly created assignments will be returned. + // + // Example: + // + // * Organization `organizationA` contains two projects, `project1` and + // `project2`. + // * Reservation `res1` exists and was created previously. + // * CreateAssignment was used previously to define the following + // associations between entities and reservations: `` + // and `` + // + // In this example, ListAssignments will just return the above two assignments + // for reservation `res1`, and no expansion/merge will happen. + // + // The wildcard "-" can be used for + // reservations in the request. In that case all assignments belongs to the + // specified project and location will be listed. + // + // **Note** "-" cannot be used for projects nor locations. + rpc ListAssignments(ListAssignmentsRequest) returns (ListAssignmentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/reservations/*}/assignments" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a assignment. No expansion will happen. + // + // Example: + // + // * Organization `organizationA` contains two projects, `project1` and + // `project2`. + // * Reservation `res1` exists and was created previously. + // * CreateAssignment was used previously to define the following + // associations between entities and reservations: `` + // and `` + // + // In this example, deletion of the `` assignment won't + // affect the other assignment ``. After said deletion, + // queries from `project1` will still use `res1` while queries from + // `project2` will switch to use on-demand mode. + rpc DeleteAssignment(DeleteAssignmentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/reservations/*/assignments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Looks up assignments for a specified resource for a particular region. + // If the request is about a project: + // + // 1. Assignments created on the project will be returned if they exist. + // 2. Otherwise assignments created on the closest ancestor will be + // returned. + // 3. Assignments for different JobTypes will all be returned. + // + // The same logic applies if the request is about a folder. + // + // If the request is about an organization, then assignments created on the + // organization will be returned (organization doesn't have ancestors). + // + // Comparing to ListAssignments, there are some behavior + // differences: + // + // 1. permission on the assignee will be verified in this API. + // 2. Hierarchy lookup (project->folder->organization) happens in this API. + // 3. Parent here is `projects/*/locations/*`, instead of + // `projects/*/locations/*reservations/*`. + // + // **Note** "-" cannot be used for projects + // nor locations. + rpc SearchAssignments(SearchAssignmentsRequest) returns (SearchAssignmentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}:searchAssignments" + }; + option (google.api.method_signature) = "parent,query"; + } + + // Moves an assignment under a new reservation. + // + // This differs from removing an existing assignment and recreating a new one + // by providing a transactional change that ensures an assignee always has an + // associated reservation. + rpc MoveAssignment(MoveAssignmentRequest) returns (Assignment) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/reservations/*/assignments/*}:move" + body: "*" + }; + option (google.api.method_signature) = "name,destination_id"; + } + + // Retrieves a BI reservation. + rpc GetBiReservation(GetBiReservationRequest) returns (BiReservation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/biReservation}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a BI reservation. + // + // Only fields specified in the `field_mask` are updated. + // + // A singleton BI reservation always exists with default size 0. + // In order to reserve BI capacity it needs to be updated to an amount + // greater than 0. In order to release BI capacity reservation size + // must be set to 0. + rpc UpdateBiReservation(UpdateBiReservationRequest) returns (BiReservation) { + option (google.api.http) = { + patch: "/v1/{bi_reservation.name=projects/*/locations/*/biReservation}" + body: "bi_reservation" + }; + option (google.api.method_signature) = "bi_reservation,update_mask"; + } +} + +// A reservation is a mechanism used to guarantee slots to users. +message Reservation { + option (google.api.resource) = { + type: "bigqueryreservation.googleapis.com/Reservation" + pattern: "projects/{project}/locations/{location}/reservations/{reservation}" + }; + + // The resource name of the reservation, e.g., + // `projects/*/locations/*/reservations/team1-prod`. + string name = 1; + + // Minimum slots available to this reservation. A slot is a unit of + // computational power in BigQuery, and serves as the unit of parallelism. + // + // Queries using this reservation might use more slots during runtime if + // ignore_idle_slots is set to false. + // + // If the new reservation's slot capacity exceed the parent's slot capacity or + // if total slot capacity of the new reservation and its siblings exceeds the + // parent's slot capacity, the request will fail with + // `google.rpc.Code.RESOURCE_EXHAUSTED`. + int64 slot_capacity = 2; + + // If false, any query using this reservation will use idle slots from other + // reservations within the same admin project. If true, a query using this + // reservation will execute with the slot capacity specified above at most. + bool ignore_idle_slots = 4; +} + +// Capacity commitment is a way to purchase compute capacity for BigQuery jobs +// (in the form of slots) with some committed period of usage. Annual +// commitments renew by default. Commitments can be removed after their +// commitment end time passes. +// +// In order to remove annual commitment, its plan needs to be changed +// to monthly or flex first. +// +// A capacity commitment resource exists as a child resource of the admin +// project. +message CapacityCommitment { + option (google.api.resource) = { + type: "bigqueryreservation.googleapis.com/CapacityCommitment" + pattern: "projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}" + }; + + // Commitment plan defines the current committed period. Capacity commitment + // cannot be deleted during it's committed period. + enum CommitmentPlan { + // Invalid plan value. Requests with this value will be rejected with + // error code `google.rpc.Code.INVALID_ARGUMENT`. + COMMITMENT_PLAN_UNSPECIFIED = 0; + + // Flex commitments have committed period of 1 minute after becoming ACTIVE. + // After that, they are not in a committed period anymore and can be removed + // any time. + FLEX = 3; + + // Trial commitments have a committed period of 182 days after becoming + // ACTIVE. After that, they are converted to a new commitment based on the + // `renewal_plan`. Default `renewal_plan` for Trial commitment is Flex so + // that it can be deleted right after committed period ends. + TRIAL = 5; + + // Monthly commitments have a committed period of 30 days after becoming + // ACTIVE. After that, they are not in a committed period anymore and can be + // removed any time. + MONTHLY = 2; + + // Annual commitments have a committed period of 365 days after becoming + // ACTIVE. After that they are converted to a new commitment based on the + // renewal_plan. + ANNUAL = 4; + } + + // Capacity commitment can either become ACTIVE right away or transition + // from PENDING to ACTIVE or FAILED. + enum State { + // Invalid state value. + STATE_UNSPECIFIED = 0; + + // Capacity commitment is pending provisioning. Pending capacity commitment + // does not contribute to the parent's slot_capacity. + PENDING = 1; + + // Once slots are provisioned, capacity commitment becomes active. + // slot_count is added to the parent's slot_capacity. + ACTIVE = 2; + + // Capacity commitment is failed to be activated by the backend. + FAILED = 3; + } + + // Output only. The resource name of the capacity commitment, e.g., + // `projects/myproject/locations/US/capacityCommitments/123` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Number of slots in this commitment. + int64 slot_count = 2; + + // Capacity commitment commitment plan. + CommitmentPlan plan = 3; + + // Output only. State of the commitment. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The end of the current commitment period. It is applicable only for ACTIVE + // capacity commitments. + google.protobuf.Timestamp commitment_end_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. For FAILED commitment plan, provides the reason of failure. + google.rpc.Status failure_status = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The plan this capacity commitment is converted to after commitment_end_time + // passes. Once the plan is changed, committed period is extended according to + // commitment plan. Only applicable for ANNUAL and TRIAL commitments. + CommitmentPlan renewal_plan = 8; +} + +// The request for [ReservationService.CreateReservation][google.cloud.bigquery.reservation.v1.ReservationService.CreateReservation]. +message CreateReservationRequest { + // Required. Project, location. E.g., + // `projects/myproject/locations/US` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigqueryreservation.googleapis.com/Reservation" + } + ]; + + // The reservation ID. This field must only contain lower case alphanumeric + // characters or dash. Max length is 64 characters. + string reservation_id = 2; + + // Definition of the new reservation to create. + Reservation reservation = 3; +} + +// The request for [ReservationService.ListReservations][google.cloud.bigquery.reservation.v1.ReservationService.ListReservations]. +message ListReservationsRequest { + // Required. The parent resource name containing project and location, e.g.: + // `projects/myproject/locations/US` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigqueryreservation.googleapis.com/Reservation" + } + ]; + + // The maximum number of items to return per page. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; +} + +// The response for [ReservationService.ListReservations][google.cloud.bigquery.reservation.v1.ReservationService.ListReservations]. +message ListReservationsResponse { + // List of reservations visible to the user. + repeated Reservation reservations = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request for [ReservationService.GetReservation][google.cloud.bigquery.reservation.v1.ReservationService.GetReservation]. +message GetReservationRequest { + // Required. Resource name of the reservation to retrieve. E.g., + // `projects/myproject/locations/US/reservations/team1-prod` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/Reservation" + } + ]; +} + +// The request for [ReservationService.DeleteReservation][google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservation]. +message DeleteReservationRequest { + // Required. Resource name of the reservation to retrieve. E.g., + // `projects/myproject/locations/US/reservations/team1-prod` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/Reservation" + } + ]; +} + +// The request for [ReservationService.UpdateReservation][google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservation]. +message UpdateReservationRequest { + // Content of the reservation to update. + Reservation reservation = 1; + + // Standard field mask for the set of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request for [ReservationService.CreateCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.CreateCapacityCommitment]. +message CreateCapacityCommitmentRequest { + // Required. Resource name of the parent reservation. E.g., + // `projects/myproject/locations/US` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigqueryreservation.googleapis.com/CapacityCommitment" + } + ]; + + // Content of the capacity commitment to create. + CapacityCommitment capacity_commitment = 2; + + // If true, fail the request if another project in the organization has a + // capacity commitment. + bool enforce_single_admin_project_per_org = 4; +} + +// The request for [ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments]. +message ListCapacityCommitmentsRequest { + // Required. Resource name of the parent reservation. E.g., + // `projects/myproject/locations/US` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigqueryreservation.googleapis.com/CapacityCommitment" + } + ]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; +} + +// The response for [ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments]. +message ListCapacityCommitmentsResponse { + // List of capacity commitments visible to the user. + repeated CapacityCommitment capacity_commitments = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request for [ReservationService.GetCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitment]. +message GetCapacityCommitmentRequest { + // Required. Resource name of the capacity commitment to retrieve. E.g., + // `projects/myproject/locations/US/capacityCommitments/123` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/CapacityCommitment" + } + ]; +} + +// The request for [ReservationService.DeleteCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitment]. +message DeleteCapacityCommitmentRequest { + // Required. Resource name of the capacity commitment to delete. E.g., + // `projects/myproject/locations/US/capacityCommitments/123` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/CapacityCommitment" + } + ]; +} + +// The request for [ReservationService.UpdateCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment]. +message UpdateCapacityCommitmentRequest { + // Content of the capacity commitment to update. + CapacityCommitment capacity_commitment = 1; + + // Standard field mask for the set of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request for [ReservationService.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment]. +message SplitCapacityCommitmentRequest { + // Required. The resource name e.g.,: + // `projects/myproject/locations/US/capacityCommitments/123` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/CapacityCommitment" + } + ]; + + // Number of slots in the capacity commitment after the split. + int64 slot_count = 2; +} + +// The response for [ReservationService.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment]. +message SplitCapacityCommitmentResponse { + // First capacity commitment, result of a split. + CapacityCommitment first = 1; + + // Second capacity commitment, result of a split. + CapacityCommitment second = 2; +} + +// The request for [ReservationService.MergeCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitments]. +message MergeCapacityCommitmentsRequest { + // Parent resource that identifies admin project and location e.g., + // `projects/myproject/locations/us` + string parent = 1 [(google.api.resource_reference) = { + child_type: "bigqueryreservation.googleapis.com/CapacityCommitment" + }]; + + // Ids of capacity commitments to merge. + // These capacity commitments must exist under admin project and location + // specified in the parent. + // ID is the last portion of capacity commitment name e.g., 'abc' for + // projects/myproject/locations/US/capacityCommitments/abc + repeated string capacity_commitment_ids = 2; +} + +// A Assignment allows a project to submit jobs +// of a certain type using slots from the specified reservation. +message Assignment { + option (google.api.resource) = { + type: "bigqueryreservation.googleapis.com/Assignment" + pattern: "projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}" + }; + + // Types of job, which could be specified when using the reservation. + enum JobType { + // Invalid type. Requests with this value will be rejected with + // error code `google.rpc.Code.INVALID_ARGUMENT`. + JOB_TYPE_UNSPECIFIED = 0; + + // Pipeline (load/export) jobs from the project will use the reservation. + PIPELINE = 1; + + // Query jobs from the project will use the reservation. + QUERY = 2; + } + + // Assignment will remain in PENDING state if no active capacity commitment is + // present. It will become ACTIVE when some capacity commitment becomes + // active. + enum State { + // Invalid state value. + STATE_UNSPECIFIED = 0; + + // Queries from assignee will be executed as on-demand, if related + // assignment is pending. + PENDING = 1; + + // Assignment is ready. + ACTIVE = 2; + } + + // Output only. Name of the resource. E.g.: + // `projects/myproject/locations/US/reservations/team1-prod/assignments/123`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The resource which will use the reservation. E.g. + // `projects/myproject`, `folders/123`, or `organizations/456`. + string assignee = 4; + + // Which type of jobs will use the reservation. + JobType job_type = 3; + + // Output only. State of the assignment. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request for [ReservationService.CreateAssignment][google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignment]. +// Note: "bigquery.reservationAssignments.create" permission is required on the +// related assignee. +message CreateAssignmentRequest { + // Required. The parent resource name of the assignment + // E.g. `projects/myproject/locations/US/reservations/team1-prod` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigqueryreservation.googleapis.com/Assignment" + } + ]; + + // Assignment resource to create. + Assignment assignment = 2; +} + +// The request for [ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments]. +message ListAssignmentsRequest { + // Required. The parent resource name e.g.: + // + // `projects/myproject/locations/US/reservations/team1-prod` + // + // Or: + // + // `projects/myproject/locations/US/reservations/-` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "bigqueryreservation.googleapis.com/Assignment" + } + ]; + + // The maximum number of items to return per page. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; +} + +// The response for [ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments]. +message ListAssignmentsResponse { + // List of assignments visible to the user. + repeated Assignment assignments = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request for [ReservationService.DeleteAssignment][google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignment]. +// Note: "bigquery.reservationAssignments.delete" permission is required on the +// related assignee. +message DeleteAssignmentRequest { + // Required. Name of the resource, e.g. + // `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/Assignment" + } + ]; +} + +// The request for +// [ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments]. +// Note: "bigquery.reservationAssignments.search" permission is required on the +// related assignee. +message SearchAssignmentsRequest { + // Required. The resource name of the admin project(containing project and location), + // e.g.: + // `projects/myproject/locations/US`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Please specify resource name as assignee in the query. + // + // Examples: + // + // * `assignee=projects/myproject` + // * `assignee=folders/123` + // * `assignee=organizations/456` + string query = 2; + + // The maximum number of items to return per page. + int32 page_size = 3; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 4; +} + +// The response for [ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments]. +message SearchAssignmentsResponse { + // List of assignments visible to the user. + repeated Assignment assignments = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request for +// [ReservationService.MoveAssignment][google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignment]. +// +// **Note**: "bigquery.reservationAssignments.create" permission is required on +// the destination_id. +// +// **Note**: "bigquery.reservationAssignments.create" and +// "bigquery.reservationAssignments.delete" permission are required on the +// related assignee. +message MoveAssignmentRequest { + // Required. The resource name of the assignment, + // e.g. + // `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/Assignment" + } + ]; + + // The new reservation ID, e.g.: + // `projects/myotherproject/locations/US/reservations/team2-prod` + string destination_id = 3 [(google.api.resource_reference) = { + child_type: "bigqueryreservation.googleapis.com/Assignment" + }]; +} + +// Represents a BI Reservation. +message BiReservation { + option (google.api.resource) = { + type: "bigqueryreservation.googleapis.com/BiReservation" + pattern: "projects/{project}/locations/{location}/bireservation" + }; + + // The resource name of the singleton BI reservation. + // Reservation names have the form + // `projects/{project_id}/locations/{location_id}/bireservation`. + string name = 1; + + // Output only. The last update timestamp of a reservation. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Size of a reservation, in bytes. + int64 size = 4; +} + +// A request to get a singleton BI reservation. +message GetBiReservationRequest { + // Required. Name of the requested reservation, for example: + // `projects/{project_id}/locations/{location_id}/bireservation` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigqueryreservation.googleapis.com/BiReservation" + } + ]; +} + +// A request to update a BI reservation. +message UpdateBiReservationRequest { + // A reservation to update. + BiReservation bi_reservation = 1; + + // A list of fields to be updated in this request. + google.protobuf.FieldMask update_mask = 2; +} diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts b/packages/google-cloud-bigquery-reservation/protos/protos.d.ts new file mode 100644 index 00000000000..34412490242 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/protos/protos.d.ts @@ -0,0 +1,7424 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import * as Long from "long"; +import * as $protobuf from "protobufjs"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace bigquery. */ + namespace bigquery { + + /** Namespace reservation. */ + namespace reservation { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a ReservationService */ + class ReservationService extends $protobuf.rpc.Service { + + /** + * Constructs a new ReservationService 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 ReservationService 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): ReservationService; + + /** + * Calls CreateReservation. + * @param request CreateReservationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Reservation + */ + public createReservation(request: google.cloud.bigquery.reservation.v1.ICreateReservationRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.CreateReservationCallback): void; + + /** + * Calls CreateReservation. + * @param request CreateReservationRequest message or plain object + * @returns Promise + */ + public createReservation(request: google.cloud.bigquery.reservation.v1.ICreateReservationRequest): Promise; + + /** + * Calls ListReservations. + * @param request ListReservationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListReservationsResponse + */ + public listReservations(request: google.cloud.bigquery.reservation.v1.IListReservationsRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.ListReservationsCallback): void; + + /** + * Calls ListReservations. + * @param request ListReservationsRequest message or plain object + * @returns Promise + */ + public listReservations(request: google.cloud.bigquery.reservation.v1.IListReservationsRequest): Promise; + + /** + * Calls GetReservation. + * @param request GetReservationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Reservation + */ + public getReservation(request: google.cloud.bigquery.reservation.v1.IGetReservationRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.GetReservationCallback): void; + + /** + * Calls GetReservation. + * @param request GetReservationRequest message or plain object + * @returns Promise + */ + public getReservation(request: google.cloud.bigquery.reservation.v1.IGetReservationRequest): Promise; + + /** + * Calls DeleteReservation. + * @param request DeleteReservationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteReservation(request: google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservationCallback): void; + + /** + * Calls DeleteReservation. + * @param request DeleteReservationRequest message or plain object + * @returns Promise + */ + public deleteReservation(request: google.cloud.bigquery.reservation.v1.IDeleteReservationRequest): Promise; + + /** + * Calls UpdateReservation. + * @param request UpdateReservationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Reservation + */ + public updateReservation(request: google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservationCallback): void; + + /** + * Calls UpdateReservation. + * @param request UpdateReservationRequest message or plain object + * @returns Promise + */ + public updateReservation(request: google.cloud.bigquery.reservation.v1.IUpdateReservationRequest): Promise; + + /** + * Calls CreateCapacityCommitment. + * @param request CreateCapacityCommitmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CapacityCommitment + */ + public createCapacityCommitment(request: google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.CreateCapacityCommitmentCallback): void; + + /** + * Calls CreateCapacityCommitment. + * @param request CreateCapacityCommitmentRequest message or plain object + * @returns Promise + */ + public createCapacityCommitment(request: google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest): Promise; + + /** + * Calls ListCapacityCommitments. + * @param request ListCapacityCommitmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCapacityCommitmentsResponse + */ + public listCapacityCommitments(request: google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitmentsCallback): void; + + /** + * Calls ListCapacityCommitments. + * @param request ListCapacityCommitmentsRequest message or plain object + * @returns Promise + */ + public listCapacityCommitments(request: google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest): Promise; + + /** + * Calls GetCapacityCommitment. + * @param request GetCapacityCommitmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CapacityCommitment + */ + public getCapacityCommitment(request: google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitmentCallback): void; + + /** + * Calls GetCapacityCommitment. + * @param request GetCapacityCommitmentRequest message or plain object + * @returns Promise + */ + public getCapacityCommitment(request: google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest): Promise; + + /** + * Calls DeleteCapacityCommitment. + * @param request DeleteCapacityCommitmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteCapacityCommitment(request: google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitmentCallback): void; + + /** + * Calls DeleteCapacityCommitment. + * @param request DeleteCapacityCommitmentRequest message or plain object + * @returns Promise + */ + public deleteCapacityCommitment(request: google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest): Promise; + + /** + * Calls UpdateCapacityCommitment. + * @param request UpdateCapacityCommitmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CapacityCommitment + */ + public updateCapacityCommitment(request: google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitmentCallback): void; + + /** + * Calls UpdateCapacityCommitment. + * @param request UpdateCapacityCommitmentRequest message or plain object + * @returns Promise + */ + public updateCapacityCommitment(request: google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest): Promise; + + /** + * Calls SplitCapacityCommitment. + * @param request SplitCapacityCommitmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SplitCapacityCommitmentResponse + */ + public splitCapacityCommitment(request: google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitmentCallback): void; + + /** + * Calls SplitCapacityCommitment. + * @param request SplitCapacityCommitmentRequest message or plain object + * @returns Promise + */ + public splitCapacityCommitment(request: google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest): Promise; + + /** + * Calls MergeCapacityCommitments. + * @param request MergeCapacityCommitmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CapacityCommitment + */ + public mergeCapacityCommitments(request: google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitmentsCallback): void; + + /** + * Calls MergeCapacityCommitments. + * @param request MergeCapacityCommitmentsRequest message or plain object + * @returns Promise + */ + public mergeCapacityCommitments(request: google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest): Promise; + + /** + * Calls CreateAssignment. + * @param request CreateAssignmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Assignment + */ + public createAssignment(request: google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignmentCallback): void; + + /** + * Calls CreateAssignment. + * @param request CreateAssignmentRequest message or plain object + * @returns Promise + */ + public createAssignment(request: google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest): Promise; + + /** + * Calls ListAssignments. + * @param request ListAssignmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAssignmentsResponse + */ + public listAssignments(request: google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.ListAssignmentsCallback): void; + + /** + * Calls ListAssignments. + * @param request ListAssignmentsRequest message or plain object + * @returns Promise + */ + public listAssignments(request: google.cloud.bigquery.reservation.v1.IListAssignmentsRequest): Promise; + + /** + * Calls DeleteAssignment. + * @param request DeleteAssignmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAssignment(request: google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignmentCallback): void; + + /** + * Calls DeleteAssignment. + * @param request DeleteAssignmentRequest message or plain object + * @returns Promise + */ + public deleteAssignment(request: google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest): Promise; + + /** + * Calls SearchAssignments. + * @param request SearchAssignmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchAssignmentsResponse + */ + public searchAssignments(request: google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignmentsCallback): void; + + /** + * Calls SearchAssignments. + * @param request SearchAssignmentsRequest message or plain object + * @returns Promise + */ + public searchAssignments(request: google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest): Promise; + + /** + * Calls MoveAssignment. + * @param request MoveAssignmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Assignment + */ + public moveAssignment(request: google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignmentCallback): void; + + /** + * Calls MoveAssignment. + * @param request MoveAssignmentRequest message or plain object + * @returns Promise + */ + public moveAssignment(request: google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest): Promise; + + /** + * Calls GetBiReservation. + * @param request GetBiReservationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BiReservation + */ + public getBiReservation(request: google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.GetBiReservationCallback): void; + + /** + * Calls GetBiReservation. + * @param request GetBiReservationRequest message or plain object + * @returns Promise + */ + public getBiReservation(request: google.cloud.bigquery.reservation.v1.IGetBiReservationRequest): Promise; + + /** + * Calls UpdateBiReservation. + * @param request UpdateBiReservationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BiReservation + */ + public updateBiReservation(request: google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.UpdateBiReservationCallback): void; + + /** + * Calls UpdateBiReservation. + * @param request UpdateBiReservationRequest message or plain object + * @returns Promise + */ + public updateBiReservation(request: google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest): Promise; + } + + namespace ReservationService { + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#createReservation}. + * @param error Error, if any + * @param [response] Reservation + */ + type CreateReservationCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.Reservation) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#listReservations}. + * @param error Error, if any + * @param [response] ListReservationsResponse + */ + type ListReservationsCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.ListReservationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#getReservation}. + * @param error Error, if any + * @param [response] Reservation + */ + type GetReservationCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.Reservation) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#deleteReservation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteReservationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#updateReservation}. + * @param error Error, if any + * @param [response] Reservation + */ + type UpdateReservationCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.Reservation) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#createCapacityCommitment}. + * @param error Error, if any + * @param [response] CapacityCommitment + */ + type CreateCapacityCommitmentCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.CapacityCommitment) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#listCapacityCommitments}. + * @param error Error, if any + * @param [response] ListCapacityCommitmentsResponse + */ + type ListCapacityCommitmentsCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#getCapacityCommitment}. + * @param error Error, if any + * @param [response] CapacityCommitment + */ + type GetCapacityCommitmentCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.CapacityCommitment) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#deleteCapacityCommitment}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteCapacityCommitmentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#updateCapacityCommitment}. + * @param error Error, if any + * @param [response] CapacityCommitment + */ + type UpdateCapacityCommitmentCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.CapacityCommitment) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#splitCapacityCommitment}. + * @param error Error, if any + * @param [response] SplitCapacityCommitmentResponse + */ + type SplitCapacityCommitmentCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#mergeCapacityCommitments}. + * @param error Error, if any + * @param [response] CapacityCommitment + */ + type MergeCapacityCommitmentsCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.CapacityCommitment) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#createAssignment}. + * @param error Error, if any + * @param [response] Assignment + */ + type CreateAssignmentCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.Assignment) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#listAssignments}. + * @param error Error, if any + * @param [response] ListAssignmentsResponse + */ + type ListAssignmentsCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.ListAssignmentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#deleteAssignment}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAssignmentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#searchAssignments}. + * @param error Error, if any + * @param [response] SearchAssignmentsResponse + */ + type SearchAssignmentsCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#moveAssignment}. + * @param error Error, if any + * @param [response] Assignment + */ + type MoveAssignmentCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.Assignment) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#getBiReservation}. + * @param error Error, if any + * @param [response] BiReservation + */ + type GetBiReservationCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.BiReservation) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#updateBiReservation}. + * @param error Error, if any + * @param [response] BiReservation + */ + type UpdateBiReservationCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.BiReservation) => void; + } + + /** Properties of a Reservation. */ + interface IReservation { + + /** Reservation name */ + name?: (string|null); + + /** Reservation slotCapacity */ + slotCapacity?: (number|Long|string|null); + + /** Reservation ignoreIdleSlots */ + ignoreIdleSlots?: (boolean|null); + } + + /** Represents a Reservation. */ + class Reservation implements IReservation { + + /** + * Constructs a new Reservation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IReservation); + + /** Reservation name. */ + public name: string; + + /** Reservation slotCapacity. */ + public slotCapacity: (number|Long|string); + + /** Reservation ignoreIdleSlots. */ + public ignoreIdleSlots: boolean; + + /** + * Creates a new Reservation instance using the specified properties. + * @param [properties] Properties to set + * @returns Reservation instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IReservation): google.cloud.bigquery.reservation.v1.Reservation; + + /** + * Encodes the specified Reservation message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.Reservation.verify|verify} messages. + * @param message Reservation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IReservation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Reservation message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.Reservation.verify|verify} messages. + * @param message Reservation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IReservation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Reservation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Reservation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.Reservation; + + /** + * Decodes a Reservation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Reservation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.Reservation; + + /** + * Verifies a Reservation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Reservation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Reservation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.Reservation; + + /** + * Creates a plain object from a Reservation message. Also converts values to other types if specified. + * @param message Reservation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.Reservation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Reservation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CapacityCommitment. */ + interface ICapacityCommitment { + + /** CapacityCommitment name */ + name?: (string|null); + + /** CapacityCommitment slotCount */ + slotCount?: (number|Long|string|null); + + /** CapacityCommitment plan */ + plan?: (google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan|keyof typeof google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan|null); + + /** CapacityCommitment state */ + state?: (google.cloud.bigquery.reservation.v1.CapacityCommitment.State|keyof typeof google.cloud.bigquery.reservation.v1.CapacityCommitment.State|null); + + /** CapacityCommitment commitmentEndTime */ + commitmentEndTime?: (google.protobuf.ITimestamp|null); + + /** CapacityCommitment failureStatus */ + failureStatus?: (google.rpc.IStatus|null); + + /** CapacityCommitment renewalPlan */ + renewalPlan?: (google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan|keyof typeof google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan|null); + } + + /** Represents a CapacityCommitment. */ + class CapacityCommitment implements ICapacityCommitment { + + /** + * Constructs a new CapacityCommitment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.ICapacityCommitment); + + /** CapacityCommitment name. */ + public name: string; + + /** CapacityCommitment slotCount. */ + public slotCount: (number|Long|string); + + /** CapacityCommitment plan. */ + public plan: (google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan|keyof typeof google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan); + + /** CapacityCommitment state. */ + public state: (google.cloud.bigquery.reservation.v1.CapacityCommitment.State|keyof typeof google.cloud.bigquery.reservation.v1.CapacityCommitment.State); + + /** CapacityCommitment commitmentEndTime. */ + public commitmentEndTime?: (google.protobuf.ITimestamp|null); + + /** CapacityCommitment failureStatus. */ + public failureStatus?: (google.rpc.IStatus|null); + + /** CapacityCommitment renewalPlan. */ + public renewalPlan: (google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan|keyof typeof google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan); + + /** + * Creates a new CapacityCommitment instance using the specified properties. + * @param [properties] Properties to set + * @returns CapacityCommitment instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.ICapacityCommitment): google.cloud.bigquery.reservation.v1.CapacityCommitment; + + /** + * Encodes the specified CapacityCommitment message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CapacityCommitment.verify|verify} messages. + * @param message CapacityCommitment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.ICapacityCommitment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CapacityCommitment message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CapacityCommitment.verify|verify} messages. + * @param message CapacityCommitment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.ICapacityCommitment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CapacityCommitment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CapacityCommitment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.CapacityCommitment; + + /** + * Decodes a CapacityCommitment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CapacityCommitment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.CapacityCommitment; + + /** + * Verifies a CapacityCommitment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CapacityCommitment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CapacityCommitment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.CapacityCommitment; + + /** + * Creates a plain object from a CapacityCommitment message. Also converts values to other types if specified. + * @param message CapacityCommitment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.CapacityCommitment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CapacityCommitment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace CapacityCommitment { + + /** CommitmentPlan enum. */ + enum CommitmentPlan { + COMMITMENT_PLAN_UNSPECIFIED = 0, + FLEX = 3, + TRIAL = 5, + MONTHLY = 2, + ANNUAL = 4 + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + ACTIVE = 2, + FAILED = 3 + } + } + + /** Properties of a CreateReservationRequest. */ + interface ICreateReservationRequest { + + /** CreateReservationRequest parent */ + parent?: (string|null); + + /** CreateReservationRequest reservationId */ + reservationId?: (string|null); + + /** CreateReservationRequest reservation */ + reservation?: (google.cloud.bigquery.reservation.v1.IReservation|null); + } + + /** Represents a CreateReservationRequest. */ + class CreateReservationRequest implements ICreateReservationRequest { + + /** + * Constructs a new CreateReservationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.ICreateReservationRequest); + + /** CreateReservationRequest parent. */ + public parent: string; + + /** CreateReservationRequest reservationId. */ + public reservationId: string; + + /** CreateReservationRequest reservation. */ + public reservation?: (google.cloud.bigquery.reservation.v1.IReservation|null); + + /** + * Creates a new CreateReservationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateReservationRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.ICreateReservationRequest): google.cloud.bigquery.reservation.v1.CreateReservationRequest; + + /** + * Encodes the specified CreateReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateReservationRequest.verify|verify} messages. + * @param message CreateReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.ICreateReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateReservationRequest.verify|verify} messages. + * @param message CreateReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.ICreateReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateReservationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.CreateReservationRequest; + + /** + * Decodes a CreateReservationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.CreateReservationRequest; + + /** + * Verifies a CreateReservationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateReservationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateReservationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.CreateReservationRequest; + + /** + * Creates a plain object from a CreateReservationRequest message. Also converts values to other types if specified. + * @param message CreateReservationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.CreateReservationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateReservationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListReservationsRequest. */ + interface IListReservationsRequest { + + /** ListReservationsRequest parent */ + parent?: (string|null); + + /** ListReservationsRequest pageSize */ + pageSize?: (number|null); + + /** ListReservationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListReservationsRequest. */ + class ListReservationsRequest implements IListReservationsRequest { + + /** + * Constructs a new ListReservationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IListReservationsRequest); + + /** ListReservationsRequest parent. */ + public parent: string; + + /** ListReservationsRequest pageSize. */ + public pageSize: number; + + /** ListReservationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListReservationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReservationsRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IListReservationsRequest): google.cloud.bigquery.reservation.v1.ListReservationsRequest; + + /** + * Encodes the specified ListReservationsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListReservationsRequest.verify|verify} messages. + * @param message ListReservationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IListReservationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReservationsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListReservationsRequest.verify|verify} messages. + * @param message ListReservationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IListReservationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListReservationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReservationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.ListReservationsRequest; + + /** + * Decodes a ListReservationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReservationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.ListReservationsRequest; + + /** + * Verifies a ListReservationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListReservationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReservationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.ListReservationsRequest; + + /** + * Creates a plain object from a ListReservationsRequest message. Also converts values to other types if specified. + * @param message ListReservationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.ListReservationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReservationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListReservationsResponse. */ + interface IListReservationsResponse { + + /** ListReservationsResponse reservations */ + reservations?: (google.cloud.bigquery.reservation.v1.IReservation[]|null); + + /** ListReservationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListReservationsResponse. */ + class ListReservationsResponse implements IListReservationsResponse { + + /** + * Constructs a new ListReservationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IListReservationsResponse); + + /** ListReservationsResponse reservations. */ + public reservations: google.cloud.bigquery.reservation.v1.IReservation[]; + + /** ListReservationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListReservationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReservationsResponse instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IListReservationsResponse): google.cloud.bigquery.reservation.v1.ListReservationsResponse; + + /** + * Encodes the specified ListReservationsResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListReservationsResponse.verify|verify} messages. + * @param message ListReservationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IListReservationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReservationsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListReservationsResponse.verify|verify} messages. + * @param message ListReservationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IListReservationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListReservationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReservationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.ListReservationsResponse; + + /** + * Decodes a ListReservationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReservationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.ListReservationsResponse; + + /** + * Verifies a ListReservationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListReservationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReservationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.ListReservationsResponse; + + /** + * Creates a plain object from a ListReservationsResponse message. Also converts values to other types if specified. + * @param message ListReservationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.ListReservationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReservationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetReservationRequest. */ + interface IGetReservationRequest { + + /** GetReservationRequest name */ + name?: (string|null); + } + + /** Represents a GetReservationRequest. */ + class GetReservationRequest implements IGetReservationRequest { + + /** + * Constructs a new GetReservationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IGetReservationRequest); + + /** GetReservationRequest name. */ + public name: string; + + /** + * Creates a new GetReservationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetReservationRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IGetReservationRequest): google.cloud.bigquery.reservation.v1.GetReservationRequest; + + /** + * Encodes the specified GetReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetReservationRequest.verify|verify} messages. + * @param message GetReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IGetReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetReservationRequest.verify|verify} messages. + * @param message GetReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IGetReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetReservationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.GetReservationRequest; + + /** + * Decodes a GetReservationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.GetReservationRequest; + + /** + * Verifies a GetReservationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetReservationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetReservationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.GetReservationRequest; + + /** + * Creates a plain object from a GetReservationRequest message. Also converts values to other types if specified. + * @param message GetReservationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.GetReservationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetReservationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteReservationRequest. */ + interface IDeleteReservationRequest { + + /** DeleteReservationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteReservationRequest. */ + class DeleteReservationRequest implements IDeleteReservationRequest { + + /** + * Constructs a new DeleteReservationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IDeleteReservationRequest); + + /** DeleteReservationRequest name. */ + public name: string; + + /** + * Creates a new DeleteReservationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteReservationRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IDeleteReservationRequest): google.cloud.bigquery.reservation.v1.DeleteReservationRequest; + + /** + * Encodes the specified DeleteReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteReservationRequest.verify|verify} messages. + * @param message DeleteReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteReservationRequest.verify|verify} messages. + * @param message DeleteReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteReservationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.DeleteReservationRequest; + + /** + * Decodes a DeleteReservationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.DeleteReservationRequest; + + /** + * Verifies a DeleteReservationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteReservationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteReservationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.DeleteReservationRequest; + + /** + * Creates a plain object from a DeleteReservationRequest message. Also converts values to other types if specified. + * @param message DeleteReservationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.DeleteReservationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteReservationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateReservationRequest. */ + interface IUpdateReservationRequest { + + /** UpdateReservationRequest reservation */ + reservation?: (google.cloud.bigquery.reservation.v1.IReservation|null); + + /** UpdateReservationRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateReservationRequest. */ + class UpdateReservationRequest implements IUpdateReservationRequest { + + /** + * Constructs a new UpdateReservationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IUpdateReservationRequest); + + /** UpdateReservationRequest reservation. */ + public reservation?: (google.cloud.bigquery.reservation.v1.IReservation|null); + + /** UpdateReservationRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateReservationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateReservationRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IUpdateReservationRequest): google.cloud.bigquery.reservation.v1.UpdateReservationRequest; + + /** + * Encodes the specified UpdateReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateReservationRequest.verify|verify} messages. + * @param message UpdateReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateReservationRequest.verify|verify} messages. + * @param message UpdateReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateReservationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.UpdateReservationRequest; + + /** + * Decodes an UpdateReservationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.UpdateReservationRequest; + + /** + * Verifies an UpdateReservationRequest message. + * @param message Plain 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 UpdateReservationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateReservationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.UpdateReservationRequest; + + /** + * Creates a plain object from an UpdateReservationRequest message. Also converts values to other types if specified. + * @param message UpdateReservationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.UpdateReservationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateReservationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateCapacityCommitmentRequest. */ + interface ICreateCapacityCommitmentRequest { + + /** CreateCapacityCommitmentRequest parent */ + parent?: (string|null); + + /** CreateCapacityCommitmentRequest capacityCommitment */ + capacityCommitment?: (google.cloud.bigquery.reservation.v1.ICapacityCommitment|null); + + /** CreateCapacityCommitmentRequest enforceSingleAdminProjectPerOrg */ + enforceSingleAdminProjectPerOrg?: (boolean|null); + } + + /** Represents a CreateCapacityCommitmentRequest. */ + class CreateCapacityCommitmentRequest implements ICreateCapacityCommitmentRequest { + + /** + * Constructs a new CreateCapacityCommitmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest); + + /** CreateCapacityCommitmentRequest parent. */ + public parent: string; + + /** CreateCapacityCommitmentRequest capacityCommitment. */ + public capacityCommitment?: (google.cloud.bigquery.reservation.v1.ICapacityCommitment|null); + + /** CreateCapacityCommitmentRequest enforceSingleAdminProjectPerOrg. */ + public enforceSingleAdminProjectPerOrg: boolean; + + /** + * Creates a new CreateCapacityCommitmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCapacityCommitmentRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest): google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest; + + /** + * Encodes the specified CreateCapacityCommitmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest.verify|verify} messages. + * @param message CreateCapacityCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCapacityCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest.verify|verify} messages. + * @param message CreateCapacityCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCapacityCommitmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest; + + /** + * Decodes a CreateCapacityCommitmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest; + + /** + * Verifies a CreateCapacityCommitmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCapacityCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCapacityCommitmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest; + + /** + * Creates a plain object from a CreateCapacityCommitmentRequest message. Also converts values to other types if specified. + * @param message CreateCapacityCommitmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCapacityCommitmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListCapacityCommitmentsRequest. */ + interface IListCapacityCommitmentsRequest { + + /** ListCapacityCommitmentsRequest parent */ + parent?: (string|null); + + /** ListCapacityCommitmentsRequest pageSize */ + pageSize?: (number|null); + + /** ListCapacityCommitmentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListCapacityCommitmentsRequest. */ + class ListCapacityCommitmentsRequest implements IListCapacityCommitmentsRequest { + + /** + * Constructs a new ListCapacityCommitmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest); + + /** ListCapacityCommitmentsRequest parent. */ + public parent: string; + + /** ListCapacityCommitmentsRequest pageSize. */ + public pageSize: number; + + /** ListCapacityCommitmentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListCapacityCommitmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCapacityCommitmentsRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest): google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest; + + /** + * Encodes the specified ListCapacityCommitmentsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest.verify|verify} messages. + * @param message ListCapacityCommitmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCapacityCommitmentsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest.verify|verify} messages. + * @param message ListCapacityCommitmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCapacityCommitmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCapacityCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest; + + /** + * Decodes a ListCapacityCommitmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCapacityCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest; + + /** + * Verifies a ListCapacityCommitmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCapacityCommitmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCapacityCommitmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest; + + /** + * Creates a plain object from a ListCapacityCommitmentsRequest message. Also converts values to other types if specified. + * @param message ListCapacityCommitmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCapacityCommitmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListCapacityCommitmentsResponse. */ + interface IListCapacityCommitmentsResponse { + + /** ListCapacityCommitmentsResponse capacityCommitments */ + capacityCommitments?: (google.cloud.bigquery.reservation.v1.ICapacityCommitment[]|null); + + /** ListCapacityCommitmentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListCapacityCommitmentsResponse. */ + class ListCapacityCommitmentsResponse implements IListCapacityCommitmentsResponse { + + /** + * Constructs a new ListCapacityCommitmentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse); + + /** ListCapacityCommitmentsResponse capacityCommitments. */ + public capacityCommitments: google.cloud.bigquery.reservation.v1.ICapacityCommitment[]; + + /** ListCapacityCommitmentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListCapacityCommitmentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCapacityCommitmentsResponse instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse): google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse; + + /** + * Encodes the specified ListCapacityCommitmentsResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse.verify|verify} messages. + * @param message ListCapacityCommitmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCapacityCommitmentsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse.verify|verify} messages. + * @param message ListCapacityCommitmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCapacityCommitmentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCapacityCommitmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse; + + /** + * Decodes a ListCapacityCommitmentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCapacityCommitmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse; + + /** + * Verifies a ListCapacityCommitmentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCapacityCommitmentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCapacityCommitmentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse; + + /** + * Creates a plain object from a ListCapacityCommitmentsResponse message. Also converts values to other types if specified. + * @param message ListCapacityCommitmentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCapacityCommitmentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetCapacityCommitmentRequest. */ + interface IGetCapacityCommitmentRequest { + + /** GetCapacityCommitmentRequest name */ + name?: (string|null); + } + + /** Represents a GetCapacityCommitmentRequest. */ + class GetCapacityCommitmentRequest implements IGetCapacityCommitmentRequest { + + /** + * Constructs a new GetCapacityCommitmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest); + + /** GetCapacityCommitmentRequest name. */ + public name: string; + + /** + * Creates a new GetCapacityCommitmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCapacityCommitmentRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest): google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest; + + /** + * Encodes the specified GetCapacityCommitmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest.verify|verify} messages. + * @param message GetCapacityCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCapacityCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest.verify|verify} messages. + * @param message GetCapacityCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCapacityCommitmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest; + + /** + * Decodes a GetCapacityCommitmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest; + + /** + * Verifies a GetCapacityCommitmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCapacityCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCapacityCommitmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest; + + /** + * Creates a plain object from a GetCapacityCommitmentRequest message. Also converts values to other types if specified. + * @param message GetCapacityCommitmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCapacityCommitmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteCapacityCommitmentRequest. */ + interface IDeleteCapacityCommitmentRequest { + + /** DeleteCapacityCommitmentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteCapacityCommitmentRequest. */ + class DeleteCapacityCommitmentRequest implements IDeleteCapacityCommitmentRequest { + + /** + * Constructs a new DeleteCapacityCommitmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest); + + /** DeleteCapacityCommitmentRequest name. */ + public name: string; + + /** + * Creates a new DeleteCapacityCommitmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCapacityCommitmentRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest): google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest; + + /** + * Encodes the specified DeleteCapacityCommitmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest.verify|verify} messages. + * @param message DeleteCapacityCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCapacityCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest.verify|verify} messages. + * @param message DeleteCapacityCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCapacityCommitmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest; + + /** + * Decodes a DeleteCapacityCommitmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest; + + /** + * Verifies a DeleteCapacityCommitmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteCapacityCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCapacityCommitmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest; + + /** + * Creates a plain object from a DeleteCapacityCommitmentRequest message. Also converts values to other types if specified. + * @param message DeleteCapacityCommitmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCapacityCommitmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateCapacityCommitmentRequest. */ + interface IUpdateCapacityCommitmentRequest { + + /** UpdateCapacityCommitmentRequest capacityCommitment */ + capacityCommitment?: (google.cloud.bigquery.reservation.v1.ICapacityCommitment|null); + + /** UpdateCapacityCommitmentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateCapacityCommitmentRequest. */ + class UpdateCapacityCommitmentRequest implements IUpdateCapacityCommitmentRequest { + + /** + * Constructs a new UpdateCapacityCommitmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest); + + /** UpdateCapacityCommitmentRequest capacityCommitment. */ + public capacityCommitment?: (google.cloud.bigquery.reservation.v1.ICapacityCommitment|null); + + /** UpdateCapacityCommitmentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateCapacityCommitmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCapacityCommitmentRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest): google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest; + + /** + * Encodes the specified UpdateCapacityCommitmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest.verify|verify} messages. + * @param message UpdateCapacityCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCapacityCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest.verify|verify} messages. + * @param message UpdateCapacityCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCapacityCommitmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest; + + /** + * Decodes an UpdateCapacityCommitmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest; + + /** + * Verifies an UpdateCapacityCommitmentRequest message. + * @param message Plain 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 UpdateCapacityCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCapacityCommitmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest; + + /** + * Creates a plain object from an UpdateCapacityCommitmentRequest message. Also converts values to other types if specified. + * @param message UpdateCapacityCommitmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCapacityCommitmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SplitCapacityCommitmentRequest. */ + interface ISplitCapacityCommitmentRequest { + + /** SplitCapacityCommitmentRequest name */ + name?: (string|null); + + /** SplitCapacityCommitmentRequest slotCount */ + slotCount?: (number|Long|string|null); + } + + /** Represents a SplitCapacityCommitmentRequest. */ + class SplitCapacityCommitmentRequest implements ISplitCapacityCommitmentRequest { + + /** + * Constructs a new SplitCapacityCommitmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest); + + /** SplitCapacityCommitmentRequest name. */ + public name: string; + + /** SplitCapacityCommitmentRequest slotCount. */ + public slotCount: (number|Long|string); + + /** + * Creates a new SplitCapacityCommitmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SplitCapacityCommitmentRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest): google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest; + + /** + * Encodes the specified SplitCapacityCommitmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest.verify|verify} messages. + * @param message SplitCapacityCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SplitCapacityCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest.verify|verify} messages. + * @param message SplitCapacityCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SplitCapacityCommitmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SplitCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest; + + /** + * Decodes a SplitCapacityCommitmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SplitCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest; + + /** + * Verifies a SplitCapacityCommitmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SplitCapacityCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SplitCapacityCommitmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest; + + /** + * Creates a plain object from a SplitCapacityCommitmentRequest message. Also converts values to other types if specified. + * @param message SplitCapacityCommitmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SplitCapacityCommitmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SplitCapacityCommitmentResponse. */ + interface ISplitCapacityCommitmentResponse { + + /** SplitCapacityCommitmentResponse first */ + first?: (google.cloud.bigquery.reservation.v1.ICapacityCommitment|null); + + /** SplitCapacityCommitmentResponse second */ + second?: (google.cloud.bigquery.reservation.v1.ICapacityCommitment|null); + } + + /** Represents a SplitCapacityCommitmentResponse. */ + class SplitCapacityCommitmentResponse implements ISplitCapacityCommitmentResponse { + + /** + * Constructs a new SplitCapacityCommitmentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse); + + /** SplitCapacityCommitmentResponse first. */ + public first?: (google.cloud.bigquery.reservation.v1.ICapacityCommitment|null); + + /** SplitCapacityCommitmentResponse second. */ + public second?: (google.cloud.bigquery.reservation.v1.ICapacityCommitment|null); + + /** + * Creates a new SplitCapacityCommitmentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SplitCapacityCommitmentResponse instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse): google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse; + + /** + * Encodes the specified SplitCapacityCommitmentResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse.verify|verify} messages. + * @param message SplitCapacityCommitmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SplitCapacityCommitmentResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse.verify|verify} messages. + * @param message SplitCapacityCommitmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SplitCapacityCommitmentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SplitCapacityCommitmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse; + + /** + * Decodes a SplitCapacityCommitmentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SplitCapacityCommitmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse; + + /** + * Verifies a SplitCapacityCommitmentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SplitCapacityCommitmentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SplitCapacityCommitmentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse; + + /** + * Creates a plain object from a SplitCapacityCommitmentResponse message. Also converts values to other types if specified. + * @param message SplitCapacityCommitmentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SplitCapacityCommitmentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MergeCapacityCommitmentsRequest. */ + interface IMergeCapacityCommitmentsRequest { + + /** MergeCapacityCommitmentsRequest parent */ + parent?: (string|null); + + /** MergeCapacityCommitmentsRequest capacityCommitmentIds */ + capacityCommitmentIds?: (string[]|null); + } + + /** Represents a MergeCapacityCommitmentsRequest. */ + class MergeCapacityCommitmentsRequest implements IMergeCapacityCommitmentsRequest { + + /** + * Constructs a new MergeCapacityCommitmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest); + + /** MergeCapacityCommitmentsRequest parent. */ + public parent: string; + + /** MergeCapacityCommitmentsRequest capacityCommitmentIds. */ + public capacityCommitmentIds: string[]; + + /** + * Creates a new MergeCapacityCommitmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MergeCapacityCommitmentsRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest): google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest; + + /** + * Encodes the specified MergeCapacityCommitmentsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest.verify|verify} messages. + * @param message MergeCapacityCommitmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MergeCapacityCommitmentsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest.verify|verify} messages. + * @param message MergeCapacityCommitmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MergeCapacityCommitmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MergeCapacityCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest; + + /** + * Decodes a MergeCapacityCommitmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MergeCapacityCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest; + + /** + * Verifies a MergeCapacityCommitmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MergeCapacityCommitmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MergeCapacityCommitmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest; + + /** + * Creates a plain object from a MergeCapacityCommitmentsRequest message. Also converts values to other types if specified. + * @param message MergeCapacityCommitmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MergeCapacityCommitmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Assignment. */ + interface IAssignment { + + /** Assignment name */ + name?: (string|null); + + /** Assignment assignee */ + assignee?: (string|null); + + /** Assignment jobType */ + jobType?: (google.cloud.bigquery.reservation.v1.Assignment.JobType|keyof typeof google.cloud.bigquery.reservation.v1.Assignment.JobType|null); + + /** Assignment state */ + state?: (google.cloud.bigquery.reservation.v1.Assignment.State|keyof typeof google.cloud.bigquery.reservation.v1.Assignment.State|null); + } + + /** Represents an Assignment. */ + class Assignment implements IAssignment { + + /** + * Constructs a new Assignment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IAssignment); + + /** Assignment name. */ + public name: string; + + /** Assignment assignee. */ + public assignee: string; + + /** Assignment jobType. */ + public jobType: (google.cloud.bigquery.reservation.v1.Assignment.JobType|keyof typeof google.cloud.bigquery.reservation.v1.Assignment.JobType); + + /** Assignment state. */ + public state: (google.cloud.bigquery.reservation.v1.Assignment.State|keyof typeof google.cloud.bigquery.reservation.v1.Assignment.State); + + /** + * Creates a new Assignment instance using the specified properties. + * @param [properties] Properties to set + * @returns Assignment instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IAssignment): google.cloud.bigquery.reservation.v1.Assignment; + + /** + * Encodes the specified Assignment message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.Assignment.verify|verify} messages. + * @param message Assignment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IAssignment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Assignment message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.Assignment.verify|verify} messages. + * @param message Assignment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IAssignment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Assignment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Assignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.Assignment; + + /** + * Decodes an Assignment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Assignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.Assignment; + + /** + * Verifies an Assignment message. + * @param message Plain 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 Assignment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Assignment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.Assignment; + + /** + * Creates a plain object from an Assignment message. Also converts values to other types if specified. + * @param message Assignment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.Assignment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Assignment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Assignment { + + /** JobType enum. */ + enum JobType { + JOB_TYPE_UNSPECIFIED = 0, + PIPELINE = 1, + QUERY = 2 + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + ACTIVE = 2 + } + } + + /** Properties of a CreateAssignmentRequest. */ + interface ICreateAssignmentRequest { + + /** CreateAssignmentRequest parent */ + parent?: (string|null); + + /** CreateAssignmentRequest assignment */ + assignment?: (google.cloud.bigquery.reservation.v1.IAssignment|null); + } + + /** Represents a CreateAssignmentRequest. */ + class CreateAssignmentRequest implements ICreateAssignmentRequest { + + /** + * Constructs a new CreateAssignmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest); + + /** CreateAssignmentRequest parent. */ + public parent: string; + + /** CreateAssignmentRequest assignment. */ + public assignment?: (google.cloud.bigquery.reservation.v1.IAssignment|null); + + /** + * Creates a new CreateAssignmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAssignmentRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest): google.cloud.bigquery.reservation.v1.CreateAssignmentRequest; + + /** + * Encodes the specified CreateAssignmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateAssignmentRequest.verify|verify} messages. + * @param message CreateAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateAssignmentRequest.verify|verify} messages. + * @param message CreateAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAssignmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.CreateAssignmentRequest; + + /** + * Decodes a CreateAssignmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.CreateAssignmentRequest; + + /** + * Verifies a CreateAssignmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAssignmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.CreateAssignmentRequest; + + /** + * Creates a plain object from a CreateAssignmentRequest message. Also converts values to other types if specified. + * @param message CreateAssignmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.CreateAssignmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAssignmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListAssignmentsRequest. */ + interface IListAssignmentsRequest { + + /** ListAssignmentsRequest parent */ + parent?: (string|null); + + /** ListAssignmentsRequest pageSize */ + pageSize?: (number|null); + + /** ListAssignmentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAssignmentsRequest. */ + class ListAssignmentsRequest implements IListAssignmentsRequest { + + /** + * Constructs a new ListAssignmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IListAssignmentsRequest); + + /** ListAssignmentsRequest parent. */ + public parent: string; + + /** ListAssignmentsRequest pageSize. */ + public pageSize: number; + + /** ListAssignmentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAssignmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssignmentsRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IListAssignmentsRequest): google.cloud.bigquery.reservation.v1.ListAssignmentsRequest; + + /** + * Encodes the specified ListAssignmentsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListAssignmentsRequest.verify|verify} messages. + * @param message ListAssignmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssignmentsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListAssignmentsRequest.verify|verify} messages. + * @param message ListAssignmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssignmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.ListAssignmentsRequest; + + /** + * Decodes a ListAssignmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.ListAssignmentsRequest; + + /** + * Verifies a ListAssignmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAssignmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssignmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.ListAssignmentsRequest; + + /** + * Creates a plain object from a ListAssignmentsRequest message. Also converts values to other types if specified. + * @param message ListAssignmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.ListAssignmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssignmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListAssignmentsResponse. */ + interface IListAssignmentsResponse { + + /** ListAssignmentsResponse assignments */ + assignments?: (google.cloud.bigquery.reservation.v1.IAssignment[]|null); + + /** ListAssignmentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAssignmentsResponse. */ + class ListAssignmentsResponse implements IListAssignmentsResponse { + + /** + * Constructs a new ListAssignmentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IListAssignmentsResponse); + + /** ListAssignmentsResponse assignments. */ + public assignments: google.cloud.bigquery.reservation.v1.IAssignment[]; + + /** ListAssignmentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAssignmentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssignmentsResponse instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IListAssignmentsResponse): google.cloud.bigquery.reservation.v1.ListAssignmentsResponse; + + /** + * Encodes the specified ListAssignmentsResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListAssignmentsResponse.verify|verify} messages. + * @param message ListAssignmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IListAssignmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssignmentsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListAssignmentsResponse.verify|verify} messages. + * @param message ListAssignmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IListAssignmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssignmentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.ListAssignmentsResponse; + + /** + * Decodes a ListAssignmentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.ListAssignmentsResponse; + + /** + * Verifies a ListAssignmentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAssignmentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssignmentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.ListAssignmentsResponse; + + /** + * Creates a plain object from a ListAssignmentsResponse message. Also converts values to other types if specified. + * @param message ListAssignmentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.ListAssignmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssignmentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteAssignmentRequest. */ + interface IDeleteAssignmentRequest { + + /** DeleteAssignmentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteAssignmentRequest. */ + class DeleteAssignmentRequest implements IDeleteAssignmentRequest { + + /** + * Constructs a new DeleteAssignmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest); + + /** DeleteAssignmentRequest name. */ + public name: string; + + /** + * Creates a new DeleteAssignmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAssignmentRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest): google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest; + + /** + * Encodes the specified DeleteAssignmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest.verify|verify} messages. + * @param message DeleteAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest.verify|verify} messages. + * @param message DeleteAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAssignmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest; + + /** + * Decodes a DeleteAssignmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest; + + /** + * Verifies a DeleteAssignmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAssignmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest; + + /** + * Creates a plain object from a DeleteAssignmentRequest message. Also converts values to other types if specified. + * @param message DeleteAssignmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAssignmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SearchAssignmentsRequest. */ + interface ISearchAssignmentsRequest { + + /** SearchAssignmentsRequest parent */ + parent?: (string|null); + + /** SearchAssignmentsRequest query */ + query?: (string|null); + + /** SearchAssignmentsRequest pageSize */ + pageSize?: (number|null); + + /** SearchAssignmentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a SearchAssignmentsRequest. */ + class SearchAssignmentsRequest implements ISearchAssignmentsRequest { + + /** + * Constructs a new SearchAssignmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest); + + /** SearchAssignmentsRequest parent. */ + public parent: string; + + /** SearchAssignmentsRequest query. */ + public query: string; + + /** SearchAssignmentsRequest pageSize. */ + public pageSize: number; + + /** SearchAssignmentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new SearchAssignmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchAssignmentsRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest): google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest; + + /** + * Encodes the specified SearchAssignmentsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest.verify|verify} messages. + * @param message SearchAssignmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchAssignmentsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest.verify|verify} messages. + * @param message SearchAssignmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchAssignmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest; + + /** + * Decodes a SearchAssignmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest; + + /** + * Verifies a SearchAssignmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchAssignmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchAssignmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest; + + /** + * Creates a plain object from a SearchAssignmentsRequest message. Also converts values to other types if specified. + * @param message SearchAssignmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchAssignmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SearchAssignmentsResponse. */ + interface ISearchAssignmentsResponse { + + /** SearchAssignmentsResponse assignments */ + assignments?: (google.cloud.bigquery.reservation.v1.IAssignment[]|null); + + /** SearchAssignmentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchAssignmentsResponse. */ + class SearchAssignmentsResponse implements ISearchAssignmentsResponse { + + /** + * Constructs a new SearchAssignmentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse); + + /** SearchAssignmentsResponse assignments. */ + public assignments: google.cloud.bigquery.reservation.v1.IAssignment[]; + + /** SearchAssignmentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchAssignmentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchAssignmentsResponse instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse): google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse; + + /** + * Encodes the specified SearchAssignmentsResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse.verify|verify} messages. + * @param message SearchAssignmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchAssignmentsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse.verify|verify} messages. + * @param message SearchAssignmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchAssignmentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse; + + /** + * Decodes a SearchAssignmentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse; + + /** + * Verifies a SearchAssignmentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchAssignmentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchAssignmentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse; + + /** + * Creates a plain object from a SearchAssignmentsResponse message. Also converts values to other types if specified. + * @param message SearchAssignmentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchAssignmentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MoveAssignmentRequest. */ + interface IMoveAssignmentRequest { + + /** MoveAssignmentRequest name */ + name?: (string|null); + + /** MoveAssignmentRequest destinationId */ + destinationId?: (string|null); + } + + /** Represents a MoveAssignmentRequest. */ + class MoveAssignmentRequest implements IMoveAssignmentRequest { + + /** + * Constructs a new MoveAssignmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest); + + /** MoveAssignmentRequest name. */ + public name: string; + + /** MoveAssignmentRequest destinationId. */ + public destinationId: string; + + /** + * Creates a new MoveAssignmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MoveAssignmentRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest): google.cloud.bigquery.reservation.v1.MoveAssignmentRequest; + + /** + * Encodes the specified MoveAssignmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.MoveAssignmentRequest.verify|verify} messages. + * @param message MoveAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MoveAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.MoveAssignmentRequest.verify|verify} messages. + * @param message MoveAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MoveAssignmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.MoveAssignmentRequest; + + /** + * Decodes a MoveAssignmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.MoveAssignmentRequest; + + /** + * Verifies a MoveAssignmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MoveAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveAssignmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.MoveAssignmentRequest; + + /** + * Creates a plain object from a MoveAssignmentRequest message. Also converts values to other types if specified. + * @param message MoveAssignmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.MoveAssignmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveAssignmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BiReservation. */ + interface IBiReservation { + + /** BiReservation name */ + name?: (string|null); + + /** BiReservation updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** BiReservation size */ + size?: (number|Long|string|null); + } + + /** Represents a BiReservation. */ + class BiReservation implements IBiReservation { + + /** + * Constructs a new BiReservation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IBiReservation); + + /** BiReservation name. */ + public name: string; + + /** BiReservation updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** BiReservation size. */ + public size: (number|Long|string); + + /** + * Creates a new BiReservation instance using the specified properties. + * @param [properties] Properties to set + * @returns BiReservation instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IBiReservation): google.cloud.bigquery.reservation.v1.BiReservation; + + /** + * Encodes the specified BiReservation message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.BiReservation.verify|verify} messages. + * @param message BiReservation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IBiReservation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BiReservation message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.BiReservation.verify|verify} messages. + * @param message BiReservation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IBiReservation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BiReservation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BiReservation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.BiReservation; + + /** + * Decodes a BiReservation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BiReservation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.BiReservation; + + /** + * Verifies a BiReservation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BiReservation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BiReservation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.BiReservation; + + /** + * Creates a plain object from a BiReservation message. Also converts values to other types if specified. + * @param message BiReservation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.BiReservation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BiReservation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetBiReservationRequest. */ + interface IGetBiReservationRequest { + + /** GetBiReservationRequest name */ + name?: (string|null); + } + + /** Represents a GetBiReservationRequest. */ + class GetBiReservationRequest implements IGetBiReservationRequest { + + /** + * Constructs a new GetBiReservationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IGetBiReservationRequest); + + /** GetBiReservationRequest name. */ + public name: string; + + /** + * Creates a new GetBiReservationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBiReservationRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IGetBiReservationRequest): google.cloud.bigquery.reservation.v1.GetBiReservationRequest; + + /** + * Encodes the specified GetBiReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetBiReservationRequest.verify|verify} messages. + * @param message GetBiReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBiReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetBiReservationRequest.verify|verify} messages. + * @param message GetBiReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBiReservationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBiReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.GetBiReservationRequest; + + /** + * Decodes a GetBiReservationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBiReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.GetBiReservationRequest; + + /** + * Verifies a GetBiReservationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBiReservationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBiReservationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.GetBiReservationRequest; + + /** + * Creates a plain object from a GetBiReservationRequest message. Also converts values to other types if specified. + * @param message GetBiReservationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.GetBiReservationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBiReservationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateBiReservationRequest. */ + interface IUpdateBiReservationRequest { + + /** UpdateBiReservationRequest biReservation */ + biReservation?: (google.cloud.bigquery.reservation.v1.IBiReservation|null); + + /** UpdateBiReservationRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateBiReservationRequest. */ + class UpdateBiReservationRequest implements IUpdateBiReservationRequest { + + /** + * Constructs a new UpdateBiReservationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest); + + /** UpdateBiReservationRequest biReservation. */ + public biReservation?: (google.cloud.bigquery.reservation.v1.IBiReservation|null); + + /** UpdateBiReservationRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateBiReservationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBiReservationRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest): google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest; + + /** + * Encodes the specified UpdateBiReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest.verify|verify} messages. + * @param message UpdateBiReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBiReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest.verify|verify} messages. + * @param message UpdateBiReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBiReservationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBiReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest; + + /** + * Decodes an UpdateBiReservationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBiReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest; + + /** + * Verifies an UpdateBiReservationRequest message. + * @param message Plain 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 UpdateBiReservationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBiReservationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest; + + /** + * Creates a plain object from an UpdateBiReservationRequest message. Also converts values to other types if specified. + * @param message UpdateBiReservationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBiReservationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get: string; + + /** HttpRule put. */ + public put: string; + + /** HttpRule post. */ + public post: string; + + /** HttpRule delete. */ + public delete: string; + + /** HttpRule patch. */ + public patch: string; + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** 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 }; + } + } + + /** 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-bigquery-reservation/protos/protos.js b/packages/google-cloud-bigquery-reservation/protos/protos.js new file mode 100644 index 00000000000..8b4c41c88a8 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/protos/protos.js @@ -0,0 +1,18517 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("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._google_cloud_bigquery_reservation_protos || ($protobuf.roots._google_cloud_bigquery_reservation_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.bigquery = (function() { + + /** + * Namespace bigquery. + * @memberof google.cloud + * @namespace + */ + var bigquery = {}; + + bigquery.reservation = (function() { + + /** + * Namespace reservation. + * @memberof google.cloud.bigquery + * @namespace + */ + var reservation = {}; + + reservation.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.bigquery.reservation + * @namespace + */ + var v1 = {}; + + v1.ReservationService = (function() { + + /** + * Constructs a new ReservationService service. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a ReservationService + * @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 ReservationService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ReservationService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ReservationService; + + /** + * Creates new ReservationService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @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 {ReservationService} RPC service. Useful where requests and/or responses are streamed. + */ + ReservationService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#createReservation}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef CreateReservationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.Reservation} [response] Reservation + */ + + /** + * Calls CreateReservation. + * @function createReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ICreateReservationRequest} request CreateReservationRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.CreateReservationCallback} callback Node-style callback called with the error, if any, and Reservation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.createReservation = function createReservation(request, callback) { + return this.rpcCall(createReservation, $root.google.cloud.bigquery.reservation.v1.CreateReservationRequest, $root.google.cloud.bigquery.reservation.v1.Reservation, request, callback); + }, "name", { value: "CreateReservation" }); + + /** + * Calls CreateReservation. + * @function createReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ICreateReservationRequest} request CreateReservationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#listReservations}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef ListReservationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.ListReservationsResponse} [response] ListReservationsResponse + */ + + /** + * Calls ListReservations. + * @function listReservations + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IListReservationsRequest} request ListReservationsRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.ListReservationsCallback} callback Node-style callback called with the error, if any, and ListReservationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.listReservations = function listReservations(request, callback) { + return this.rpcCall(listReservations, $root.google.cloud.bigquery.reservation.v1.ListReservationsRequest, $root.google.cloud.bigquery.reservation.v1.ListReservationsResponse, request, callback); + }, "name", { value: "ListReservations" }); + + /** + * Calls ListReservations. + * @function listReservations + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IListReservationsRequest} request ListReservationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#getReservation}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef GetReservationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.Reservation} [response] Reservation + */ + + /** + * Calls GetReservation. + * @function getReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IGetReservationRequest} request GetReservationRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.GetReservationCallback} callback Node-style callback called with the error, if any, and Reservation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.getReservation = function getReservation(request, callback) { + return this.rpcCall(getReservation, $root.google.cloud.bigquery.reservation.v1.GetReservationRequest, $root.google.cloud.bigquery.reservation.v1.Reservation, request, callback); + }, "name", { value: "GetReservation" }); + + /** + * Calls GetReservation. + * @function getReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IGetReservationRequest} request GetReservationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#deleteReservation}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef DeleteReservationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteReservation. + * @function deleteReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IDeleteReservationRequest} request DeleteReservationRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.deleteReservation = function deleteReservation(request, callback) { + return this.rpcCall(deleteReservation, $root.google.cloud.bigquery.reservation.v1.DeleteReservationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteReservation" }); + + /** + * Calls DeleteReservation. + * @function deleteReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IDeleteReservationRequest} request DeleteReservationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#updateReservation}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef UpdateReservationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.Reservation} [response] Reservation + */ + + /** + * Calls UpdateReservation. + * @function updateReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IUpdateReservationRequest} request UpdateReservationRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservationCallback} callback Node-style callback called with the error, if any, and Reservation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.updateReservation = function updateReservation(request, callback) { + return this.rpcCall(updateReservation, $root.google.cloud.bigquery.reservation.v1.UpdateReservationRequest, $root.google.cloud.bigquery.reservation.v1.Reservation, request, callback); + }, "name", { value: "UpdateReservation" }); + + /** + * Calls UpdateReservation. + * @function updateReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IUpdateReservationRequest} request UpdateReservationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#createCapacityCommitment}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef CreateCapacityCommitmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.CapacityCommitment} [response] CapacityCommitment + */ + + /** + * Calls CreateCapacityCommitment. + * @function createCapacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest} request CreateCapacityCommitmentRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.CreateCapacityCommitmentCallback} callback Node-style callback called with the error, if any, and CapacityCommitment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.createCapacityCommitment = function createCapacityCommitment(request, callback) { + return this.rpcCall(createCapacityCommitment, $root.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest, $root.google.cloud.bigquery.reservation.v1.CapacityCommitment, request, callback); + }, "name", { value: "CreateCapacityCommitment" }); + + /** + * Calls CreateCapacityCommitment. + * @function createCapacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest} request CreateCapacityCommitmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#listCapacityCommitments}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef ListCapacityCommitmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse} [response] ListCapacityCommitmentsResponse + */ + + /** + * Calls ListCapacityCommitments. + * @function listCapacityCommitments + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest} request ListCapacityCommitmentsRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitmentsCallback} callback Node-style callback called with the error, if any, and ListCapacityCommitmentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.listCapacityCommitments = function listCapacityCommitments(request, callback) { + return this.rpcCall(listCapacityCommitments, $root.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest, $root.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse, request, callback); + }, "name", { value: "ListCapacityCommitments" }); + + /** + * Calls ListCapacityCommitments. + * @function listCapacityCommitments + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest} request ListCapacityCommitmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#getCapacityCommitment}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef GetCapacityCommitmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.CapacityCommitment} [response] CapacityCommitment + */ + + /** + * Calls GetCapacityCommitment. + * @function getCapacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest} request GetCapacityCommitmentRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitmentCallback} callback Node-style callback called with the error, if any, and CapacityCommitment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.getCapacityCommitment = function getCapacityCommitment(request, callback) { + return this.rpcCall(getCapacityCommitment, $root.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest, $root.google.cloud.bigquery.reservation.v1.CapacityCommitment, request, callback); + }, "name", { value: "GetCapacityCommitment" }); + + /** + * Calls GetCapacityCommitment. + * @function getCapacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest} request GetCapacityCommitmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#deleteCapacityCommitment}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef DeleteCapacityCommitmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteCapacityCommitment. + * @function deleteCapacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest} request DeleteCapacityCommitmentRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitmentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.deleteCapacityCommitment = function deleteCapacityCommitment(request, callback) { + return this.rpcCall(deleteCapacityCommitment, $root.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteCapacityCommitment" }); + + /** + * Calls DeleteCapacityCommitment. + * @function deleteCapacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest} request DeleteCapacityCommitmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#updateCapacityCommitment}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef UpdateCapacityCommitmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.CapacityCommitment} [response] CapacityCommitment + */ + + /** + * Calls UpdateCapacityCommitment. + * @function updateCapacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest} request UpdateCapacityCommitmentRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitmentCallback} callback Node-style callback called with the error, if any, and CapacityCommitment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.updateCapacityCommitment = function updateCapacityCommitment(request, callback) { + return this.rpcCall(updateCapacityCommitment, $root.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest, $root.google.cloud.bigquery.reservation.v1.CapacityCommitment, request, callback); + }, "name", { value: "UpdateCapacityCommitment" }); + + /** + * Calls UpdateCapacityCommitment. + * @function updateCapacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest} request UpdateCapacityCommitmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#splitCapacityCommitment}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef SplitCapacityCommitmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse} [response] SplitCapacityCommitmentResponse + */ + + /** + * Calls SplitCapacityCommitment. + * @function splitCapacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest} request SplitCapacityCommitmentRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitmentCallback} callback Node-style callback called with the error, if any, and SplitCapacityCommitmentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.splitCapacityCommitment = function splitCapacityCommitment(request, callback) { + return this.rpcCall(splitCapacityCommitment, $root.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest, $root.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse, request, callback); + }, "name", { value: "SplitCapacityCommitment" }); + + /** + * Calls SplitCapacityCommitment. + * @function splitCapacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest} request SplitCapacityCommitmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#mergeCapacityCommitments}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef MergeCapacityCommitmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.CapacityCommitment} [response] CapacityCommitment + */ + + /** + * Calls MergeCapacityCommitments. + * @function mergeCapacityCommitments + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest} request MergeCapacityCommitmentsRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitmentsCallback} callback Node-style callback called with the error, if any, and CapacityCommitment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.mergeCapacityCommitments = function mergeCapacityCommitments(request, callback) { + return this.rpcCall(mergeCapacityCommitments, $root.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest, $root.google.cloud.bigquery.reservation.v1.CapacityCommitment, request, callback); + }, "name", { value: "MergeCapacityCommitments" }); + + /** + * Calls MergeCapacityCommitments. + * @function mergeCapacityCommitments + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest} request MergeCapacityCommitmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#createAssignment}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef CreateAssignmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.Assignment} [response] Assignment + */ + + /** + * Calls CreateAssignment. + * @function createAssignment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest} request CreateAssignmentRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignmentCallback} callback Node-style callback called with the error, if any, and Assignment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.createAssignment = function createAssignment(request, callback) { + return this.rpcCall(createAssignment, $root.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest, $root.google.cloud.bigquery.reservation.v1.Assignment, request, callback); + }, "name", { value: "CreateAssignment" }); + + /** + * Calls CreateAssignment. + * @function createAssignment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest} request CreateAssignmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#listAssignments}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef ListAssignmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.ListAssignmentsResponse} [response] ListAssignmentsResponse + */ + + /** + * Calls ListAssignments. + * @function listAssignments + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IListAssignmentsRequest} request ListAssignmentsRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.ListAssignmentsCallback} callback Node-style callback called with the error, if any, and ListAssignmentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.listAssignments = function listAssignments(request, callback) { + return this.rpcCall(listAssignments, $root.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest, $root.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse, request, callback); + }, "name", { value: "ListAssignments" }); + + /** + * Calls ListAssignments. + * @function listAssignments + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IListAssignmentsRequest} request ListAssignmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#deleteAssignment}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef DeleteAssignmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAssignment. + * @function deleteAssignment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest} request DeleteAssignmentRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignmentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.deleteAssignment = function deleteAssignment(request, callback) { + return this.rpcCall(deleteAssignment, $root.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAssignment" }); + + /** + * Calls DeleteAssignment. + * @function deleteAssignment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest} request DeleteAssignmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#searchAssignments}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef SearchAssignmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse} [response] SearchAssignmentsResponse + */ + + /** + * Calls SearchAssignments. + * @function searchAssignments + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest} request SearchAssignmentsRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignmentsCallback} callback Node-style callback called with the error, if any, and SearchAssignmentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.searchAssignments = function searchAssignments(request, callback) { + return this.rpcCall(searchAssignments, $root.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest, $root.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse, request, callback); + }, "name", { value: "SearchAssignments" }); + + /** + * Calls SearchAssignments. + * @function searchAssignments + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest} request SearchAssignmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#moveAssignment}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef MoveAssignmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.Assignment} [response] Assignment + */ + + /** + * Calls MoveAssignment. + * @function moveAssignment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest} request MoveAssignmentRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignmentCallback} callback Node-style callback called with the error, if any, and Assignment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.moveAssignment = function moveAssignment(request, callback) { + return this.rpcCall(moveAssignment, $root.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest, $root.google.cloud.bigquery.reservation.v1.Assignment, request, callback); + }, "name", { value: "MoveAssignment" }); + + /** + * Calls MoveAssignment. + * @function moveAssignment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest} request MoveAssignmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#getBiReservation}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef GetBiReservationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.BiReservation} [response] BiReservation + */ + + /** + * Calls GetBiReservation. + * @function getBiReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IGetBiReservationRequest} request GetBiReservationRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.GetBiReservationCallback} callback Node-style callback called with the error, if any, and BiReservation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.getBiReservation = function getBiReservation(request, callback) { + return this.rpcCall(getBiReservation, $root.google.cloud.bigquery.reservation.v1.GetBiReservationRequest, $root.google.cloud.bigquery.reservation.v1.BiReservation, request, callback); + }, "name", { value: "GetBiReservation" }); + + /** + * Calls GetBiReservation. + * @function getBiReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IGetBiReservationRequest} request GetBiReservationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#updateBiReservation}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef UpdateBiReservationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.BiReservation} [response] BiReservation + */ + + /** + * Calls UpdateBiReservation. + * @function updateBiReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest} request UpdateBiReservationRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.UpdateBiReservationCallback} callback Node-style callback called with the error, if any, and BiReservation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.updateBiReservation = function updateBiReservation(request, callback) { + return this.rpcCall(updateBiReservation, $root.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest, $root.google.cloud.bigquery.reservation.v1.BiReservation, request, callback); + }, "name", { value: "UpdateBiReservation" }); + + /** + * Calls UpdateBiReservation. + * @function updateBiReservation + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest} request UpdateBiReservationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ReservationService; + })(); + + v1.Reservation = (function() { + + /** + * Properties of a Reservation. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IReservation + * @property {string|null} [name] Reservation name + * @property {number|Long|null} [slotCapacity] Reservation slotCapacity + * @property {boolean|null} [ignoreIdleSlots] Reservation ignoreIdleSlots + */ + + /** + * Constructs a new Reservation. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a Reservation. + * @implements IReservation + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IReservation=} [properties] Properties to set + */ + function Reservation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Reservation name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @instance + */ + Reservation.prototype.name = ""; + + /** + * Reservation slotCapacity. + * @member {number|Long} slotCapacity + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @instance + */ + Reservation.prototype.slotCapacity = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Reservation ignoreIdleSlots. + * @member {boolean} ignoreIdleSlots + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @instance + */ + Reservation.prototype.ignoreIdleSlots = false; + + /** + * Creates a new Reservation instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @static + * @param {google.cloud.bigquery.reservation.v1.IReservation=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.Reservation} Reservation instance + */ + Reservation.create = function create(properties) { + return new Reservation(properties); + }; + + /** + * Encodes the specified Reservation message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.Reservation.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @static + * @param {google.cloud.bigquery.reservation.v1.IReservation} message Reservation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Reservation.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.slotCapacity != null && Object.hasOwnProperty.call(message, "slotCapacity")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.slotCapacity); + if (message.ignoreIdleSlots != null && Object.hasOwnProperty.call(message, "ignoreIdleSlots")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.ignoreIdleSlots); + return writer; + }; + + /** + * Encodes the specified Reservation message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.Reservation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @static + * @param {google.cloud.bigquery.reservation.v1.IReservation} message Reservation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Reservation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Reservation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.Reservation} Reservation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Reservation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.Reservation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.slotCapacity = reader.int64(); + break; + case 4: + message.ignoreIdleSlots = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Reservation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.Reservation} Reservation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Reservation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Reservation message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Reservation.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.slotCapacity != null && message.hasOwnProperty("slotCapacity")) + if (!$util.isInteger(message.slotCapacity) && !(message.slotCapacity && $util.isInteger(message.slotCapacity.low) && $util.isInteger(message.slotCapacity.high))) + return "slotCapacity: integer|Long expected"; + if (message.ignoreIdleSlots != null && message.hasOwnProperty("ignoreIdleSlots")) + if (typeof message.ignoreIdleSlots !== "boolean") + return "ignoreIdleSlots: boolean expected"; + return null; + }; + + /** + * Creates a Reservation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.Reservation} Reservation + */ + Reservation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.Reservation) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.Reservation(); + if (object.name != null) + message.name = String(object.name); + if (object.slotCapacity != null) + if ($util.Long) + (message.slotCapacity = $util.Long.fromValue(object.slotCapacity)).unsigned = false; + else if (typeof object.slotCapacity === "string") + message.slotCapacity = parseInt(object.slotCapacity, 10); + else if (typeof object.slotCapacity === "number") + message.slotCapacity = object.slotCapacity; + else if (typeof object.slotCapacity === "object") + message.slotCapacity = new $util.LongBits(object.slotCapacity.low >>> 0, object.slotCapacity.high >>> 0).toNumber(); + if (object.ignoreIdleSlots != null) + message.ignoreIdleSlots = Boolean(object.ignoreIdleSlots); + return message; + }; + + /** + * Creates a plain object from a Reservation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @static + * @param {google.cloud.bigquery.reservation.v1.Reservation} message Reservation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Reservation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.slotCapacity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.slotCapacity = options.longs === String ? "0" : 0; + object.ignoreIdleSlots = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.slotCapacity != null && message.hasOwnProperty("slotCapacity")) + if (typeof message.slotCapacity === "number") + object.slotCapacity = options.longs === String ? String(message.slotCapacity) : message.slotCapacity; + else + object.slotCapacity = options.longs === String ? $util.Long.prototype.toString.call(message.slotCapacity) : options.longs === Number ? new $util.LongBits(message.slotCapacity.low >>> 0, message.slotCapacity.high >>> 0).toNumber() : message.slotCapacity; + if (message.ignoreIdleSlots != null && message.hasOwnProperty("ignoreIdleSlots")) + object.ignoreIdleSlots = message.ignoreIdleSlots; + return object; + }; + + /** + * Converts this Reservation to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @instance + * @returns {Object.} JSON object + */ + Reservation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Reservation; + })(); + + v1.CapacityCommitment = (function() { + + /** + * Properties of a CapacityCommitment. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface ICapacityCommitment + * @property {string|null} [name] CapacityCommitment name + * @property {number|Long|null} [slotCount] CapacityCommitment slotCount + * @property {google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan|null} [plan] CapacityCommitment plan + * @property {google.cloud.bigquery.reservation.v1.CapacityCommitment.State|null} [state] CapacityCommitment state + * @property {google.protobuf.ITimestamp|null} [commitmentEndTime] CapacityCommitment commitmentEndTime + * @property {google.rpc.IStatus|null} [failureStatus] CapacityCommitment failureStatus + * @property {google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan|null} [renewalPlan] CapacityCommitment renewalPlan + */ + + /** + * Constructs a new CapacityCommitment. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a CapacityCommitment. + * @implements ICapacityCommitment + * @constructor + * @param {google.cloud.bigquery.reservation.v1.ICapacityCommitment=} [properties] Properties to set + */ + function CapacityCommitment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CapacityCommitment name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @instance + */ + CapacityCommitment.prototype.name = ""; + + /** + * CapacityCommitment slotCount. + * @member {number|Long} slotCount + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @instance + */ + CapacityCommitment.prototype.slotCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * CapacityCommitment plan. + * @member {google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan} plan + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @instance + */ + CapacityCommitment.prototype.plan = 0; + + /** + * CapacityCommitment state. + * @member {google.cloud.bigquery.reservation.v1.CapacityCommitment.State} state + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @instance + */ + CapacityCommitment.prototype.state = 0; + + /** + * CapacityCommitment commitmentEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} commitmentEndTime + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @instance + */ + CapacityCommitment.prototype.commitmentEndTime = null; + + /** + * CapacityCommitment failureStatus. + * @member {google.rpc.IStatus|null|undefined} failureStatus + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @instance + */ + CapacityCommitment.prototype.failureStatus = null; + + /** + * CapacityCommitment renewalPlan. + * @member {google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan} renewalPlan + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @instance + */ + CapacityCommitment.prototype.renewalPlan = 0; + + /** + * Creates a new CapacityCommitment instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @static + * @param {google.cloud.bigquery.reservation.v1.ICapacityCommitment=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.CapacityCommitment} CapacityCommitment instance + */ + CapacityCommitment.create = function create(properties) { + return new CapacityCommitment(properties); + }; + + /** + * Encodes the specified CapacityCommitment message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CapacityCommitment.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @static + * @param {google.cloud.bigquery.reservation.v1.ICapacityCommitment} message CapacityCommitment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CapacityCommitment.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.slotCount != null && Object.hasOwnProperty.call(message, "slotCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.slotCount); + if (message.plan != null && Object.hasOwnProperty.call(message, "plan")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.plan); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.commitmentEndTime != null && Object.hasOwnProperty.call(message, "commitmentEndTime")) + $root.google.protobuf.Timestamp.encode(message.commitmentEndTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.failureStatus != null && Object.hasOwnProperty.call(message, "failureStatus")) + $root.google.rpc.Status.encode(message.failureStatus, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.renewalPlan != null && Object.hasOwnProperty.call(message, "renewalPlan")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.renewalPlan); + return writer; + }; + + /** + * Encodes the specified CapacityCommitment message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CapacityCommitment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @static + * @param {google.cloud.bigquery.reservation.v1.ICapacityCommitment} message CapacityCommitment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CapacityCommitment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CapacityCommitment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.CapacityCommitment} CapacityCommitment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CapacityCommitment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.CapacityCommitment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.slotCount = reader.int64(); + break; + case 3: + message.plan = reader.int32(); + break; + case 4: + message.state = reader.int32(); + break; + case 5: + message.commitmentEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.failureStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + case 8: + message.renewalPlan = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CapacityCommitment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.CapacityCommitment} CapacityCommitment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CapacityCommitment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CapacityCommitment message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CapacityCommitment.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.slotCount != null && message.hasOwnProperty("slotCount")) + if (!$util.isInteger(message.slotCount) && !(message.slotCount && $util.isInteger(message.slotCount.low) && $util.isInteger(message.slotCount.high))) + return "slotCount: integer|Long expected"; + if (message.plan != null && message.hasOwnProperty("plan")) + switch (message.plan) { + default: + return "plan: enum value expected"; + case 0: + case 3: + case 5: + case 2: + case 4: + break; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.commitmentEndTime != null && message.hasOwnProperty("commitmentEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.commitmentEndTime); + if (error) + return "commitmentEndTime." + error; + } + if (message.failureStatus != null && message.hasOwnProperty("failureStatus")) { + var error = $root.google.rpc.Status.verify(message.failureStatus); + if (error) + return "failureStatus." + error; + } + if (message.renewalPlan != null && message.hasOwnProperty("renewalPlan")) + switch (message.renewalPlan) { + default: + return "renewalPlan: enum value expected"; + case 0: + case 3: + case 5: + case 2: + case 4: + break; + } + return null; + }; + + /** + * Creates a CapacityCommitment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.CapacityCommitment} CapacityCommitment + */ + CapacityCommitment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.CapacityCommitment) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.CapacityCommitment(); + if (object.name != null) + message.name = String(object.name); + if (object.slotCount != null) + if ($util.Long) + (message.slotCount = $util.Long.fromValue(object.slotCount)).unsigned = false; + else if (typeof object.slotCount === "string") + message.slotCount = parseInt(object.slotCount, 10); + else if (typeof object.slotCount === "number") + message.slotCount = object.slotCount; + else if (typeof object.slotCount === "object") + message.slotCount = new $util.LongBits(object.slotCount.low >>> 0, object.slotCount.high >>> 0).toNumber(); + switch (object.plan) { + case "COMMITMENT_PLAN_UNSPECIFIED": + case 0: + message.plan = 0; + break; + case "FLEX": + case 3: + message.plan = 3; + break; + case "TRIAL": + case 5: + message.plan = 5; + break; + case "MONTHLY": + case 2: + message.plan = 2; + break; + case "ANNUAL": + case 4: + message.plan = 4; + break; + } + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + } + if (object.commitmentEndTime != null) { + if (typeof object.commitmentEndTime !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.CapacityCommitment.commitmentEndTime: object expected"); + message.commitmentEndTime = $root.google.protobuf.Timestamp.fromObject(object.commitmentEndTime); + } + if (object.failureStatus != null) { + if (typeof object.failureStatus !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.CapacityCommitment.failureStatus: object expected"); + message.failureStatus = $root.google.rpc.Status.fromObject(object.failureStatus); + } + switch (object.renewalPlan) { + case "COMMITMENT_PLAN_UNSPECIFIED": + case 0: + message.renewalPlan = 0; + break; + case "FLEX": + case 3: + message.renewalPlan = 3; + break; + case "TRIAL": + case 5: + message.renewalPlan = 5; + break; + case "MONTHLY": + case 2: + message.renewalPlan = 2; + break; + case "ANNUAL": + case 4: + message.renewalPlan = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a CapacityCommitment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @static + * @param {google.cloud.bigquery.reservation.v1.CapacityCommitment} message CapacityCommitment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CapacityCommitment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.slotCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.slotCount = options.longs === String ? "0" : 0; + object.plan = options.enums === String ? "COMMITMENT_PLAN_UNSPECIFIED" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.commitmentEndTime = null; + object.failureStatus = null; + object.renewalPlan = options.enums === String ? "COMMITMENT_PLAN_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.slotCount != null && message.hasOwnProperty("slotCount")) + if (typeof message.slotCount === "number") + object.slotCount = options.longs === String ? String(message.slotCount) : message.slotCount; + else + object.slotCount = options.longs === String ? $util.Long.prototype.toString.call(message.slotCount) : options.longs === Number ? new $util.LongBits(message.slotCount.low >>> 0, message.slotCount.high >>> 0).toNumber() : message.slotCount; + if (message.plan != null && message.hasOwnProperty("plan")) + object.plan = options.enums === String ? $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan[message.plan] : message.plan; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.State[message.state] : message.state; + if (message.commitmentEndTime != null && message.hasOwnProperty("commitmentEndTime")) + object.commitmentEndTime = $root.google.protobuf.Timestamp.toObject(message.commitmentEndTime, options); + if (message.failureStatus != null && message.hasOwnProperty("failureStatus")) + object.failureStatus = $root.google.rpc.Status.toObject(message.failureStatus, options); + if (message.renewalPlan != null && message.hasOwnProperty("renewalPlan")) + object.renewalPlan = options.enums === String ? $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan[message.renewalPlan] : message.renewalPlan; + return object; + }; + + /** + * Converts this CapacityCommitment to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @instance + * @returns {Object.} JSON object + */ + CapacityCommitment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * CommitmentPlan enum. + * @name google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan + * @enum {number} + * @property {number} COMMITMENT_PLAN_UNSPECIFIED=0 COMMITMENT_PLAN_UNSPECIFIED value + * @property {number} FLEX=3 FLEX value + * @property {number} TRIAL=5 TRIAL value + * @property {number} MONTHLY=2 MONTHLY value + * @property {number} ANNUAL=4 ANNUAL value + */ + CapacityCommitment.CommitmentPlan = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMMITMENT_PLAN_UNSPECIFIED"] = 0; + values[valuesById[3] = "FLEX"] = 3; + values[valuesById[5] = "TRIAL"] = 5; + values[valuesById[2] = "MONTHLY"] = 2; + values[valuesById[4] = "ANNUAL"] = 4; + return values; + })(); + + /** + * State enum. + * @name google.cloud.bigquery.reservation.v1.CapacityCommitment.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} FAILED=3 FAILED value + */ + CapacityCommitment.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "FAILED"] = 3; + return values; + })(); + + return CapacityCommitment; + })(); + + v1.CreateReservationRequest = (function() { + + /** + * Properties of a CreateReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface ICreateReservationRequest + * @property {string|null} [parent] CreateReservationRequest parent + * @property {string|null} [reservationId] CreateReservationRequest reservationId + * @property {google.cloud.bigquery.reservation.v1.IReservation|null} [reservation] CreateReservationRequest reservation + */ + + /** + * Constructs a new CreateReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a CreateReservationRequest. + * @implements ICreateReservationRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.ICreateReservationRequest=} [properties] Properties to set + */ + function CreateReservationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateReservationRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @instance + */ + CreateReservationRequest.prototype.parent = ""; + + /** + * CreateReservationRequest reservationId. + * @member {string} reservationId + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @instance + */ + CreateReservationRequest.prototype.reservationId = ""; + + /** + * CreateReservationRequest reservation. + * @member {google.cloud.bigquery.reservation.v1.IReservation|null|undefined} reservation + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @instance + */ + CreateReservationRequest.prototype.reservation = null; + + /** + * Creates a new CreateReservationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ICreateReservationRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.CreateReservationRequest} CreateReservationRequest instance + */ + CreateReservationRequest.create = function create(properties) { + return new CreateReservationRequest(properties); + }; + + /** + * Encodes the specified CreateReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateReservationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ICreateReservationRequest} message CreateReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateReservationRequest.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.reservationId != null && Object.hasOwnProperty.call(message, "reservationId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.reservationId); + if (message.reservation != null && Object.hasOwnProperty.call(message, "reservation")) + $root.google.cloud.bigquery.reservation.v1.Reservation.encode(message.reservation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateReservationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ICreateReservationRequest} message CreateReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateReservationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateReservationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.CreateReservationRequest} CreateReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateReservationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.CreateReservationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.reservationId = reader.string(); + break; + case 3: + message.reservation = $root.google.cloud.bigquery.reservation.v1.Reservation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateReservationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.CreateReservationRequest} CreateReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateReservationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateReservationRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateReservationRequest.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.reservationId != null && message.hasOwnProperty("reservationId")) + if (!$util.isString(message.reservationId)) + return "reservationId: string expected"; + if (message.reservation != null && message.hasOwnProperty("reservation")) { + var error = $root.google.cloud.bigquery.reservation.v1.Reservation.verify(message.reservation); + if (error) + return "reservation." + error; + } + return null; + }; + + /** + * Creates a CreateReservationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.CreateReservationRequest} CreateReservationRequest + */ + CreateReservationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.CreateReservationRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.CreateReservationRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.reservationId != null) + message.reservationId = String(object.reservationId); + if (object.reservation != null) { + if (typeof object.reservation !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.CreateReservationRequest.reservation: object expected"); + message.reservation = $root.google.cloud.bigquery.reservation.v1.Reservation.fromObject(object.reservation); + } + return message; + }; + + /** + * Creates a plain object from a CreateReservationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.CreateReservationRequest} message CreateReservationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateReservationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.reservationId = ""; + object.reservation = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.reservationId != null && message.hasOwnProperty("reservationId")) + object.reservationId = message.reservationId; + if (message.reservation != null && message.hasOwnProperty("reservation")) + object.reservation = $root.google.cloud.bigquery.reservation.v1.Reservation.toObject(message.reservation, options); + return object; + }; + + /** + * Converts this CreateReservationRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @instance + * @returns {Object.} JSON object + */ + CreateReservationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateReservationRequest; + })(); + + v1.ListReservationsRequest = (function() { + + /** + * Properties of a ListReservationsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IListReservationsRequest + * @property {string|null} [parent] ListReservationsRequest parent + * @property {number|null} [pageSize] ListReservationsRequest pageSize + * @property {string|null} [pageToken] ListReservationsRequest pageToken + */ + + /** + * Constructs a new ListReservationsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a ListReservationsRequest. + * @implements IListReservationsRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IListReservationsRequest=} [properties] Properties to set + */ + function ListReservationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListReservationsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @instance + */ + ListReservationsRequest.prototype.parent = ""; + + /** + * ListReservationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @instance + */ + ListReservationsRequest.prototype.pageSize = 0; + + /** + * ListReservationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @instance + */ + ListReservationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListReservationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IListReservationsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.ListReservationsRequest} ListReservationsRequest instance + */ + ListReservationsRequest.create = function create(properties) { + return new ListReservationsRequest(properties); + }; + + /** + * Encodes the specified ListReservationsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListReservationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IListReservationsRequest} message ListReservationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReservationsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListReservationsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListReservationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IListReservationsRequest} message ListReservationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReservationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReservationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.ListReservationsRequest} ListReservationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReservationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.ListReservationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListReservationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.ListReservationsRequest} ListReservationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReservationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListReservationsRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReservationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListReservationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.ListReservationsRequest} ListReservationsRequest + */ + ListReservationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.ListReservationsRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.ListReservationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListReservationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ListReservationsRequest} message ListReservationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReservationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListReservationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListReservationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListReservationsRequest; + })(); + + v1.ListReservationsResponse = (function() { + + /** + * Properties of a ListReservationsResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IListReservationsResponse + * @property {Array.|null} [reservations] ListReservationsResponse reservations + * @property {string|null} [nextPageToken] ListReservationsResponse nextPageToken + */ + + /** + * Constructs a new ListReservationsResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a ListReservationsResponse. + * @implements IListReservationsResponse + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IListReservationsResponse=} [properties] Properties to set + */ + function ListReservationsResponse(properties) { + this.reservations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListReservationsResponse reservations. + * @member {Array.} reservations + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @instance + */ + ListReservationsResponse.prototype.reservations = $util.emptyArray; + + /** + * ListReservationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @instance + */ + ListReservationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListReservationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.IListReservationsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.ListReservationsResponse} ListReservationsResponse instance + */ + ListReservationsResponse.create = function create(properties) { + return new ListReservationsResponse(properties); + }; + + /** + * Encodes the specified ListReservationsResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListReservationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.IListReservationsResponse} message ListReservationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReservationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reservations != null && message.reservations.length) + for (var i = 0; i < message.reservations.length; ++i) + $root.google.cloud.bigquery.reservation.v1.Reservation.encode(message.reservations[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 ListReservationsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListReservationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.IListReservationsResponse} message ListReservationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReservationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReservationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.ListReservationsResponse} ListReservationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReservationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.ListReservationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.reservations && message.reservations.length)) + message.reservations = []; + message.reservations.push($root.google.cloud.bigquery.reservation.v1.Reservation.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListReservationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.ListReservationsResponse} ListReservationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReservationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListReservationsResponse message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReservationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reservations != null && message.hasOwnProperty("reservations")) { + if (!Array.isArray(message.reservations)) + return "reservations: array expected"; + for (var i = 0; i < message.reservations.length; ++i) { + var error = $root.google.cloud.bigquery.reservation.v1.Reservation.verify(message.reservations[i]); + if (error) + return "reservations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListReservationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.ListReservationsResponse} ListReservationsResponse + */ + ListReservationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.ListReservationsResponse) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.ListReservationsResponse(); + if (object.reservations) { + if (!Array.isArray(object.reservations)) + throw TypeError(".google.cloud.bigquery.reservation.v1.ListReservationsResponse.reservations: array expected"); + message.reservations = []; + for (var i = 0; i < object.reservations.length; ++i) { + if (typeof object.reservations[i] !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.ListReservationsResponse.reservations: object expected"); + message.reservations[i] = $root.google.cloud.bigquery.reservation.v1.Reservation.fromObject(object.reservations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListReservationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ListReservationsResponse} message ListReservationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReservationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.reservations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.reservations && message.reservations.length) { + object.reservations = []; + for (var j = 0; j < message.reservations.length; ++j) + object.reservations[j] = $root.google.cloud.bigquery.reservation.v1.Reservation.toObject(message.reservations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListReservationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListReservationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListReservationsResponse; + })(); + + v1.GetReservationRequest = (function() { + + /** + * Properties of a GetReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IGetReservationRequest + * @property {string|null} [name] GetReservationRequest name + */ + + /** + * Constructs a new GetReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a GetReservationRequest. + * @implements IGetReservationRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IGetReservationRequest=} [properties] Properties to set + */ + function GetReservationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetReservationRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.GetReservationRequest + * @instance + */ + GetReservationRequest.prototype.name = ""; + + /** + * Creates a new GetReservationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.GetReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IGetReservationRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.GetReservationRequest} GetReservationRequest instance + */ + GetReservationRequest.create = function create(properties) { + return new GetReservationRequest(properties); + }; + + /** + * Encodes the specified GetReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetReservationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.GetReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IGetReservationRequest} message GetReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetReservationRequest.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 GetReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetReservationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.GetReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IGetReservationRequest} message GetReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetReservationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetReservationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.GetReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.GetReservationRequest} GetReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetReservationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.GetReservationRequest(); + 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 GetReservationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.GetReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.GetReservationRequest} GetReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetReservationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetReservationRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.GetReservationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetReservationRequest.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 GetReservationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.GetReservationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.GetReservationRequest} GetReservationRequest + */ + GetReservationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.GetReservationRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.GetReservationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetReservationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.GetReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.GetReservationRequest} message GetReservationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetReservationRequest.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 GetReservationRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.GetReservationRequest + * @instance + * @returns {Object.} JSON object + */ + GetReservationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetReservationRequest; + })(); + + v1.DeleteReservationRequest = (function() { + + /** + * Properties of a DeleteReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IDeleteReservationRequest + * @property {string|null} [name] DeleteReservationRequest name + */ + + /** + * Constructs a new DeleteReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a DeleteReservationRequest. + * @implements IDeleteReservationRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IDeleteReservationRequest=} [properties] Properties to set + */ + function DeleteReservationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteReservationRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.DeleteReservationRequest + * @instance + */ + DeleteReservationRequest.prototype.name = ""; + + /** + * Creates a new DeleteReservationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.DeleteReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IDeleteReservationRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.DeleteReservationRequest} DeleteReservationRequest instance + */ + DeleteReservationRequest.create = function create(properties) { + return new DeleteReservationRequest(properties); + }; + + /** + * Encodes the specified DeleteReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteReservationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.DeleteReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IDeleteReservationRequest} message DeleteReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteReservationRequest.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 DeleteReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteReservationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.DeleteReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IDeleteReservationRequest} message DeleteReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteReservationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteReservationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.DeleteReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.DeleteReservationRequest} DeleteReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteReservationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.DeleteReservationRequest(); + 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 DeleteReservationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.DeleteReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.DeleteReservationRequest} DeleteReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteReservationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteReservationRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.DeleteReservationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteReservationRequest.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 DeleteReservationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.DeleteReservationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.DeleteReservationRequest} DeleteReservationRequest + */ + DeleteReservationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.DeleteReservationRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.DeleteReservationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteReservationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.DeleteReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.DeleteReservationRequest} message DeleteReservationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteReservationRequest.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 DeleteReservationRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.DeleteReservationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteReservationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteReservationRequest; + })(); + + v1.UpdateReservationRequest = (function() { + + /** + * Properties of an UpdateReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IUpdateReservationRequest + * @property {google.cloud.bigquery.reservation.v1.IReservation|null} [reservation] UpdateReservationRequest reservation + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateReservationRequest updateMask + */ + + /** + * Constructs a new UpdateReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents an UpdateReservationRequest. + * @implements IUpdateReservationRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IUpdateReservationRequest=} [properties] Properties to set + */ + function UpdateReservationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateReservationRequest reservation. + * @member {google.cloud.bigquery.reservation.v1.IReservation|null|undefined} reservation + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @instance + */ + UpdateReservationRequest.prototype.reservation = null; + + /** + * UpdateReservationRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @instance + */ + UpdateReservationRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateReservationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateReservationRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.UpdateReservationRequest} UpdateReservationRequest instance + */ + UpdateReservationRequest.create = function create(properties) { + return new UpdateReservationRequest(properties); + }; + + /** + * Encodes the specified UpdateReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateReservationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateReservationRequest} message UpdateReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateReservationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reservation != null && Object.hasOwnProperty.call(message, "reservation")) + $root.google.cloud.bigquery.reservation.v1.Reservation.encode(message.reservation, 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 UpdateReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateReservationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateReservationRequest} message UpdateReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateReservationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateReservationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.UpdateReservationRequest} UpdateReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateReservationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.UpdateReservationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.reservation = $root.google.cloud.bigquery.reservation.v1.Reservation.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 UpdateReservationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.UpdateReservationRequest} UpdateReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateReservationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateReservationRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateReservationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reservation != null && message.hasOwnProperty("reservation")) { + var error = $root.google.cloud.bigquery.reservation.v1.Reservation.verify(message.reservation); + if (error) + return "reservation." + 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 UpdateReservationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.UpdateReservationRequest} UpdateReservationRequest + */ + UpdateReservationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.UpdateReservationRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.UpdateReservationRequest(); + if (object.reservation != null) { + if (typeof object.reservation !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.UpdateReservationRequest.reservation: object expected"); + message.reservation = $root.google.cloud.bigquery.reservation.v1.Reservation.fromObject(object.reservation); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.UpdateReservationRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateReservationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.UpdateReservationRequest} message UpdateReservationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateReservationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.reservation = null; + object.updateMask = null; + } + if (message.reservation != null && message.hasOwnProperty("reservation")) + object.reservation = $root.google.cloud.bigquery.reservation.v1.Reservation.toObject(message.reservation, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateReservationRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateReservationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateReservationRequest; + })(); + + v1.CreateCapacityCommitmentRequest = (function() { + + /** + * Properties of a CreateCapacityCommitmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface ICreateCapacityCommitmentRequest + * @property {string|null} [parent] CreateCapacityCommitmentRequest parent + * @property {google.cloud.bigquery.reservation.v1.ICapacityCommitment|null} [capacityCommitment] CreateCapacityCommitmentRequest capacityCommitment + * @property {boolean|null} [enforceSingleAdminProjectPerOrg] CreateCapacityCommitmentRequest enforceSingleAdminProjectPerOrg + */ + + /** + * Constructs a new CreateCapacityCommitmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a CreateCapacityCommitmentRequest. + * @implements ICreateCapacityCommitmentRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest=} [properties] Properties to set + */ + function CreateCapacityCommitmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCapacityCommitmentRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @instance + */ + CreateCapacityCommitmentRequest.prototype.parent = ""; + + /** + * CreateCapacityCommitmentRequest capacityCommitment. + * @member {google.cloud.bigquery.reservation.v1.ICapacityCommitment|null|undefined} capacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @instance + */ + CreateCapacityCommitmentRequest.prototype.capacityCommitment = null; + + /** + * CreateCapacityCommitmentRequest enforceSingleAdminProjectPerOrg. + * @member {boolean} enforceSingleAdminProjectPerOrg + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @instance + */ + CreateCapacityCommitmentRequest.prototype.enforceSingleAdminProjectPerOrg = false; + + /** + * Creates a new CreateCapacityCommitmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest} CreateCapacityCommitmentRequest instance + */ + CreateCapacityCommitmentRequest.create = function create(properties) { + return new CreateCapacityCommitmentRequest(properties); + }; + + /** + * Encodes the specified CreateCapacityCommitmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest} message CreateCapacityCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCapacityCommitmentRequest.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.capacityCommitment != null && Object.hasOwnProperty.call(message, "capacityCommitment")) + $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.encode(message.capacityCommitment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.enforceSingleAdminProjectPerOrg != null && Object.hasOwnProperty.call(message, "enforceSingleAdminProjectPerOrg")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enforceSingleAdminProjectPerOrg); + return writer; + }; + + /** + * Encodes the specified CreateCapacityCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest} message CreateCapacityCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCapacityCommitmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCapacityCommitmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest} CreateCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCapacityCommitmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.capacityCommitment = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.decode(reader, reader.uint32()); + break; + case 4: + message.enforceSingleAdminProjectPerOrg = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCapacityCommitmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest} CreateCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCapacityCommitmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCapacityCommitmentRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCapacityCommitmentRequest.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.capacityCommitment != null && message.hasOwnProperty("capacityCommitment")) { + var error = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.verify(message.capacityCommitment); + if (error) + return "capacityCommitment." + error; + } + if (message.enforceSingleAdminProjectPerOrg != null && message.hasOwnProperty("enforceSingleAdminProjectPerOrg")) + if (typeof message.enforceSingleAdminProjectPerOrg !== "boolean") + return "enforceSingleAdminProjectPerOrg: boolean expected"; + return null; + }; + + /** + * Creates a CreateCapacityCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest} CreateCapacityCommitmentRequest + */ + CreateCapacityCommitmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.capacityCommitment != null) { + if (typeof object.capacityCommitment !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest.capacityCommitment: object expected"); + message.capacityCommitment = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.fromObject(object.capacityCommitment); + } + if (object.enforceSingleAdminProjectPerOrg != null) + message.enforceSingleAdminProjectPerOrg = Boolean(object.enforceSingleAdminProjectPerOrg); + return message; + }; + + /** + * Creates a plain object from a CreateCapacityCommitmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest} message CreateCapacityCommitmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCapacityCommitmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.capacityCommitment = null; + object.enforceSingleAdminProjectPerOrg = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.capacityCommitment != null && message.hasOwnProperty("capacityCommitment")) + object.capacityCommitment = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.toObject(message.capacityCommitment, options); + if (message.enforceSingleAdminProjectPerOrg != null && message.hasOwnProperty("enforceSingleAdminProjectPerOrg")) + object.enforceSingleAdminProjectPerOrg = message.enforceSingleAdminProjectPerOrg; + return object; + }; + + /** + * Converts this CreateCapacityCommitmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCapacityCommitmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateCapacityCommitmentRequest; + })(); + + v1.ListCapacityCommitmentsRequest = (function() { + + /** + * Properties of a ListCapacityCommitmentsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IListCapacityCommitmentsRequest + * @property {string|null} [parent] ListCapacityCommitmentsRequest parent + * @property {number|null} [pageSize] ListCapacityCommitmentsRequest pageSize + * @property {string|null} [pageToken] ListCapacityCommitmentsRequest pageToken + */ + + /** + * Constructs a new ListCapacityCommitmentsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a ListCapacityCommitmentsRequest. + * @implements IListCapacityCommitmentsRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest=} [properties] Properties to set + */ + function ListCapacityCommitmentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCapacityCommitmentsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @instance + */ + ListCapacityCommitmentsRequest.prototype.parent = ""; + + /** + * ListCapacityCommitmentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @instance + */ + ListCapacityCommitmentsRequest.prototype.pageSize = 0; + + /** + * ListCapacityCommitmentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @instance + */ + ListCapacityCommitmentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListCapacityCommitmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest} ListCapacityCommitmentsRequest instance + */ + ListCapacityCommitmentsRequest.create = function create(properties) { + return new ListCapacityCommitmentsRequest(properties); + }; + + /** + * Encodes the specified ListCapacityCommitmentsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest} message ListCapacityCommitmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCapacityCommitmentsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListCapacityCommitmentsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest} message ListCapacityCommitmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCapacityCommitmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCapacityCommitmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest} ListCapacityCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCapacityCommitmentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCapacityCommitmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest} ListCapacityCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCapacityCommitmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCapacityCommitmentsRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCapacityCommitmentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListCapacityCommitmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest} ListCapacityCommitmentsRequest + */ + ListCapacityCommitmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListCapacityCommitmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest} message ListCapacityCommitmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCapacityCommitmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListCapacityCommitmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListCapacityCommitmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListCapacityCommitmentsRequest; + })(); + + v1.ListCapacityCommitmentsResponse = (function() { + + /** + * Properties of a ListCapacityCommitmentsResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IListCapacityCommitmentsResponse + * @property {Array.|null} [capacityCommitments] ListCapacityCommitmentsResponse capacityCommitments + * @property {string|null} [nextPageToken] ListCapacityCommitmentsResponse nextPageToken + */ + + /** + * Constructs a new ListCapacityCommitmentsResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a ListCapacityCommitmentsResponse. + * @implements IListCapacityCommitmentsResponse + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse=} [properties] Properties to set + */ + function ListCapacityCommitmentsResponse(properties) { + this.capacityCommitments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCapacityCommitmentsResponse capacityCommitments. + * @member {Array.} capacityCommitments + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @instance + */ + ListCapacityCommitmentsResponse.prototype.capacityCommitments = $util.emptyArray; + + /** + * ListCapacityCommitmentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @instance + */ + ListCapacityCommitmentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListCapacityCommitmentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse} ListCapacityCommitmentsResponse instance + */ + ListCapacityCommitmentsResponse.create = function create(properties) { + return new ListCapacityCommitmentsResponse(properties); + }; + + /** + * Encodes the specified ListCapacityCommitmentsResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse} message ListCapacityCommitmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCapacityCommitmentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.capacityCommitments != null && message.capacityCommitments.length) + for (var i = 0; i < message.capacityCommitments.length; ++i) + $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.encode(message.capacityCommitments[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 ListCapacityCommitmentsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse} message ListCapacityCommitmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCapacityCommitmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCapacityCommitmentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse} ListCapacityCommitmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCapacityCommitmentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.capacityCommitments && message.capacityCommitments.length)) + message.capacityCommitments = []; + message.capacityCommitments.push($root.google.cloud.bigquery.reservation.v1.CapacityCommitment.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCapacityCommitmentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse} ListCapacityCommitmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCapacityCommitmentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCapacityCommitmentsResponse message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCapacityCommitmentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.capacityCommitments != null && message.hasOwnProperty("capacityCommitments")) { + if (!Array.isArray(message.capacityCommitments)) + return "capacityCommitments: array expected"; + for (var i = 0; i < message.capacityCommitments.length; ++i) { + var error = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.verify(message.capacityCommitments[i]); + if (error) + return "capacityCommitments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListCapacityCommitmentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse} ListCapacityCommitmentsResponse + */ + ListCapacityCommitmentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse(); + if (object.capacityCommitments) { + if (!Array.isArray(object.capacityCommitments)) + throw TypeError(".google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse.capacityCommitments: array expected"); + message.capacityCommitments = []; + for (var i = 0; i < object.capacityCommitments.length; ++i) { + if (typeof object.capacityCommitments[i] !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse.capacityCommitments: object expected"); + message.capacityCommitments[i] = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.fromObject(object.capacityCommitments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListCapacityCommitmentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse} message ListCapacityCommitmentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCapacityCommitmentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.capacityCommitments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.capacityCommitments && message.capacityCommitments.length) { + object.capacityCommitments = []; + for (var j = 0; j < message.capacityCommitments.length; ++j) + object.capacityCommitments[j] = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.toObject(message.capacityCommitments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListCapacityCommitmentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListCapacityCommitmentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListCapacityCommitmentsResponse; + })(); + + v1.GetCapacityCommitmentRequest = (function() { + + /** + * Properties of a GetCapacityCommitmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IGetCapacityCommitmentRequest + * @property {string|null} [name] GetCapacityCommitmentRequest name + */ + + /** + * Constructs a new GetCapacityCommitmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a GetCapacityCommitmentRequest. + * @implements IGetCapacityCommitmentRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest=} [properties] Properties to set + */ + function GetCapacityCommitmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCapacityCommitmentRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + * @instance + */ + GetCapacityCommitmentRequest.prototype.name = ""; + + /** + * Creates a new GetCapacityCommitmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest} GetCapacityCommitmentRequest instance + */ + GetCapacityCommitmentRequest.create = function create(properties) { + return new GetCapacityCommitmentRequest(properties); + }; + + /** + * Encodes the specified GetCapacityCommitmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest} message GetCapacityCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCapacityCommitmentRequest.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 GetCapacityCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest} message GetCapacityCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCapacityCommitmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCapacityCommitmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest} GetCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCapacityCommitmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest(); + 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 GetCapacityCommitmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest} GetCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCapacityCommitmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCapacityCommitmentRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCapacityCommitmentRequest.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 GetCapacityCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest} GetCapacityCommitmentRequest + */ + GetCapacityCommitmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCapacityCommitmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest} message GetCapacityCommitmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCapacityCommitmentRequest.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 GetCapacityCommitmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + * @instance + * @returns {Object.} JSON object + */ + GetCapacityCommitmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetCapacityCommitmentRequest; + })(); + + v1.DeleteCapacityCommitmentRequest = (function() { + + /** + * Properties of a DeleteCapacityCommitmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IDeleteCapacityCommitmentRequest + * @property {string|null} [name] DeleteCapacityCommitmentRequest name + */ + + /** + * Constructs a new DeleteCapacityCommitmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a DeleteCapacityCommitmentRequest. + * @implements IDeleteCapacityCommitmentRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest=} [properties] Properties to set + */ + function DeleteCapacityCommitmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteCapacityCommitmentRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @instance + */ + DeleteCapacityCommitmentRequest.prototype.name = ""; + + /** + * Creates a new DeleteCapacityCommitmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest} DeleteCapacityCommitmentRequest instance + */ + DeleteCapacityCommitmentRequest.create = function create(properties) { + return new DeleteCapacityCommitmentRequest(properties); + }; + + /** + * Encodes the specified DeleteCapacityCommitmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest} message DeleteCapacityCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCapacityCommitmentRequest.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 DeleteCapacityCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest} message DeleteCapacityCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCapacityCommitmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCapacityCommitmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest} DeleteCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCapacityCommitmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest(); + 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 DeleteCapacityCommitmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest} DeleteCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCapacityCommitmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCapacityCommitmentRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCapacityCommitmentRequest.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 DeleteCapacityCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest} DeleteCapacityCommitmentRequest + */ + DeleteCapacityCommitmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteCapacityCommitmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest} message DeleteCapacityCommitmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCapacityCommitmentRequest.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 DeleteCapacityCommitmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteCapacityCommitmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteCapacityCommitmentRequest; + })(); + + v1.UpdateCapacityCommitmentRequest = (function() { + + /** + * Properties of an UpdateCapacityCommitmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IUpdateCapacityCommitmentRequest + * @property {google.cloud.bigquery.reservation.v1.ICapacityCommitment|null} [capacityCommitment] UpdateCapacityCommitmentRequest capacityCommitment + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCapacityCommitmentRequest updateMask + */ + + /** + * Constructs a new UpdateCapacityCommitmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents an UpdateCapacityCommitmentRequest. + * @implements IUpdateCapacityCommitmentRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest=} [properties] Properties to set + */ + function UpdateCapacityCommitmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateCapacityCommitmentRequest capacityCommitment. + * @member {google.cloud.bigquery.reservation.v1.ICapacityCommitment|null|undefined} capacityCommitment + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @instance + */ + UpdateCapacityCommitmentRequest.prototype.capacityCommitment = null; + + /** + * UpdateCapacityCommitmentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @instance + */ + UpdateCapacityCommitmentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateCapacityCommitmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest} UpdateCapacityCommitmentRequest instance + */ + UpdateCapacityCommitmentRequest.create = function create(properties) { + return new UpdateCapacityCommitmentRequest(properties); + }; + + /** + * Encodes the specified UpdateCapacityCommitmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest} message UpdateCapacityCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCapacityCommitmentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.capacityCommitment != null && Object.hasOwnProperty.call(message, "capacityCommitment")) + $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.encode(message.capacityCommitment, 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 UpdateCapacityCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest} message UpdateCapacityCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCapacityCommitmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCapacityCommitmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest} UpdateCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCapacityCommitmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.capacityCommitment = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.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 UpdateCapacityCommitmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest} UpdateCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCapacityCommitmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCapacityCommitmentRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCapacityCommitmentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.capacityCommitment != null && message.hasOwnProperty("capacityCommitment")) { + var error = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.verify(message.capacityCommitment); + if (error) + return "capacityCommitment." + 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 UpdateCapacityCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest} UpdateCapacityCommitmentRequest + */ + UpdateCapacityCommitmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest(); + if (object.capacityCommitment != null) { + if (typeof object.capacityCommitment !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest.capacityCommitment: object expected"); + message.capacityCommitment = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.fromObject(object.capacityCommitment); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCapacityCommitmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest} message UpdateCapacityCommitmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCapacityCommitmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.capacityCommitment = null; + object.updateMask = null; + } + if (message.capacityCommitment != null && message.hasOwnProperty("capacityCommitment")) + object.capacityCommitment = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.toObject(message.capacityCommitment, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateCapacityCommitmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCapacityCommitmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateCapacityCommitmentRequest; + })(); + + v1.SplitCapacityCommitmentRequest = (function() { + + /** + * Properties of a SplitCapacityCommitmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface ISplitCapacityCommitmentRequest + * @property {string|null} [name] SplitCapacityCommitmentRequest name + * @property {number|Long|null} [slotCount] SplitCapacityCommitmentRequest slotCount + */ + + /** + * Constructs a new SplitCapacityCommitmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a SplitCapacityCommitmentRequest. + * @implements ISplitCapacityCommitmentRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest=} [properties] Properties to set + */ + function SplitCapacityCommitmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SplitCapacityCommitmentRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @instance + */ + SplitCapacityCommitmentRequest.prototype.name = ""; + + /** + * SplitCapacityCommitmentRequest slotCount. + * @member {number|Long} slotCount + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @instance + */ + SplitCapacityCommitmentRequest.prototype.slotCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new SplitCapacityCommitmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest} SplitCapacityCommitmentRequest instance + */ + SplitCapacityCommitmentRequest.create = function create(properties) { + return new SplitCapacityCommitmentRequest(properties); + }; + + /** + * Encodes the specified SplitCapacityCommitmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest} message SplitCapacityCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitCapacityCommitmentRequest.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.slotCount != null && Object.hasOwnProperty.call(message, "slotCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.slotCount); + return writer; + }; + + /** + * Encodes the specified SplitCapacityCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest} message SplitCapacityCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitCapacityCommitmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SplitCapacityCommitmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest} SplitCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitCapacityCommitmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.slotCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SplitCapacityCommitmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest} SplitCapacityCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitCapacityCommitmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SplitCapacityCommitmentRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SplitCapacityCommitmentRequest.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.slotCount != null && message.hasOwnProperty("slotCount")) + if (!$util.isInteger(message.slotCount) && !(message.slotCount && $util.isInteger(message.slotCount.low) && $util.isInteger(message.slotCount.high))) + return "slotCount: integer|Long expected"; + return null; + }; + + /** + * Creates a SplitCapacityCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest} SplitCapacityCommitmentRequest + */ + SplitCapacityCommitmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.slotCount != null) + if ($util.Long) + (message.slotCount = $util.Long.fromValue(object.slotCount)).unsigned = false; + else if (typeof object.slotCount === "string") + message.slotCount = parseInt(object.slotCount, 10); + else if (typeof object.slotCount === "number") + message.slotCount = object.slotCount; + else if (typeof object.slotCount === "object") + message.slotCount = new $util.LongBits(object.slotCount.low >>> 0, object.slotCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a SplitCapacityCommitmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest} message SplitCapacityCommitmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SplitCapacityCommitmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.slotCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.slotCount = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.slotCount != null && message.hasOwnProperty("slotCount")) + if (typeof message.slotCount === "number") + object.slotCount = options.longs === String ? String(message.slotCount) : message.slotCount; + else + object.slotCount = options.longs === String ? $util.Long.prototype.toString.call(message.slotCount) : options.longs === Number ? new $util.LongBits(message.slotCount.low >>> 0, message.slotCount.high >>> 0).toNumber() : message.slotCount; + return object; + }; + + /** + * Converts this SplitCapacityCommitmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @instance + * @returns {Object.} JSON object + */ + SplitCapacityCommitmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SplitCapacityCommitmentRequest; + })(); + + v1.SplitCapacityCommitmentResponse = (function() { + + /** + * Properties of a SplitCapacityCommitmentResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface ISplitCapacityCommitmentResponse + * @property {google.cloud.bigquery.reservation.v1.ICapacityCommitment|null} [first] SplitCapacityCommitmentResponse first + * @property {google.cloud.bigquery.reservation.v1.ICapacityCommitment|null} [second] SplitCapacityCommitmentResponse second + */ + + /** + * Constructs a new SplitCapacityCommitmentResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a SplitCapacityCommitmentResponse. + * @implements ISplitCapacityCommitmentResponse + * @constructor + * @param {google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse=} [properties] Properties to set + */ + function SplitCapacityCommitmentResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SplitCapacityCommitmentResponse first. + * @member {google.cloud.bigquery.reservation.v1.ICapacityCommitment|null|undefined} first + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @instance + */ + SplitCapacityCommitmentResponse.prototype.first = null; + + /** + * SplitCapacityCommitmentResponse second. + * @member {google.cloud.bigquery.reservation.v1.ICapacityCommitment|null|undefined} second + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @instance + */ + SplitCapacityCommitmentResponse.prototype.second = null; + + /** + * Creates a new SplitCapacityCommitmentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse} SplitCapacityCommitmentResponse instance + */ + SplitCapacityCommitmentResponse.create = function create(properties) { + return new SplitCapacityCommitmentResponse(properties); + }; + + /** + * Encodes the specified SplitCapacityCommitmentResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse} message SplitCapacityCommitmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitCapacityCommitmentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.first != null && Object.hasOwnProperty.call(message, "first")) + $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.encode(message.first, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.second != null && Object.hasOwnProperty.call(message, "second")) + $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.encode(message.second, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SplitCapacityCommitmentResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse} message SplitCapacityCommitmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitCapacityCommitmentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SplitCapacityCommitmentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse} SplitCapacityCommitmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitCapacityCommitmentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.first = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.decode(reader, reader.uint32()); + break; + case 2: + message.second = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SplitCapacityCommitmentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse} SplitCapacityCommitmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitCapacityCommitmentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SplitCapacityCommitmentResponse message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SplitCapacityCommitmentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.first != null && message.hasOwnProperty("first")) { + var error = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.verify(message.first); + if (error) + return "first." + error; + } + if (message.second != null && message.hasOwnProperty("second")) { + var error = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.verify(message.second); + if (error) + return "second." + error; + } + return null; + }; + + /** + * Creates a SplitCapacityCommitmentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse} SplitCapacityCommitmentResponse + */ + SplitCapacityCommitmentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse(); + if (object.first != null) { + if (typeof object.first !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse.first: object expected"); + message.first = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.fromObject(object.first); + } + if (object.second != null) { + if (typeof object.second !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse.second: object expected"); + message.second = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.fromObject(object.second); + } + return message; + }; + + /** + * Creates a plain object from a SplitCapacityCommitmentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse} message SplitCapacityCommitmentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SplitCapacityCommitmentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.first = null; + object.second = null; + } + if (message.first != null && message.hasOwnProperty("first")) + object.first = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.toObject(message.first, options); + if (message.second != null && message.hasOwnProperty("second")) + object.second = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.toObject(message.second, options); + return object; + }; + + /** + * Converts this SplitCapacityCommitmentResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @instance + * @returns {Object.} JSON object + */ + SplitCapacityCommitmentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SplitCapacityCommitmentResponse; + })(); + + v1.MergeCapacityCommitmentsRequest = (function() { + + /** + * Properties of a MergeCapacityCommitmentsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IMergeCapacityCommitmentsRequest + * @property {string|null} [parent] MergeCapacityCommitmentsRequest parent + * @property {Array.|null} [capacityCommitmentIds] MergeCapacityCommitmentsRequest capacityCommitmentIds + */ + + /** + * Constructs a new MergeCapacityCommitmentsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a MergeCapacityCommitmentsRequest. + * @implements IMergeCapacityCommitmentsRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest=} [properties] Properties to set + */ + function MergeCapacityCommitmentsRequest(properties) { + this.capacityCommitmentIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MergeCapacityCommitmentsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @instance + */ + MergeCapacityCommitmentsRequest.prototype.parent = ""; + + /** + * MergeCapacityCommitmentsRequest capacityCommitmentIds. + * @member {Array.} capacityCommitmentIds + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @instance + */ + MergeCapacityCommitmentsRequest.prototype.capacityCommitmentIds = $util.emptyArray; + + /** + * Creates a new MergeCapacityCommitmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest} MergeCapacityCommitmentsRequest instance + */ + MergeCapacityCommitmentsRequest.create = function create(properties) { + return new MergeCapacityCommitmentsRequest(properties); + }; + + /** + * Encodes the specified MergeCapacityCommitmentsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest} message MergeCapacityCommitmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MergeCapacityCommitmentsRequest.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.capacityCommitmentIds != null && message.capacityCommitmentIds.length) + for (var i = 0; i < message.capacityCommitmentIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.capacityCommitmentIds[i]); + return writer; + }; + + /** + * Encodes the specified MergeCapacityCommitmentsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest} message MergeCapacityCommitmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MergeCapacityCommitmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MergeCapacityCommitmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest} MergeCapacityCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MergeCapacityCommitmentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + if (!(message.capacityCommitmentIds && message.capacityCommitmentIds.length)) + message.capacityCommitmentIds = []; + message.capacityCommitmentIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MergeCapacityCommitmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest} MergeCapacityCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MergeCapacityCommitmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MergeCapacityCommitmentsRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MergeCapacityCommitmentsRequest.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.capacityCommitmentIds != null && message.hasOwnProperty("capacityCommitmentIds")) { + if (!Array.isArray(message.capacityCommitmentIds)) + return "capacityCommitmentIds: array expected"; + for (var i = 0; i < message.capacityCommitmentIds.length; ++i) + if (!$util.isString(message.capacityCommitmentIds[i])) + return "capacityCommitmentIds: string[] expected"; + } + return null; + }; + + /** + * Creates a MergeCapacityCommitmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest} MergeCapacityCommitmentsRequest + */ + MergeCapacityCommitmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.capacityCommitmentIds) { + if (!Array.isArray(object.capacityCommitmentIds)) + throw TypeError(".google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest.capacityCommitmentIds: array expected"); + message.capacityCommitmentIds = []; + for (var i = 0; i < object.capacityCommitmentIds.length; ++i) + message.capacityCommitmentIds[i] = String(object.capacityCommitmentIds[i]); + } + return message; + }; + + /** + * Creates a plain object from a MergeCapacityCommitmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest} message MergeCapacityCommitmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MergeCapacityCommitmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.capacityCommitmentIds = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.capacityCommitmentIds && message.capacityCommitmentIds.length) { + object.capacityCommitmentIds = []; + for (var j = 0; j < message.capacityCommitmentIds.length; ++j) + object.capacityCommitmentIds[j] = message.capacityCommitmentIds[j]; + } + return object; + }; + + /** + * Converts this MergeCapacityCommitmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @instance + * @returns {Object.} JSON object + */ + MergeCapacityCommitmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MergeCapacityCommitmentsRequest; + })(); + + v1.Assignment = (function() { + + /** + * Properties of an Assignment. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IAssignment + * @property {string|null} [name] Assignment name + * @property {string|null} [assignee] Assignment assignee + * @property {google.cloud.bigquery.reservation.v1.Assignment.JobType|null} [jobType] Assignment jobType + * @property {google.cloud.bigquery.reservation.v1.Assignment.State|null} [state] Assignment state + */ + + /** + * Constructs a new Assignment. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents an Assignment. + * @implements IAssignment + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IAssignment=} [properties] Properties to set + */ + function Assignment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Assignment name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @instance + */ + Assignment.prototype.name = ""; + + /** + * Assignment assignee. + * @member {string} assignee + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @instance + */ + Assignment.prototype.assignee = ""; + + /** + * Assignment jobType. + * @member {google.cloud.bigquery.reservation.v1.Assignment.JobType} jobType + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @instance + */ + Assignment.prototype.jobType = 0; + + /** + * Assignment state. + * @member {google.cloud.bigquery.reservation.v1.Assignment.State} state + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @instance + */ + Assignment.prototype.state = 0; + + /** + * Creates a new Assignment instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @static + * @param {google.cloud.bigquery.reservation.v1.IAssignment=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.Assignment} Assignment instance + */ + Assignment.create = function create(properties) { + return new Assignment(properties); + }; + + /** + * Encodes the specified Assignment message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.Assignment.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @static + * @param {google.cloud.bigquery.reservation.v1.IAssignment} message Assignment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Assignment.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.jobType != null && Object.hasOwnProperty.call(message, "jobType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.jobType); + if (message.assignee != null && Object.hasOwnProperty.call(message, "assignee")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.assignee); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + return writer; + }; + + /** + * Encodes the specified Assignment message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.Assignment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @static + * @param {google.cloud.bigquery.reservation.v1.IAssignment} message Assignment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Assignment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Assignment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.Assignment} Assignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Assignment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.Assignment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 4: + message.assignee = reader.string(); + break; + case 3: + message.jobType = reader.int32(); + break; + case 6: + message.state = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Assignment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.Assignment} Assignment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Assignment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Assignment message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Assignment.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.assignee != null && message.hasOwnProperty("assignee")) + if (!$util.isString(message.assignee)) + return "assignee: string expected"; + if (message.jobType != null && message.hasOwnProperty("jobType")) + switch (message.jobType) { + default: + return "jobType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Assignment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.Assignment} Assignment + */ + Assignment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.Assignment) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.Assignment(); + if (object.name != null) + message.name = String(object.name); + if (object.assignee != null) + message.assignee = String(object.assignee); + switch (object.jobType) { + case "JOB_TYPE_UNSPECIFIED": + case 0: + message.jobType = 0; + break; + case "PIPELINE": + case 1: + message.jobType = 1; + break; + case "QUERY": + case 2: + message.jobType = 2; + break; + } + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Assignment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @static + * @param {google.cloud.bigquery.reservation.v1.Assignment} message Assignment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Assignment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.jobType = options.enums === String ? "JOB_TYPE_UNSPECIFIED" : 0; + object.assignee = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.jobType != null && message.hasOwnProperty("jobType")) + object.jobType = options.enums === String ? $root.google.cloud.bigquery.reservation.v1.Assignment.JobType[message.jobType] : message.jobType; + if (message.assignee != null && message.hasOwnProperty("assignee")) + object.assignee = message.assignee; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.bigquery.reservation.v1.Assignment.State[message.state] : message.state; + return object; + }; + + /** + * Converts this Assignment to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @instance + * @returns {Object.} JSON object + */ + Assignment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * JobType enum. + * @name google.cloud.bigquery.reservation.v1.Assignment.JobType + * @enum {number} + * @property {number} JOB_TYPE_UNSPECIFIED=0 JOB_TYPE_UNSPECIFIED value + * @property {number} PIPELINE=1 PIPELINE value + * @property {number} QUERY=2 QUERY value + */ + Assignment.JobType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOB_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PIPELINE"] = 1; + values[valuesById[2] = "QUERY"] = 2; + return values; + })(); + + /** + * State enum. + * @name google.cloud.bigquery.reservation.v1.Assignment.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} ACTIVE=2 ACTIVE value + */ + Assignment.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + return values; + })(); + + return Assignment; + })(); + + v1.CreateAssignmentRequest = (function() { + + /** + * Properties of a CreateAssignmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface ICreateAssignmentRequest + * @property {string|null} [parent] CreateAssignmentRequest parent + * @property {google.cloud.bigquery.reservation.v1.IAssignment|null} [assignment] CreateAssignmentRequest assignment + */ + + /** + * Constructs a new CreateAssignmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a CreateAssignmentRequest. + * @implements ICreateAssignmentRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest=} [properties] Properties to set + */ + function CreateAssignmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAssignmentRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @instance + */ + CreateAssignmentRequest.prototype.parent = ""; + + /** + * CreateAssignmentRequest assignment. + * @member {google.cloud.bigquery.reservation.v1.IAssignment|null|undefined} assignment + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @instance + */ + CreateAssignmentRequest.prototype.assignment = null; + + /** + * Creates a new CreateAssignmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.CreateAssignmentRequest} CreateAssignmentRequest instance + */ + CreateAssignmentRequest.create = function create(properties) { + return new CreateAssignmentRequest(properties); + }; + + /** + * Encodes the specified CreateAssignmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateAssignmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest} message CreateAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAssignmentRequest.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.assignment != null && Object.hasOwnProperty.call(message, "assignment")) + $root.google.cloud.bigquery.reservation.v1.Assignment.encode(message.assignment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.CreateAssignmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest} message CreateAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAssignmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAssignmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.CreateAssignmentRequest} CreateAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAssignmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.assignment = $root.google.cloud.bigquery.reservation.v1.Assignment.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAssignmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.CreateAssignmentRequest} CreateAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAssignmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAssignmentRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAssignmentRequest.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.assignment != null && message.hasOwnProperty("assignment")) { + var error = $root.google.cloud.bigquery.reservation.v1.Assignment.verify(message.assignment); + if (error) + return "assignment." + error; + } + return null; + }; + + /** + * Creates a CreateAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.CreateAssignmentRequest} CreateAssignmentRequest + */ + CreateAssignmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.assignment != null) { + if (typeof object.assignment !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.CreateAssignmentRequest.assignment: object expected"); + message.assignment = $root.google.cloud.bigquery.reservation.v1.Assignment.fromObject(object.assignment); + } + return message; + }; + + /** + * Creates a plain object from a CreateAssignmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.CreateAssignmentRequest} message CreateAssignmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAssignmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.assignment = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.assignment != null && message.hasOwnProperty("assignment")) + object.assignment = $root.google.cloud.bigquery.reservation.v1.Assignment.toObject(message.assignment, options); + return object; + }; + + /** + * Converts this CreateAssignmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAssignmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateAssignmentRequest; + })(); + + v1.ListAssignmentsRequest = (function() { + + /** + * Properties of a ListAssignmentsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IListAssignmentsRequest + * @property {string|null} [parent] ListAssignmentsRequest parent + * @property {number|null} [pageSize] ListAssignmentsRequest pageSize + * @property {string|null} [pageToken] ListAssignmentsRequest pageToken + */ + + /** + * Constructs a new ListAssignmentsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a ListAssignmentsRequest. + * @implements IListAssignmentsRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IListAssignmentsRequest=} [properties] Properties to set + */ + function ListAssignmentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAssignmentsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @instance + */ + ListAssignmentsRequest.prototype.parent = ""; + + /** + * ListAssignmentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @instance + */ + ListAssignmentsRequest.prototype.pageSize = 0; + + /** + * ListAssignmentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @instance + */ + ListAssignmentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAssignmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IListAssignmentsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.ListAssignmentsRequest} ListAssignmentsRequest instance + */ + ListAssignmentsRequest.create = function create(properties) { + return new ListAssignmentsRequest(properties); + }; + + /** + * Encodes the specified ListAssignmentsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListAssignmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IListAssignmentsRequest} message ListAssignmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssignmentsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListAssignmentsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListAssignmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IListAssignmentsRequest} message ListAssignmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssignmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssignmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.ListAssignmentsRequest} ListAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssignmentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssignmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.ListAssignmentsRequest} ListAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssignmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssignmentsRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssignmentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListAssignmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.ListAssignmentsRequest} ListAssignmentsRequest + */ + ListAssignmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListAssignmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ListAssignmentsRequest} message ListAssignmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssignmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListAssignmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAssignmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListAssignmentsRequest; + })(); + + v1.ListAssignmentsResponse = (function() { + + /** + * Properties of a ListAssignmentsResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IListAssignmentsResponse + * @property {Array.|null} [assignments] ListAssignmentsResponse assignments + * @property {string|null} [nextPageToken] ListAssignmentsResponse nextPageToken + */ + + /** + * Constructs a new ListAssignmentsResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a ListAssignmentsResponse. + * @implements IListAssignmentsResponse + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IListAssignmentsResponse=} [properties] Properties to set + */ + function ListAssignmentsResponse(properties) { + this.assignments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAssignmentsResponse assignments. + * @member {Array.} assignments + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @instance + */ + ListAssignmentsResponse.prototype.assignments = $util.emptyArray; + + /** + * ListAssignmentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @instance + */ + ListAssignmentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAssignmentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.IListAssignmentsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.ListAssignmentsResponse} ListAssignmentsResponse instance + */ + ListAssignmentsResponse.create = function create(properties) { + return new ListAssignmentsResponse(properties); + }; + + /** + * Encodes the specified ListAssignmentsResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListAssignmentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.IListAssignmentsResponse} message ListAssignmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssignmentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.assignments != null && message.assignments.length) + for (var i = 0; i < message.assignments.length; ++i) + $root.google.cloud.bigquery.reservation.v1.Assignment.encode(message.assignments[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 ListAssignmentsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.ListAssignmentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.IListAssignmentsResponse} message ListAssignmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssignmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssignmentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.ListAssignmentsResponse} ListAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssignmentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.assignments && message.assignments.length)) + message.assignments = []; + message.assignments.push($root.google.cloud.bigquery.reservation.v1.Assignment.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssignmentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.ListAssignmentsResponse} ListAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssignmentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssignmentsResponse message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssignmentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.assignments != null && message.hasOwnProperty("assignments")) { + if (!Array.isArray(message.assignments)) + return "assignments: array expected"; + for (var i = 0; i < message.assignments.length; ++i) { + var error = $root.google.cloud.bigquery.reservation.v1.Assignment.verify(message.assignments[i]); + if (error) + return "assignments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAssignmentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.ListAssignmentsResponse} ListAssignmentsResponse + */ + ListAssignmentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.ListAssignmentsResponse(); + if (object.assignments) { + if (!Array.isArray(object.assignments)) + throw TypeError(".google.cloud.bigquery.reservation.v1.ListAssignmentsResponse.assignments: array expected"); + message.assignments = []; + for (var i = 0; i < object.assignments.length; ++i) { + if (typeof object.assignments[i] !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.ListAssignmentsResponse.assignments: object expected"); + message.assignments[i] = $root.google.cloud.bigquery.reservation.v1.Assignment.fromObject(object.assignments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAssignmentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ListAssignmentsResponse} message ListAssignmentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssignmentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assignments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.assignments && message.assignments.length) { + object.assignments = []; + for (var j = 0; j < message.assignments.length; ++j) + object.assignments[j] = $root.google.cloud.bigquery.reservation.v1.Assignment.toObject(message.assignments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAssignmentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAssignmentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListAssignmentsResponse; + })(); + + v1.DeleteAssignmentRequest = (function() { + + /** + * Properties of a DeleteAssignmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IDeleteAssignmentRequest + * @property {string|null} [name] DeleteAssignmentRequest name + */ + + /** + * Constructs a new DeleteAssignmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a DeleteAssignmentRequest. + * @implements IDeleteAssignmentRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest=} [properties] Properties to set + */ + function DeleteAssignmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAssignmentRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + * @instance + */ + DeleteAssignmentRequest.prototype.name = ""; + + /** + * Creates a new DeleteAssignmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest} DeleteAssignmentRequest instance + */ + DeleteAssignmentRequest.create = function create(properties) { + return new DeleteAssignmentRequest(properties); + }; + + /** + * Encodes the specified DeleteAssignmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest} message DeleteAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAssignmentRequest.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 DeleteAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest} message DeleteAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAssignmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAssignmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest} DeleteAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAssignmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest(); + 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 DeleteAssignmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest} DeleteAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAssignmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAssignmentRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAssignmentRequest.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 DeleteAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest} DeleteAssignmentRequest + */ + DeleteAssignmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteAssignmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest} message DeleteAssignmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAssignmentRequest.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 DeleteAssignmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAssignmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteAssignmentRequest; + })(); + + v1.SearchAssignmentsRequest = (function() { + + /** + * Properties of a SearchAssignmentsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface ISearchAssignmentsRequest + * @property {string|null} [parent] SearchAssignmentsRequest parent + * @property {string|null} [query] SearchAssignmentsRequest query + * @property {number|null} [pageSize] SearchAssignmentsRequest pageSize + * @property {string|null} [pageToken] SearchAssignmentsRequest pageToken + */ + + /** + * Constructs a new SearchAssignmentsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a SearchAssignmentsRequest. + * @implements ISearchAssignmentsRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest=} [properties] Properties to set + */ + function SearchAssignmentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchAssignmentsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @instance + */ + SearchAssignmentsRequest.prototype.parent = ""; + + /** + * SearchAssignmentsRequest query. + * @member {string} query + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @instance + */ + SearchAssignmentsRequest.prototype.query = ""; + + /** + * SearchAssignmentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @instance + */ + SearchAssignmentsRequest.prototype.pageSize = 0; + + /** + * SearchAssignmentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @instance + */ + SearchAssignmentsRequest.prototype.pageToken = ""; + + /** + * Creates a new SearchAssignmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest} SearchAssignmentsRequest instance + */ + SearchAssignmentsRequest.create = function create(properties) { + return new SearchAssignmentsRequest(properties); + }; + + /** + * Encodes the specified SearchAssignmentsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest} message SearchAssignmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAssignmentsRequest.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.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 SearchAssignmentsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest} message SearchAssignmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAssignmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchAssignmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest} SearchAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAssignmentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = 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; + } + } + return message; + }; + + /** + * Decodes a SearchAssignmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest} SearchAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAssignmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchAssignmentsRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchAssignmentsRequest.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.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 SearchAssignmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest} SearchAssignmentsRequest + */ + SearchAssignmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 SearchAssignmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest} message SearchAssignmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchAssignmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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 SearchAssignmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @instance + * @returns {Object.} JSON object + */ + SearchAssignmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SearchAssignmentsRequest; + })(); + + v1.SearchAssignmentsResponse = (function() { + + /** + * Properties of a SearchAssignmentsResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface ISearchAssignmentsResponse + * @property {Array.|null} [assignments] SearchAssignmentsResponse assignments + * @property {string|null} [nextPageToken] SearchAssignmentsResponse nextPageToken + */ + + /** + * Constructs a new SearchAssignmentsResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a SearchAssignmentsResponse. + * @implements ISearchAssignmentsResponse + * @constructor + * @param {google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse=} [properties] Properties to set + */ + function SearchAssignmentsResponse(properties) { + this.assignments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchAssignmentsResponse assignments. + * @member {Array.} assignments + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @instance + */ + SearchAssignmentsResponse.prototype.assignments = $util.emptyArray; + + /** + * SearchAssignmentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @instance + */ + SearchAssignmentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchAssignmentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse} SearchAssignmentsResponse instance + */ + SearchAssignmentsResponse.create = function create(properties) { + return new SearchAssignmentsResponse(properties); + }; + + /** + * Encodes the specified SearchAssignmentsResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse} message SearchAssignmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAssignmentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.assignments != null && message.assignments.length) + for (var i = 0; i < message.assignments.length; ++i) + $root.google.cloud.bigquery.reservation.v1.Assignment.encode(message.assignments[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 SearchAssignmentsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse} message SearchAssignmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAssignmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchAssignmentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse} SearchAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAssignmentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.assignments && message.assignments.length)) + message.assignments = []; + message.assignments.push($root.google.cloud.bigquery.reservation.v1.Assignment.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchAssignmentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse} SearchAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAssignmentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchAssignmentsResponse message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchAssignmentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.assignments != null && message.hasOwnProperty("assignments")) { + if (!Array.isArray(message.assignments)) + return "assignments: array expected"; + for (var i = 0; i < message.assignments.length; ++i) { + var error = $root.google.cloud.bigquery.reservation.v1.Assignment.verify(message.assignments[i]); + if (error) + return "assignments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchAssignmentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse} SearchAssignmentsResponse + */ + SearchAssignmentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse(); + if (object.assignments) { + if (!Array.isArray(object.assignments)) + throw TypeError(".google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse.assignments: array expected"); + message.assignments = []; + for (var i = 0; i < object.assignments.length; ++i) { + if (typeof object.assignments[i] !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse.assignments: object expected"); + message.assignments[i] = $root.google.cloud.bigquery.reservation.v1.Assignment.fromObject(object.assignments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchAssignmentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse} message SearchAssignmentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchAssignmentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assignments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.assignments && message.assignments.length) { + object.assignments = []; + for (var j = 0; j < message.assignments.length; ++j) + object.assignments[j] = $root.google.cloud.bigquery.reservation.v1.Assignment.toObject(message.assignments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchAssignmentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @instance + * @returns {Object.} JSON object + */ + SearchAssignmentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SearchAssignmentsResponse; + })(); + + v1.MoveAssignmentRequest = (function() { + + /** + * Properties of a MoveAssignmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IMoveAssignmentRequest + * @property {string|null} [name] MoveAssignmentRequest name + * @property {string|null} [destinationId] MoveAssignmentRequest destinationId + */ + + /** + * Constructs a new MoveAssignmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a MoveAssignmentRequest. + * @implements IMoveAssignmentRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest=} [properties] Properties to set + */ + function MoveAssignmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MoveAssignmentRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @instance + */ + MoveAssignmentRequest.prototype.name = ""; + + /** + * MoveAssignmentRequest destinationId. + * @member {string} destinationId + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @instance + */ + MoveAssignmentRequest.prototype.destinationId = ""; + + /** + * Creates a new MoveAssignmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.MoveAssignmentRequest} MoveAssignmentRequest instance + */ + MoveAssignmentRequest.create = function create(properties) { + return new MoveAssignmentRequest(properties); + }; + + /** + * Encodes the specified MoveAssignmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.MoveAssignmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest} message MoveAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveAssignmentRequest.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.destinationId != null && Object.hasOwnProperty.call(message, "destinationId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.destinationId); + return writer; + }; + + /** + * Encodes the specified MoveAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.MoveAssignmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest} message MoveAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveAssignmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveAssignmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.MoveAssignmentRequest} MoveAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveAssignmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.destinationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveAssignmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.MoveAssignmentRequest} MoveAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveAssignmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveAssignmentRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveAssignmentRequest.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.destinationId != null && message.hasOwnProperty("destinationId")) + if (!$util.isString(message.destinationId)) + return "destinationId: string expected"; + return null; + }; + + /** + * Creates a MoveAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.MoveAssignmentRequest} MoveAssignmentRequest + */ + MoveAssignmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.destinationId != null) + message.destinationId = String(object.destinationId); + return message; + }; + + /** + * Creates a plain object from a MoveAssignmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.MoveAssignmentRequest} message MoveAssignmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveAssignmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.destinationId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.destinationId != null && message.hasOwnProperty("destinationId")) + object.destinationId = message.destinationId; + return object; + }; + + /** + * Converts this MoveAssignmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @instance + * @returns {Object.} JSON object + */ + MoveAssignmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MoveAssignmentRequest; + })(); + + v1.BiReservation = (function() { + + /** + * Properties of a BiReservation. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IBiReservation + * @property {string|null} [name] BiReservation name + * @property {google.protobuf.ITimestamp|null} [updateTime] BiReservation updateTime + * @property {number|Long|null} [size] BiReservation size + */ + + /** + * Constructs a new BiReservation. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a BiReservation. + * @implements IBiReservation + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IBiReservation=} [properties] Properties to set + */ + function BiReservation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BiReservation name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @instance + */ + BiReservation.prototype.name = ""; + + /** + * BiReservation updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @instance + */ + BiReservation.prototype.updateTime = null; + + /** + * BiReservation size. + * @member {number|Long} size + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @instance + */ + BiReservation.prototype.size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new BiReservation instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @static + * @param {google.cloud.bigquery.reservation.v1.IBiReservation=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.BiReservation} BiReservation instance + */ + BiReservation.create = function create(properties) { + return new BiReservation(properties); + }; + + /** + * Encodes the specified BiReservation message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.BiReservation.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @static + * @param {google.cloud.bigquery.reservation.v1.IBiReservation} message BiReservation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BiReservation.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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.size != null && Object.hasOwnProperty.call(message, "size")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.size); + return writer; + }; + + /** + * Encodes the specified BiReservation message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.BiReservation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @static + * @param {google.cloud.bigquery.reservation.v1.IBiReservation} message BiReservation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BiReservation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BiReservation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.BiReservation} BiReservation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BiReservation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.BiReservation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.size = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BiReservation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.BiReservation} BiReservation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BiReservation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BiReservation message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BiReservation.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.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.size != null && message.hasOwnProperty("size")) + if (!$util.isInteger(message.size) && !(message.size && $util.isInteger(message.size.low) && $util.isInteger(message.size.high))) + return "size: integer|Long expected"; + return null; + }; + + /** + * Creates a BiReservation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.BiReservation} BiReservation + */ + BiReservation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.BiReservation) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.BiReservation(); + if (object.name != null) + message.name = String(object.name); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.BiReservation.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.size != null) + if ($util.Long) + (message.size = $util.Long.fromValue(object.size)).unsigned = false; + else if (typeof object.size === "string") + message.size = parseInt(object.size, 10); + else if (typeof object.size === "number") + message.size = object.size; + else if (typeof object.size === "object") + message.size = new $util.LongBits(object.size.low >>> 0, object.size.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a BiReservation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @static + * @param {google.cloud.bigquery.reservation.v1.BiReservation} message BiReservation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BiReservation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.updateTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.size = options.longs === String ? "0" : 0; + } + 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); + if (message.size != null && message.hasOwnProperty("size")) + if (typeof message.size === "number") + object.size = options.longs === String ? String(message.size) : message.size; + else + object.size = options.longs === String ? $util.Long.prototype.toString.call(message.size) : options.longs === Number ? new $util.LongBits(message.size.low >>> 0, message.size.high >>> 0).toNumber() : message.size; + return object; + }; + + /** + * Converts this BiReservation to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @instance + * @returns {Object.} JSON object + */ + BiReservation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BiReservation; + })(); + + v1.GetBiReservationRequest = (function() { + + /** + * Properties of a GetBiReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IGetBiReservationRequest + * @property {string|null} [name] GetBiReservationRequest name + */ + + /** + * Constructs a new GetBiReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a GetBiReservationRequest. + * @implements IGetBiReservationRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IGetBiReservationRequest=} [properties] Properties to set + */ + function GetBiReservationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBiReservationRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.reservation.v1.GetBiReservationRequest + * @instance + */ + GetBiReservationRequest.prototype.name = ""; + + /** + * Creates a new GetBiReservationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.GetBiReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IGetBiReservationRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.GetBiReservationRequest} GetBiReservationRequest instance + */ + GetBiReservationRequest.create = function create(properties) { + return new GetBiReservationRequest(properties); + }; + + /** + * Encodes the specified GetBiReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetBiReservationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.GetBiReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IGetBiReservationRequest} message GetBiReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBiReservationRequest.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 GetBiReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.GetBiReservationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.GetBiReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IGetBiReservationRequest} message GetBiReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBiReservationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBiReservationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.GetBiReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.GetBiReservationRequest} GetBiReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBiReservationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.GetBiReservationRequest(); + 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 GetBiReservationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.GetBiReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.GetBiReservationRequest} GetBiReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBiReservationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBiReservationRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.GetBiReservationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBiReservationRequest.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 GetBiReservationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.GetBiReservationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.GetBiReservationRequest} GetBiReservationRequest + */ + GetBiReservationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.GetBiReservationRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.GetBiReservationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBiReservationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.GetBiReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.GetBiReservationRequest} message GetBiReservationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBiReservationRequest.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 GetBiReservationRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.GetBiReservationRequest + * @instance + * @returns {Object.} JSON object + */ + GetBiReservationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetBiReservationRequest; + })(); + + v1.UpdateBiReservationRequest = (function() { + + /** + * Properties of an UpdateBiReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IUpdateBiReservationRequest + * @property {google.cloud.bigquery.reservation.v1.IBiReservation|null} [biReservation] UpdateBiReservationRequest biReservation + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBiReservationRequest updateMask + */ + + /** + * Constructs a new UpdateBiReservationRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents an UpdateBiReservationRequest. + * @implements IUpdateBiReservationRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest=} [properties] Properties to set + */ + function UpdateBiReservationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBiReservationRequest biReservation. + * @member {google.cloud.bigquery.reservation.v1.IBiReservation|null|undefined} biReservation + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @instance + */ + UpdateBiReservationRequest.prototype.biReservation = null; + + /** + * UpdateBiReservationRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @instance + */ + UpdateBiReservationRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateBiReservationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest} UpdateBiReservationRequest instance + */ + UpdateBiReservationRequest.create = function create(properties) { + return new UpdateBiReservationRequest(properties); + }; + + /** + * Encodes the specified UpdateBiReservationRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest} message UpdateBiReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBiReservationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.biReservation != null && Object.hasOwnProperty.call(message, "biReservation")) + $root.google.cloud.bigquery.reservation.v1.BiReservation.encode(message.biReservation, 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 UpdateBiReservationRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest} message UpdateBiReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBiReservationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBiReservationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest} UpdateBiReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBiReservationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.biReservation = $root.google.cloud.bigquery.reservation.v1.BiReservation.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 UpdateBiReservationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest} UpdateBiReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBiReservationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBiReservationRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBiReservationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.biReservation != null && message.hasOwnProperty("biReservation")) { + var error = $root.google.cloud.bigquery.reservation.v1.BiReservation.verify(message.biReservation); + if (error) + return "biReservation." + 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 UpdateBiReservationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest} UpdateBiReservationRequest + */ + UpdateBiReservationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest(); + if (object.biReservation != null) { + if (typeof object.biReservation !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest.biReservation: object expected"); + message.biReservation = $root.google.cloud.bigquery.reservation.v1.BiReservation.fromObject(object.biReservation); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateBiReservationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest} message UpdateBiReservationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBiReservationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.biReservation = null; + object.updateMask = null; + } + if (message.biReservation != null && message.hasOwnProperty("biReservation")) + object.biReservation = $root.google.cloud.bigquery.reservation.v1.BiReservation.toObject(message.biReservation, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateBiReservationRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBiReservationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateBiReservationRequest; + })(); + + return v1; + })(); + + return reservation; + })(); + + return bigquery; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fullyDecodeReservedExpansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = ""; + + /** + * HttpRule put. + * @member {string} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = ""; + + /** + * HttpRule post. + * @member {string} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = ""; + + /** + * HttpRule delete. + * @member {string} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = ""; + + /** + * HttpRule patch. + * @member {string} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = ""; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message["delete"] = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.responseBody = reader.string(); + break; + case 11: + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CustomHttpPattern; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + case 3: + message.nameField = reader.string(); + break; + case 4: + message.history = reader.int32(); + break; + case 5: + message.plural = reader.string(); + break; + case 6: + message.singular = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pattern = []; + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.childType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message["package"] = reader.string(); + break; + case 3: + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + case 10: + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + case 11: + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + case 4: + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 8: + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + case 8: + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + case 10: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32(); + break; + case 5: + message.type = reader.int32(); + break; + case 6: + message.typeName = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.defaultValue = reader.string(); + break; + case 9: + message.oneofIndex = reader.int32(); + break; + case 10: + message.jsonName = reader.string(); + break; + case 8: + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + case 17: + message.proto3Optional = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.inputType = reader.string(); + break; + case 3: + message.outputType = reader.string(); + break; + case 4: + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.clientStreaming = reader.bool(); + break; + case 6: + message.serverStreaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.javaPackage = reader.string(); + break; + case 8: + message.javaOuterClassname = reader.string(); + break; + case 10: + message.javaMultipleFiles = reader.bool(); + break; + case 20: + message.javaGenerateEqualsAndHash = reader.bool(); + break; + case 27: + message.javaStringCheckUtf8 = reader.bool(); + break; + case 9: + message.optimizeFor = reader.int32(); + break; + case 11: + message.goPackage = reader.string(); + break; + case 16: + message.ccGenericServices = reader.bool(); + break; + case 17: + message.javaGenericServices = reader.bool(); + break; + case 18: + message.pyGenericServices = reader.bool(); + break; + case 42: + message.phpGenericServices = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.ccEnableArenas = reader.bool(); + break; + case 36: + message.objcClassPrefix = reader.string(); + break; + case 37: + message.csharpNamespace = reader.string(); + break; + case 39: + message.swiftPrefix = reader.string(); + break; + case 40: + message.phpClassPrefix = reader.string(); + break; + case 41: + message.phpNamespace = reader.string(); + break; + case 44: + message.phpMetadataNamespace = reader.string(); + break; + case 45: + message.rubyPackage = reader.string(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1053: + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageSetWireFormat = reader.bool(); + break; + case 2: + message.noStandardDescriptorAccessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.mapEntry = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1053: + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = reader.int32(); + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = reader.int32(); + break; + case 5: + message.lazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1052: + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + case 1055: + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allowAlias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1049: + message[".google.api.defaultHost"] = reader.string(); + break; + case 1050: + message[".google.api.oauthScopes"] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 34: + message.idempotencyLevel = reader.int32(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 72295728: + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + case 1051: + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + 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.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.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + case 3: + message.identifierValue = reader.string(); + break; + case 4: + message.positiveIntValue = reader.uint64(); + break; + case 5: + message.negativeIntValue = reader.int64(); + break; + case 6: + message.doubleValue = reader.double(); + break; + case 7: + message.stringValue = reader.bytes(); + break; + case 8: + message.aggregateValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namePart = reader.string(); + break; + case 2: + message.isExtension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + case 3: + message.leadingComments = reader.string(); + break; + case 4: + message.trailingComments = reader.string(); + break; + case 6: + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + message.sourceFile = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FieldMask; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Timestamp; + })(); + + 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; + })(); + + return protobuf; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.int32(); + break; + case 2: + message.message = reader.string(); + break; + case 3: + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.json b/packages/google-cloud-bigquery-reservation/protos/protos.json new file mode 100644 index 00000000000..03658be52da --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/protos/protos.json @@ -0,0 +1,1878 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "bigquery": { + "nested": { + "reservation": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.BigQuery.Reservation.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/bigquery/reservation/v1;reservation", + "java_multiple_files": true, + "java_outer_classname": "ReservationProto", + "java_package": "com.google.cloud.bigquery.reservation.v1" + }, + "nested": { + "ReservationService": { + "options": { + "(google.api.default_host)": "bigqueryreservation.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateReservation": { + "requestType": "CreateReservationRequest", + "responseType": "Reservation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/reservations", + "(google.api.http).body": "reservation", + "(google.api.method_signature)": "parent,reservation,reservation_id" + } + }, + "ListReservations": { + "requestType": "ListReservationsRequest", + "responseType": "ListReservationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/reservations", + "(google.api.method_signature)": "parent" + } + }, + "GetReservation": { + "requestType": "GetReservationRequest", + "responseType": "Reservation", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/reservations/*}", + "(google.api.method_signature)": "name" + } + }, + "DeleteReservation": { + "requestType": "DeleteReservationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/reservations/*}", + "(google.api.method_signature)": "name" + } + }, + "UpdateReservation": { + "requestType": "UpdateReservationRequest", + "responseType": "Reservation", + "options": { + "(google.api.http).patch": "/v1/{reservation.name=projects/*/locations/*/reservations/*}", + "(google.api.http).body": "reservation", + "(google.api.method_signature)": "reservation,update_mask" + } + }, + "CreateCapacityCommitment": { + "requestType": "CreateCapacityCommitmentRequest", + "responseType": "CapacityCommitment", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/capacityCommitments", + "(google.api.http).body": "capacity_commitment", + "(google.api.method_signature)": "parent,capacity_commitment" + } + }, + "ListCapacityCommitments": { + "requestType": "ListCapacityCommitmentsRequest", + "responseType": "ListCapacityCommitmentsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/capacityCommitments", + "(google.api.method_signature)": "parent" + } + }, + "GetCapacityCommitment": { + "requestType": "GetCapacityCommitmentRequest", + "responseType": "CapacityCommitment", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/capacityCommitments/*}", + "(google.api.method_signature)": "name" + } + }, + "DeleteCapacityCommitment": { + "requestType": "DeleteCapacityCommitmentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/capacityCommitments/*}", + "(google.api.method_signature)": "name" + } + }, + "UpdateCapacityCommitment": { + "requestType": "UpdateCapacityCommitmentRequest", + "responseType": "CapacityCommitment", + "options": { + "(google.api.http).patch": "/v1/{capacity_commitment.name=projects/*/locations/*/capacityCommitments/*}", + "(google.api.http).body": "capacity_commitment", + "(google.api.method_signature)": "capacity_commitment,update_mask" + } + }, + "SplitCapacityCommitment": { + "requestType": "SplitCapacityCommitmentRequest", + "responseType": "SplitCapacityCommitmentResponse", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/capacityCommitments/*}:split", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,slot_count" + } + }, + "MergeCapacityCommitments": { + "requestType": "MergeCapacityCommitmentsRequest", + "responseType": "CapacityCommitment", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/capacityCommitments:merge", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,capacity_commitment_ids" + } + }, + "CreateAssignment": { + "requestType": "CreateAssignmentRequest", + "responseType": "Assignment", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/reservations/*}/assignments", + "(google.api.http).body": "assignment", + "(google.api.method_signature)": "parent,assignment" + } + }, + "ListAssignments": { + "requestType": "ListAssignmentsRequest", + "responseType": "ListAssignmentsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/reservations/*}/assignments", + "(google.api.method_signature)": "parent" + } + }, + "DeleteAssignment": { + "requestType": "DeleteAssignmentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/reservations/*/assignments/*}", + "(google.api.method_signature)": "name" + } + }, + "SearchAssignments": { + "requestType": "SearchAssignmentsRequest", + "responseType": "SearchAssignmentsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}:searchAssignments", + "(google.api.method_signature)": "parent,query" + } + }, + "MoveAssignment": { + "requestType": "MoveAssignmentRequest", + "responseType": "Assignment", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/reservations/*/assignments/*}:move", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,destination_id" + } + }, + "GetBiReservation": { + "requestType": "GetBiReservationRequest", + "responseType": "BiReservation", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/biReservation}", + "(google.api.method_signature)": "name" + } + }, + "UpdateBiReservation": { + "requestType": "UpdateBiReservationRequest", + "responseType": "BiReservation", + "options": { + "(google.api.http).patch": "/v1/{bi_reservation.name=projects/*/locations/*/biReservation}", + "(google.api.http).body": "bi_reservation", + "(google.api.method_signature)": "bi_reservation,update_mask" + } + } + } + }, + "Reservation": { + "options": { + "(google.api.resource).type": "bigqueryreservation.googleapis.com/Reservation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/reservations/{reservation}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "slotCapacity": { + "type": "int64", + "id": 2 + }, + "ignoreIdleSlots": { + "type": "bool", + "id": 4 + } + } + }, + "CapacityCommitment": { + "options": { + "(google.api.resource).type": "bigqueryreservation.googleapis.com/CapacityCommitment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "slotCount": { + "type": "int64", + "id": 2 + }, + "plan": { + "type": "CommitmentPlan", + "id": 3 + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "commitmentEndTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failureStatus": { + "type": "google.rpc.Status", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "renewalPlan": { + "type": "CommitmentPlan", + "id": 8 + } + }, + "nested": { + "CommitmentPlan": { + "values": { + "COMMITMENT_PLAN_UNSPECIFIED": 0, + "FLEX": 3, + "TRIAL": 5, + "MONTHLY": 2, + "ANNUAL": 4 + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "ACTIVE": 2, + "FAILED": 3 + } + } + } + }, + "CreateReservationRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigqueryreservation.googleapis.com/Reservation" + } + }, + "reservationId": { + "type": "string", + "id": 2 + }, + "reservation": { + "type": "Reservation", + "id": 3 + } + } + }, + "ListReservationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigqueryreservation.googleapis.com/Reservation" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListReservationsResponse": { + "fields": { + "reservations": { + "rule": "repeated", + "type": "Reservation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetReservationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigqueryreservation.googleapis.com/Reservation" + } + } + } + }, + "DeleteReservationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigqueryreservation.googleapis.com/Reservation" + } + } + } + }, + "UpdateReservationRequest": { + "fields": { + "reservation": { + "type": "Reservation", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "CreateCapacityCommitmentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigqueryreservation.googleapis.com/CapacityCommitment" + } + }, + "capacityCommitment": { + "type": "CapacityCommitment", + "id": 2 + }, + "enforceSingleAdminProjectPerOrg": { + "type": "bool", + "id": 4 + } + } + }, + "ListCapacityCommitmentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigqueryreservation.googleapis.com/CapacityCommitment" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListCapacityCommitmentsResponse": { + "fields": { + "capacityCommitments": { + "rule": "repeated", + "type": "CapacityCommitment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetCapacityCommitmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigqueryreservation.googleapis.com/CapacityCommitment" + } + } + } + }, + "DeleteCapacityCommitmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigqueryreservation.googleapis.com/CapacityCommitment" + } + } + } + }, + "UpdateCapacityCommitmentRequest": { + "fields": { + "capacityCommitment": { + "type": "CapacityCommitment", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "SplitCapacityCommitmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigqueryreservation.googleapis.com/CapacityCommitment" + } + }, + "slotCount": { + "type": "int64", + "id": 2 + } + } + }, + "SplitCapacityCommitmentResponse": { + "fields": { + "first": { + "type": "CapacityCommitment", + "id": 1 + }, + "second": { + "type": "CapacityCommitment", + "id": 2 + } + } + }, + "MergeCapacityCommitmentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).child_type": "bigqueryreservation.googleapis.com/CapacityCommitment" + } + }, + "capacityCommitmentIds": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "Assignment": { + "options": { + "(google.api.resource).type": "bigqueryreservation.googleapis.com/Assignment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "assignee": { + "type": "string", + "id": 4 + }, + "jobType": { + "type": "JobType", + "id": 3 + }, + "state": { + "type": "State", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "JobType": { + "values": { + "JOB_TYPE_UNSPECIFIED": 0, + "PIPELINE": 1, + "QUERY": 2 + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "ACTIVE": 2 + } + } + } + }, + "CreateAssignmentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigqueryreservation.googleapis.com/Assignment" + } + }, + "assignment": { + "type": "Assignment", + "id": 2 + } + } + }, + "ListAssignmentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "bigqueryreservation.googleapis.com/Assignment" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListAssignmentsResponse": { + "fields": { + "assignments": { + "rule": "repeated", + "type": "Assignment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteAssignmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigqueryreservation.googleapis.com/Assignment" + } + } + } + }, + "SearchAssignmentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "query": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "SearchAssignmentsResponse": { + "fields": { + "assignments": { + "rule": "repeated", + "type": "Assignment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "MoveAssignmentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigqueryreservation.googleapis.com/Assignment" + } + }, + "destinationId": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).child_type": "bigqueryreservation.googleapis.com/Assignment" + } + } + } + }, + "BiReservation": { + "options": { + "(google.api.resource).type": "bigqueryreservation.googleapis.com/BiReservation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/bireservation" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "size": { + "type": "int64", + "id": 4 + } + } + }, + "GetBiReservationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigqueryreservation.googleapis.com/BiReservation" + } + } + } + }, + "UpdateBiReservationRequest": { + "fields": { + "biReservation": { + "type": "BiReservation", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + } + } + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-bigquery-reservation/samples/README.md b/packages/google-cloud-bigquery-reservation/samples/README.md new file mode 100644 index 00000000000..7ef0fea94ee --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/README.md @@ -0,0 +1,50 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google BigQuery Reservation: Node.js Samples](https://github.com/googleapis/nodejs-bigquery-reservation) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/nodejs-bigquery-reservation#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Quickstart + +View the [source code](https://github.com/googleapis/nodejs-bigquery-reservation/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-bigquery-reservation&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node samples/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigquery-reservation&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/bigquery/docs/reference/reservations diff --git a/packages/google-cloud-bigquery-reservation/samples/package.json b/packages/google-cloud-bigquery-reservation/samples/package.json new file mode 100644 index 00000000000..7ea0c72973f --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "@google-cloud/bigquery-reservation-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=10" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/bigquery-reservation": "^0.1.0" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^7.1.0" + } +} diff --git a/packages/google-cloud-bigquery-reservation/samples/quickstart.js b/packages/google-cloud-bigquery-reservation/samples/quickstart.js new file mode 100644 index 00000000000..d4dc02df653 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/quickstart.js @@ -0,0 +1,61 @@ +// 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'; + +async function quickstart( + project = 'my-project', // Project to list reservations for. + location = 'US' // BigQuery location. +) { + // [START bigqueryreservation_quickstart] + // Imports the Google Cloud client library + const { + ReservationServiceClient, + } = require('@google-cloud/bigquery-reservation'); + + // Creates a client + const client = new ReservationServiceClient(); + + // project = 'my-project' // Project to list reservations for. + // location = 'US' // BigQuery location. + + async function listReservations() { + const [reservations] = await client.listReservations({ + parent: `projects/${project}/locations/${location}`, + }); + + console.info(`found ${reservations.length} reservations`); + console.info(reservations); + } + + async function listCapacityCommitments() { + const [commitments] = await client.listCapacityCommitments({ + parent: `projects/${project}/locations/${location}`, + }); + + console.info(`found ${commitments.length} commitments`); + console.info(commitments); + } + + listReservations(); + listCapacityCommitments(); + // [END bigqueryreservation_quickstart] +} + +const args = process.argv.slice(2); +quickstart(...args).catch(err => { + console.error(err); + process.exitCode = 1; +}); diff --git a/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js b/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js new file mode 100644 index 00000000000..09198cd009c --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js @@ -0,0 +1,35 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +const {assert} = require('chai'); +const cp = require('child_process'); +const {describe, it} = require('mocha'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const project = process.env.GCLOUD_PROJECT; + +describe('Quickstart', () => { + it('should run quickstart', async () => { + const stdout = execSync(`node ./quickstart.js ${project}`); + assert.match(stdout, /found [0-9]+ reservations/); + assert.match(stdout, /found [0-9]+ commitments/); + }); +}); diff --git a/packages/google-cloud-bigquery-reservation/src/index.ts b/packages/google-cloud-bigquery-reservation/src/index.ts new file mode 100644 index 00000000000..929f8dca0fc --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/src/index.ts @@ -0,0 +1,24 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +const ReservationServiceClient = v1.ReservationServiceClient; +export {v1, ReservationServiceClient}; +export default {v1, ReservationServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-bigquery-reservation/src/v1/index.ts b/packages/google-cloud-bigquery-reservation/src/v1/index.ts new file mode 100644 index 00000000000..59513ffd54d --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/src/v1/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 {ReservationServiceClient} from './reservation_service_client'; diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts new file mode 100644 index 00000000000..b91d3ed00fd --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts @@ -0,0 +1,3099 @@ +// 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 './reservation_service_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * This API allows users to manage their flat-rate BigQuery reservations. + * + * A reservation provides computational resource guarantees, in the form of + * [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a + * unit of computational power in BigQuery, and serves as the basic unit of + * parallelism. In a scan of a multi-partitioned table, a single slot operates + * on a single partition of the table. A reservation resource exists as a child + * resource of the admin project and location, e.g.: + * `projects/myproject/locations/US/reservations/reservationName`. + * + * A capacity commitment is a way to purchase compute capacity for BigQuery jobs + * (in the form of slots) with some committed period of usage. A capacity + * commitment resource exists as a child resource of the admin project and + * location, e.g.: + * `projects/myproject/locations/US/capacityCommitments/id`. + * @class + * @memberof v1 + */ +export class ReservationServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + reservationServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ReservationServiceClient. + * + * @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 ReservationServiceClient; + 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 ReservationServiceClient 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 ReservationServiceClient).scopes; + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + assignmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}' + ), + biReservationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/bireservation' + ), + capacityCommitmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + reservationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reservations/{reservation}' + ), + }; + + // 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 = { + listReservations: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'reservations' + ), + listCapacityCommitments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'capacityCommitments' + ), + listAssignments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'assignments' + ), + searchAssignments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'assignments' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.bigquery.reservation.v1.ReservationService', + 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.reservationServiceStub) { + return this.reservationServiceStub; + } + + // Put together the "service stub" for + // google.cloud.bigquery.reservation.v1.ReservationService. + this.reservationServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.bigquery.reservation.v1.ReservationService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.bigquery.reservation.v1 + .ReservationService, + 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 reservationServiceStubMethods = [ + 'createReservation', + 'listReservations', + 'getReservation', + 'deleteReservation', + 'updateReservation', + 'createCapacityCommitment', + 'listCapacityCommitments', + 'getCapacityCommitment', + 'deleteCapacityCommitment', + 'updateCapacityCommitment', + 'splitCapacityCommitment', + 'mergeCapacityCommitments', + 'createAssignment', + 'listAssignments', + 'deleteAssignment', + 'searchAssignments', + 'moveAssignment', + 'getBiReservation', + 'updateBiReservation', + ]; + for (const methodName of reservationServiceStubMethods) { + const callPromise = this.reservationServiceStub.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.reservationServiceStub; + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'bigqueryreservation.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'bigqueryreservation.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/bigquery', + '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 -- + // ------------------- + createReservation( + request: protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest + | undefined + ), + {} | undefined + ] + >; + createReservation( + request: protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createReservation( + request: protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a new reservation resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Project, location. E.g., + * `projects/myproject/locations/US` + * @param {string} request.reservationId + * The reservation ID. This field must only contain lower case alphanumeric + * characters or dash. Max length is 64 characters. + * @param {google.cloud.bigquery.reservation.v1.Reservation} request.reservation + * Definition of the new reservation to create. + * @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 [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createReservation( + request: protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createReservation(request, options, callback); + } + getReservation( + request: protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest + | undefined + ), + {} | undefined + ] + >; + getReservation( + request: protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getReservation( + request: protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns information about the reservation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the reservation to retrieve. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + * @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 [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getReservation( + request: protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getReservation(request, options, callback); + } + deleteReservation( + request: protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest + | undefined + ), + {} | undefined + ] + >; + deleteReservation( + request: protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteReservation( + request: protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes a reservation. + * Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has + * assignments. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the reservation to retrieve. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + * @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. + */ + deleteReservation( + request: protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteReservation(request, options, callback); + } + updateReservation( + request: protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest + | undefined + ), + {} | undefined + ] + >; + updateReservation( + request: protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateReservation( + request: protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates an existing reservation resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.bigquery.reservation.v1.Reservation} request.reservation + * Content of the reservation to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Standard field mask for the set of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateReservation( + request: protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest + | 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({ + 'reservation.name': request.reservation!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateReservation(request, options, callback); + } + createCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + ( + | protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest + | undefined + ), + {} | undefined + ] + >; + createCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a new capacity commitment resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + * @param {google.cloud.bigquery.reservation.v1.CapacityCommitment} request.capacityCommitment + * Content of the capacity commitment to create. + * @param {boolean} request.enforceSingleAdminProjectPerOrg + * If true, fail the request if another project in the organization has a + * capacity commitment. + * @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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + ( + | protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createCapacityCommitment( + request, + options, + callback + ); + } + getCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + ( + | protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest + | undefined + ), + {} | undefined + ] + >; + getCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns information about the capacity commitment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the capacity commitment to retrieve. E.g., + * `projects/myproject/locations/US/capacityCommitments/123` + * @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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + ( + | protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getCapacityCommitment(request, options, callback); + } + deleteCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest + | undefined + ), + {} | undefined + ] + >; + deleteCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes a capacity commitment. Attempting to delete capacity commitment + * before its commitment_end_time will fail with the error code + * `google.rpc.Code.FAILED_PRECONDITION`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the capacity commitment to delete. E.g., + * `projects/myproject/locations/US/capacityCommitments/123` + * @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. + */ + deleteCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteCapacityCommitment( + request, + options, + callback + ); + } + updateCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + ( + | protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest + | undefined + ), + {} | undefined + ] + >; + updateCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates an existing capacity commitment. + * + * Only `plan` and `renewal_plan` fields can be updated. + * + * Plan can only be changed to a plan of a longer commitment period. + * Attempting to change to a plan with shorter commitment period will fail + * with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.bigquery.reservation.v1.CapacityCommitment} request.capacityCommitment + * Content of the capacity commitment to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Standard field mask for the set of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + ( + | protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest + | 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({ + 'capacity_commitment.name': request.capacityCommitment!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateCapacityCommitment( + request, + options, + callback + ); + } + splitCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, + ( + | protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest + | undefined + ), + {} | undefined + ] + >; + splitCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, + | protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + splitCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, + | protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Splits capacity commitment to two commitments of the same plan and + * `commitment_end_time`. + * + * A common use case is to enable downgrading commitments. + * + * For example, in order to downgrade from 10000 slots to 8000, you might + * split a 10000 capacity commitment into commitments of 2000 and 8000. Then, + * you would change the plan of the first one to `FLEX` and then delete it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name e.g.,: + * `projects/myproject/locations/US/capacityCommitments/123` + * @param {number} request.slotCount + * Number of slots in the capacity commitment after the split. + * @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 [SplitCapacityCommitmentResponse]{@link google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + splitCapacityCommitment( + request: protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, + | protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, + | protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, + ( + | protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.splitCapacityCommitment( + request, + options, + callback + ); + } + mergeCapacityCommitments( + request: protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + ( + | protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest + | undefined + ), + {} | undefined + ] + >; + mergeCapacityCommitments( + request: protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + mergeCapacityCommitments( + request: protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Merges capacity commitments of the same plan into a single commitment. + * + * The resulting capacity commitment has the greater commitment_end_time + * out of the to-be-merged capacity commitments. + * + * Attempting to merge capacity commitments of different plan will fail + * with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Parent resource that identifies admin project and location e.g., + * `projects/myproject/locations/us` + * @param {string[]} request.capacityCommitmentIds + * Ids of capacity commitments to merge. + * These capacity commitments must exist under admin project and location + * specified in the parent. + * ID is the last portion of capacity commitment name e.g., 'abc' for + * projects/myproject/locations/US/capacityCommitments/abc + * @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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + mergeCapacityCommitments( + request: protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + ( + | protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.mergeCapacityCommitments( + request, + options, + callback + ); + } + createAssignment( + request: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment, + ( + | protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest + | undefined + ), + {} | undefined + ] + >; + createAssignment( + request: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createAssignment( + request: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates an assignment object which allows the given project to submit jobs + * of a certain type using slots from the specified reservation. + * + * Currently a + * resource (project, folder, organization) can only have one assignment per + * each (job_type, location) combination, and that reservation will be used + * for all jobs of the matching type. + * + * Different assignments can be created on different levels of the + * projects, folders or organization hierarchy. During query execution, + * the assignment is looked up at the project, folder and organization levels + * in that order. The first assignment found is applied to the query. + * + * When creating assignments, it does not matter if other assignments exist at + * higher levels. + * + * Example: + * + * * The organization `organizationA` contains two projects, `project1` + * and `project2`. + * * Assignments for all three entities (`organizationA`, `project1`, and + * `project2`) could all be created and mapped to the same or different + * reservations. + * + * Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have + * 'bigquery.admin' permissions on the project using the reservation + * and the project that owns this reservation. + * + * Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment + * does not match location of the reservation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name of the assignment + * E.g. `projects/myproject/locations/US/reservations/team1-prod` + * @param {google.cloud.bigquery.reservation.v1.Assignment} request.assignment + * Assignment resource to create. + * @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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createAssignment( + request: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment, + ( + | protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createAssignment(request, options, callback); + } + deleteAssignment( + request: protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest + | undefined + ), + {} | undefined + ] + >; + deleteAssignment( + request: protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteAssignment( + request: protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes a assignment. No expansion will happen. + * + * Example: + * + * * Organization `organizationA` contains two projects, `project1` and + * `project2`. + * * Reservation `res1` exists and was created previously. + * * CreateAssignment was used previously to define the following + * associations between entities and reservations: `` + * and `` + * + * In this example, deletion of the `` assignment won't + * affect the other assignment ``. After said deletion, + * queries from `project1` will still use `res1` while queries from + * `project2` will switch to use on-demand mode. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource, e.g. + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + * @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. + */ + deleteAssignment( + request: protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteAssignment(request, options, callback); + } + moveAssignment( + request: protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment, + ( + | protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest + | undefined + ), + {} | undefined + ] + >; + moveAssignment( + request: protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + moveAssignment( + request: protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Moves an assignment under a new reservation. + * + * This differs from removing an existing assignment and recreating a new one + * by providing a transactional change that ensures an assignee always has an + * associated reservation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the assignment, + * e.g. + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + * @param {string} request.destinationId + * The new reservation ID, e.g.: + * `projects/myotherproject/locations/US/reservations/team2-prod` + * @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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + moveAssignment( + request: protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment, + ( + | protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.moveAssignment(request, options, callback); + } + getBiReservation( + request: protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest + | undefined + ), + {} | undefined + ] + >; + getBiReservation( + request: protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + | protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getBiReservation( + request: protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + | protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Retrieves a BI reservation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the requested reservation, for example: + * `projects/{project_id}/locations/{location_id}/bireservation` + * @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 [BiReservation]{@link google.cloud.bigquery.reservation.v1.BiReservation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getBiReservation( + request: protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + | protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + | protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getBiReservation(request, options, callback); + } + updateBiReservation( + request: protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest + | undefined + ), + {} | undefined + ] + >; + updateBiReservation( + request: protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + | protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateBiReservation( + request: protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + | protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates a BI reservation. + * + * Only fields specified in the `field_mask` are updated. + * + * A singleton BI reservation always exists with default size 0. + * In order to reserve BI capacity it needs to be updated to an amount + * greater than 0. In order to release BI capacity reservation size + * must be set to 0. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.bigquery.reservation.v1.BiReservation} request.biReservation + * A reservation to update. + * @param {google.protobuf.FieldMask} request.updateMask + * A list of fields to be updated in this request. + * @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 [BiReservation]{@link google.cloud.bigquery.reservation.v1.BiReservation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateBiReservation( + request: protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + | protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + | protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest + | 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({ + 'bi_reservation.name': request.biReservation!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateBiReservation(request, options, callback); + } + + listReservations( + request: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IReservation[], + protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest | null, + protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse + ] + >; + listReservations( + request: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IReservation + > + ): void; + listReservations( + request: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IReservation + > + ): void; + /** + * Lists all the reservations for the project in the specified location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name containing project and location, e.g.: + * `projects/myproject/locations/US` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation}. + * 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 [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation} 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 [ListReservationsRequest]{@link google.cloud.bigquery.reservation.v1.ListReservationsRequest} + * 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 + * [ListReservationsResponse]{@link google.cloud.bigquery.reservation.v1.ListReservationsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listReservations( + request: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + optionsOrCallback?: + | gax.CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IReservation + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IReservation + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IReservation[], + protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest | null, + protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse + ] + > | 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.listReservations(request, options, callback); + } + + /** + * Equivalent to {@link listReservations}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listReservations} 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. The parent resource name containing project and location, e.g.: + * `projects/myproject/locations/US` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation} on 'data' event. + */ + listReservationsStream( + request?: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + 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.listReservations.createStream( + this.innerApiCalls.listReservations as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to {@link listReservations}, 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. The parent resource name containing project and location, e.g.: + * `projects/myproject/locations/US` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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. + */ + listReservationsAsync( + request?: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + 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.listReservations.asyncIterate( + this.innerApiCalls['listReservations'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable< + protos.google.cloud.bigquery.reservation.v1.IReservation + >; + } + listCapacityCommitments( + request: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment[], + protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest | null, + protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse + ] + >; + listCapacityCommitments( + request: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment + > + ): void; + listCapacityCommitments( + request: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment + > + ): void; + /** + * Lists all the capacity commitments for the admin project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. + * 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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment} 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 [ListCapacityCommitmentsRequest]{@link google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest} + * 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 + * [ListCapacityCommitmentsResponse]{@link google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listCapacityCommitments( + request: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, + optionsOrCallback?: + | gax.CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment[], + protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest | null, + protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse + ] + > | 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.listCapacityCommitments( + request, + options, + callback + ); + } + + /** + * Equivalent to {@link listCapacityCommitments}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listCapacityCommitments} 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. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment} on 'data' event. + */ + listCapacityCommitmentsStream( + request?: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, + 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.listCapacityCommitments.createStream( + this.innerApiCalls.listCapacityCommitments as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to {@link listCapacityCommitments}, 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. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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. + */ + listCapacityCommitmentsAsync( + request?: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, + options?: gax.CallOptions + ): AsyncIterable< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment + > { + 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.listCapacityCommitments.asyncIterate( + this.innerApiCalls['listCapacityCommitments'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment + >; + } + listAssignments( + request: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment[], + protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest | null, + protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse + ] + >; + listAssignments( + request: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): void; + listAssignments( + request: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): void; + /** + * Lists assignments. + * + * Only explicitly created assignments will be returned. + * + * Example: + * + * * Organization `organizationA` contains two projects, `project1` and + * `project2`. + * * Reservation `res1` exists and was created previously. + * * CreateAssignment was used previously to define the following + * associations between entities and reservations: `` + * and `` + * + * In this example, ListAssignments will just return the above two assignments + * for reservation `res1`, and no expansion/merge will happen. + * + * The wildcard "-" can be used for + * reservations in the request. In that case all assignments belongs to the + * specified project and location will be listed. + * + * **Note** "-" cannot be used for projects nor locations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name e.g.: + * + * `projects/myproject/locations/US/reservations/team1-prod` + * + * Or: + * + * `projects/myproject/locations/US/reservations/-` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. + * 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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment} 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 [ListAssignmentsRequest]{@link google.cloud.bigquery.reservation.v1.ListAssignmentsRequest} + * 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 + * [ListAssignmentsResponse]{@link google.cloud.bigquery.reservation.v1.ListAssignmentsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listAssignments( + request: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + optionsOrCallback?: + | gax.CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment[], + protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest | null, + protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse + ] + > | 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.listAssignments(request, options, callback); + } + + /** + * Equivalent to {@link listAssignments}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listAssignments} 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. The parent resource name e.g.: + * + * `projects/myproject/locations/US/reservations/team1-prod` + * + * Or: + * + * `projects/myproject/locations/US/reservations/-` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment} on 'data' event. + */ + listAssignmentsStream( + request?: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + 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.listAssignments.createStream( + this.innerApiCalls.listAssignments as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to {@link listAssignments}, 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. The parent resource name e.g.: + * + * `projects/myproject/locations/US/reservations/team1-prod` + * + * Or: + * + * `projects/myproject/locations/US/reservations/-` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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. + */ + listAssignmentsAsync( + request?: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + 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.listAssignments.asyncIterate( + this.innerApiCalls['listAssignments'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + searchAssignments( + request: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment[], + protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest | null, + protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse + ] + >; + searchAssignments( + request: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): void; + searchAssignments( + request: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): void; + /** + * Looks up assignments for a specified resource for a particular region. + * If the request is about a project: + * + * 1. Assignments created on the project will be returned if they exist. + * 2. Otherwise assignments created on the closest ancestor will be + * returned. + * 3. Assignments for different JobTypes will all be returned. + * + * The same logic applies if the request is about a folder. + * + * If the request is about an organization, then assignments created on the + * organization will be returned (organization doesn't have ancestors). + * + * Comparing to ListAssignments, there are some behavior + * differences: + * + * 1. permission on the assignee will be verified in this API. + * 2. Hierarchy lookup (project->folder->organization) happens in this API. + * 3. Parent here is `projects/* /locations/*`, instead of + * `projects/* /locations/*reservations/*`. + * + * **Note** "-" cannot be used for projects + * nor locations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the admin project(containing project and location), + * e.g.: + * `projects/myproject/locations/US`. + * @param {string} request.query + * Please specify resource name as assignee in the query. + * + * Examples: + * + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. + * 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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment} 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 [SearchAssignmentsRequest]{@link google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest} + * 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 + * [SearchAssignmentsResponse]{@link google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + searchAssignments( + request: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + optionsOrCallback?: + | gax.CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment[], + protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest | null, + protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse + ] + > | 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.searchAssignments(request, options, callback); + } + + /** + * Equivalent to {@link searchAssignments}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link searchAssignments} 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. The resource name of the admin project(containing project and location), + * e.g.: + * `projects/myproject/locations/US`. + * @param {string} request.query + * Please specify resource name as assignee in the query. + * + * Examples: + * + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment} on 'data' event. + */ + searchAssignmentsStream( + request?: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + 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.searchAssignments.createStream( + this.innerApiCalls.searchAssignments as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to {@link searchAssignments}, 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. The resource name of the admin project(containing project and location), + * e.g.: + * `projects/myproject/locations/US`. + * @param {string} request.query + * Please specify resource name as assignee in the query. + * + * Examples: + * + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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. + */ + searchAssignmentsAsync( + request?: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + 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.searchAssignments.asyncIterate( + this.innerApiCalls['searchAssignments'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified assignment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reservation + * @param {string} assignment + * @returns {string} Resource name string. + */ + assignmentPath( + project: string, + location: string, + reservation: string, + assignment: string + ) { + return this.pathTemplates.assignmentPathTemplate.render({ + project: project, + location: location, + reservation: reservation, + assignment: assignment, + }); + } + + /** + * Parse the project from Assignment resource. + * + * @param {string} assignmentName + * A fully-qualified path representing Assignment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAssignmentName(assignmentName: string) { + return this.pathTemplates.assignmentPathTemplate.match(assignmentName) + .project; + } + + /** + * Parse the location from Assignment resource. + * + * @param {string} assignmentName + * A fully-qualified path representing Assignment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAssignmentName(assignmentName: string) { + return this.pathTemplates.assignmentPathTemplate.match(assignmentName) + .location; + } + + /** + * Parse the reservation from Assignment resource. + * + * @param {string} assignmentName + * A fully-qualified path representing Assignment resource. + * @returns {string} A string representing the reservation. + */ + matchReservationFromAssignmentName(assignmentName: string) { + return this.pathTemplates.assignmentPathTemplate.match(assignmentName) + .reservation; + } + + /** + * Parse the assignment from Assignment resource. + * + * @param {string} assignmentName + * A fully-qualified path representing Assignment resource. + * @returns {string} A string representing the assignment. + */ + matchAssignmentFromAssignmentName(assignmentName: string) { + return this.pathTemplates.assignmentPathTemplate.match(assignmentName) + .assignment; + } + + /** + * Return a fully-qualified biReservation resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + biReservationPath(project: string, location: string) { + return this.pathTemplates.biReservationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from BiReservation resource. + * + * @param {string} biReservationName + * A fully-qualified path representing BiReservation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBiReservationName(biReservationName: string) { + return this.pathTemplates.biReservationPathTemplate.match(biReservationName) + .project; + } + + /** + * Parse the location from BiReservation resource. + * + * @param {string} biReservationName + * A fully-qualified path representing BiReservation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBiReservationName(biReservationName: string) { + return this.pathTemplates.biReservationPathTemplate.match(biReservationName) + .location; + } + + /** + * Return a fully-qualified capacityCommitment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} capacity_commitment + * @returns {string} Resource name string. + */ + capacityCommitmentPath( + project: string, + location: string, + capacityCommitment: string + ) { + return this.pathTemplates.capacityCommitmentPathTemplate.render({ + project: project, + location: location, + capacity_commitment: capacityCommitment, + }); + } + + /** + * Parse the project from CapacityCommitment resource. + * + * @param {string} capacityCommitmentName + * A fully-qualified path representing CapacityCommitment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCapacityCommitmentName(capacityCommitmentName: string) { + return this.pathTemplates.capacityCommitmentPathTemplate.match( + capacityCommitmentName + ).project; + } + + /** + * Parse the location from CapacityCommitment resource. + * + * @param {string} capacityCommitmentName + * A fully-qualified path representing CapacityCommitment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCapacityCommitmentName(capacityCommitmentName: string) { + return this.pathTemplates.capacityCommitmentPathTemplate.match( + capacityCommitmentName + ).location; + } + + /** + * Parse the capacity_commitment from CapacityCommitment resource. + * + * @param {string} capacityCommitmentName + * A fully-qualified path representing CapacityCommitment resource. + * @returns {string} A string representing the capacity_commitment. + */ + matchCapacityCommitmentFromCapacityCommitmentName( + capacityCommitmentName: string + ) { + return this.pathTemplates.capacityCommitmentPathTemplate.match( + capacityCommitmentName + ).capacity_commitment; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified 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 reservation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reservation + * @returns {string} Resource name string. + */ + reservationPath(project: string, location: string, reservation: string) { + return this.pathTemplates.reservationPathTemplate.render({ + project: project, + location: location, + reservation: reservation, + }); + } + + /** + * Parse the project from Reservation resource. + * + * @param {string} reservationName + * A fully-qualified path representing Reservation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReservationName(reservationName: string) { + return this.pathTemplates.reservationPathTemplate.match(reservationName) + .project; + } + + /** + * Parse the location from Reservation resource. + * + * @param {string} reservationName + * A fully-qualified path representing Reservation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReservationName(reservationName: string) { + return this.pathTemplates.reservationPathTemplate.match(reservationName) + .location; + } + + /** + * Parse the reservation from Reservation resource. + * + * @param {string} reservationName + * A fully-qualified path representing Reservation resource. + * @returns {string} A string representing the reservation. + */ + matchReservationFromReservationName(reservationName: string) { + return this.pathTemplates.reservationPathTemplate.match(reservationName) + .reservation; + } + + /** + * 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.reservationServiceStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client_config.json b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client_config.json new file mode 100644 index 00000000000..264bc72f619 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client_config.json @@ -0,0 +1,121 @@ +{ + "interfaces": { + "google.cloud.bigquery.reservation.v1.ReservationService": { + "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": { + "CreateReservation": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListReservations": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetReservation": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteReservation": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateReservation": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateCapacityCommitment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListCapacityCommitments": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetCapacityCommitment": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteCapacityCommitment": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateCapacityCommitment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SplitCapacityCommitment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MergeCapacityCommitments": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateAssignment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListAssignments": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteAssignment": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "SearchAssignments": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "MoveAssignment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetBiReservation": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateBiReservation": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_proto_list.json b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_proto_list.json new file mode 100644 index 00000000000..8746e8df5c9 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/bigquery/reservation/v1/reservation.proto" +] diff --git a/packages/google-cloud-bigquery-reservation/synth.metadata b/packages/google-cloud-bigquery-reservation/synth.metadata new file mode 100644 index 00000000000..0d52cfa8291 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/synth.metadata @@ -0,0 +1,37 @@ +{ + "sources": [ + { + "git": { + "name": ".", + "remote": "git@github.com:googleapis/nodejs-bigquery-reservation.git", + "sha": "606cd4e13daba5128d1ee804c54830341ba2d4e8" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "4f4aa3a03e470f1390758b9d89eb1aa88837a5be", + "internalRef": "320300472" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "bigquery-reservation", + "apiVersion": "v1", + "language": "nodejs", + "generator": "bazel" + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-bigquery-reservation/synth.py b/packages/google-cloud-bigquery-reservation/synth.py index 462e4b6c2d4..ba9341780dc 100644 --- a/packages/google-cloud-bigquery-reservation/synth.py +++ b/packages/google-cloud-bigquery-reservation/synth.py @@ -21,17 +21,13 @@ logging.basicConfig(level=logging.DEBUG) # run the gapic generator -gapic = gcp.GAPICMicrogenerator() +gapic = gcp.GAPICBazel() versions = ['v1'] +name = 'bigquery-reservation' for version in versions: - library = gapic.typescript_library( - 'bigquery-reservation', - generator_args={ - 'package-name': '@google-cloud/bigquery-reservation' - }, - proto_path='/google/cloud/bigquery/reservation/v1', - version=version) -s.copy(library, excludes=[]) + library = gapic.node_library( + name, version, proto_path='google/cloud/bigquery/reservation/v1') +s.copy(library, excludes=['README.md', 'package.json']) # Copy common templates common_templates = gcp.CommonTemplates() diff --git a/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..062b949e3bb --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const reservation = require('@google-cloud/bigquery-reservation'); + +function main() { + const reservationServiceClient = new reservation.ReservationServiceClient(); +} + +main(); diff --git a/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..cd145827e36 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {ReservationServiceClient} from '@google-cloud/bigquery-reservation'; + +function main() { + new ReservationServiceClient(); +} + +main(); diff --git a/packages/google-cloud-bigquery-reservation/system-test/install.ts b/packages/google-cloud-bigquery-reservation/system-test/install.ts new file mode 100644 index 00000000000..4c1ba3eb79a --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('typescript consumer tests', () => { + it('should have correct type signature for typescript users', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); + + it('should have correct type signature for javascript users', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); +}); diff --git a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts new file mode 100644 index 00000000000..fc2f2edda7d --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts @@ -0,0 +1,3557 @@ +// 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 reservationserviceModule 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('v1.ReservationServiceClient', () => { + it('has servicePath', () => { + const servicePath = + reservationserviceModule.v1.ReservationServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + reservationserviceModule.v1.ReservationServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = reservationserviceModule.v1.ReservationServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new reservationserviceModule.v1.ReservationServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.reservationServiceStub, undefined); + await client.initialize(); + assert(client.reservationServiceStub); + }); + + it('has close method', () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new reservationserviceModule.v1.ReservationServiceClient({ + 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 reservationserviceModule.v1.ReservationServiceClient({ + 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('createReservation', () => { + it('invokes createReservation without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateReservationRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ); + client.innerApiCalls.createReservation = stubSimpleCall(expectedResponse); + const [response] = await client.createReservation(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createReservation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createReservation without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateReservationRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ); + client.innerApiCalls.createReservation = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createReservation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.IReservation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createReservation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createReservation with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateReservationRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createReservation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createReservation(request), expectedError); + assert( + (client.innerApiCalls.createReservation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getReservation', () => { + it('invokes getReservation without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetReservationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ); + client.innerApiCalls.getReservation = stubSimpleCall(expectedResponse); + const [response] = await client.getReservation(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getReservation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getReservation without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetReservationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ); + client.innerApiCalls.getReservation = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getReservation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.IReservation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getReservation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getReservation with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetReservationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getReservation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getReservation(request), expectedError); + assert( + (client.innerApiCalls.getReservation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteReservation', () => { + it('invokes deleteReservation without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteReservationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteReservation = stubSimpleCall(expectedResponse); + const [response] = await client.deleteReservation(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteReservation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteReservation without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteReservationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteReservation = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteReservation( + 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.deleteReservation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteReservation with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteReservationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteReservation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteReservation(request), expectedError); + assert( + (client.innerApiCalls.deleteReservation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateReservation', () => { + it('invokes updateReservation without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateReservationRequest() + ); + request.reservation = {}; + request.reservation.name = ''; + const expectedHeaderRequestParams = 'reservation.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ); + client.innerApiCalls.updateReservation = stubSimpleCall(expectedResponse); + const [response] = await client.updateReservation(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateReservation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateReservation without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateReservationRequest() + ); + request.reservation = {}; + request.reservation.name = ''; + const expectedHeaderRequestParams = 'reservation.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ); + client.innerApiCalls.updateReservation = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateReservation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.IReservation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateReservation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateReservation with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateReservationRequest() + ); + request.reservation = {}; + request.reservation.name = ''; + const expectedHeaderRequestParams = 'reservation.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateReservation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateReservation(request), expectedError); + assert( + (client.innerApiCalls.updateReservation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createCapacityCommitment', () => { + it('invokes createCapacityCommitment without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ); + client.innerApiCalls.createCapacityCommitment = stubSimpleCall( + expectedResponse + ); + const [response] = await client.createCapacityCommitment(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createCapacityCommitment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createCapacityCommitment without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ); + client.innerApiCalls.createCapacityCommitment = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createCapacityCommitment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createCapacityCommitment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createCapacityCommitment with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createCapacityCommitment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.createCapacityCommitment(request), + expectedError + ); + assert( + (client.innerApiCalls.createCapacityCommitment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getCapacityCommitment', () => { + it('invokes getCapacityCommitment without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ); + client.innerApiCalls.getCapacityCommitment = stubSimpleCall( + expectedResponse + ); + const [response] = await client.getCapacityCommitment(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getCapacityCommitment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getCapacityCommitment without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ); + client.innerApiCalls.getCapacityCommitment = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getCapacityCommitment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getCapacityCommitment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getCapacityCommitment with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getCapacityCommitment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getCapacityCommitment(request), + expectedError + ); + assert( + (client.innerApiCalls.getCapacityCommitment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteCapacityCommitment', () => { + it('invokes deleteCapacityCommitment without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCapacityCommitment = stubSimpleCall( + expectedResponse + ); + const [response] = await client.deleteCapacityCommitment(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteCapacityCommitment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteCapacityCommitment without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCapacityCommitment = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteCapacityCommitment( + 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.deleteCapacityCommitment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteCapacityCommitment with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCapacityCommitment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteCapacityCommitment(request), + expectedError + ); + assert( + (client.innerApiCalls.deleteCapacityCommitment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateCapacityCommitment', () => { + it('invokes updateCapacityCommitment without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest() + ); + request.capacityCommitment = {}; + request.capacityCommitment.name = ''; + const expectedHeaderRequestParams = 'capacity_commitment.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ); + client.innerApiCalls.updateCapacityCommitment = stubSimpleCall( + expectedResponse + ); + const [response] = await client.updateCapacityCommitment(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateCapacityCommitment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateCapacityCommitment without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest() + ); + request.capacityCommitment = {}; + request.capacityCommitment.name = ''; + const expectedHeaderRequestParams = 'capacity_commitment.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ); + client.innerApiCalls.updateCapacityCommitment = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateCapacityCommitment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateCapacityCommitment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateCapacityCommitment with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest() + ); + request.capacityCommitment = {}; + request.capacityCommitment.name = ''; + const expectedHeaderRequestParams = 'capacity_commitment.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCapacityCommitment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateCapacityCommitment(request), + expectedError + ); + assert( + (client.innerApiCalls.updateCapacityCommitment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('splitCapacityCommitment', () => { + it('invokes splitCapacityCommitment without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse() + ); + client.innerApiCalls.splitCapacityCommitment = stubSimpleCall( + expectedResponse + ); + const [response] = await client.splitCapacityCommitment(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.splitCapacityCommitment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes splitCapacityCommitment without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse() + ); + client.innerApiCalls.splitCapacityCommitment = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.splitCapacityCommitment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.splitCapacityCommitment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes splitCapacityCommitment with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.splitCapacityCommitment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.splitCapacityCommitment(request), + expectedError + ); + assert( + (client.innerApiCalls.splitCapacityCommitment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('mergeCapacityCommitments', () => { + it('invokes mergeCapacityCommitments without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ); + client.innerApiCalls.mergeCapacityCommitments = stubSimpleCall( + expectedResponse + ); + const [response] = await client.mergeCapacityCommitments(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.mergeCapacityCommitments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes mergeCapacityCommitments without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ); + client.innerApiCalls.mergeCapacityCommitments = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.mergeCapacityCommitments( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.mergeCapacityCommitments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes mergeCapacityCommitments with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.mergeCapacityCommitments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.mergeCapacityCommitments(request), + expectedError + ); + assert( + (client.innerApiCalls.mergeCapacityCommitments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createAssignment', () => { + it('invokes createAssignment without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ); + client.innerApiCalls.createAssignment = stubSimpleCall(expectedResponse); + const [response] = await client.createAssignment(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createAssignment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createAssignment without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ); + client.innerApiCalls.createAssignment = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createAssignment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.IAssignment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createAssignment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createAssignment with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createAssignment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createAssignment(request), expectedError); + assert( + (client.innerApiCalls.createAssignment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteAssignment', () => { + it('invokes deleteAssignment without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAssignment = stubSimpleCall(expectedResponse); + const [response] = await client.deleteAssignment(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteAssignment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteAssignment without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAssignment = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteAssignment( + 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.deleteAssignment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteAssignment with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAssignment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteAssignment(request), expectedError); + assert( + (client.innerApiCalls.deleteAssignment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('moveAssignment', () => { + it('invokes moveAssignment without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ); + client.innerApiCalls.moveAssignment = stubSimpleCall(expectedResponse); + const [response] = await client.moveAssignment(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.moveAssignment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes moveAssignment without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ); + client.innerApiCalls.moveAssignment = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.moveAssignment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.IAssignment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.moveAssignment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes moveAssignment with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.moveAssignment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.moveAssignment(request), expectedError); + assert( + (client.innerApiCalls.moveAssignment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getBiReservation', () => { + it('invokes getBiReservation without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetBiReservationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.BiReservation() + ); + client.innerApiCalls.getBiReservation = stubSimpleCall(expectedResponse); + const [response] = await client.getBiReservation(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getBiReservation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getBiReservation without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetBiReservationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.BiReservation() + ); + client.innerApiCalls.getBiReservation = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getBiReservation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.IBiReservation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getBiReservation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getBiReservation with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetBiReservationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getBiReservation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getBiReservation(request), expectedError); + assert( + (client.innerApiCalls.getBiReservation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateBiReservation', () => { + it('invokes updateBiReservation without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest() + ); + request.biReservation = {}; + request.biReservation.name = ''; + const expectedHeaderRequestParams = 'bi_reservation.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.BiReservation() + ); + client.innerApiCalls.updateBiReservation = stubSimpleCall( + expectedResponse + ); + const [response] = await client.updateBiReservation(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateBiReservation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateBiReservation without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest() + ); + request.biReservation = {}; + request.biReservation.name = ''; + const expectedHeaderRequestParams = 'bi_reservation.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.BiReservation() + ); + client.innerApiCalls.updateBiReservation = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateBiReservation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.IBiReservation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateBiReservation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateBiReservation with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest() + ); + request.biReservation = {}; + request.biReservation.name = ''; + const expectedHeaderRequestParams = 'bi_reservation.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBiReservation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateBiReservation(request), expectedError); + assert( + (client.innerApiCalls.updateBiReservation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listReservations', () => { + it('invokes listReservations without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + ]; + client.innerApiCalls.listReservations = stubSimpleCall(expectedResponse); + const [response] = await client.listReservations(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listReservations as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listReservations without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + ]; + client.innerApiCalls.listReservations = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listReservations( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.bigquery.reservation.v1.IReservation[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listReservations as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listReservations with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listReservations = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listReservations(request), expectedError); + assert( + (client.innerApiCalls.listReservations as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listReservationsStream without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + ]; + client.descriptors.page.listReservations.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listReservationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.reservation.v1.Reservation[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.reservation.v1.Reservation + ) => { + 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.listReservations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listReservations, request) + ); + assert.strictEqual( + (client.descriptors.page.listReservations + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listReservationsStream with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listReservations.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listReservationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.reservation.v1.Reservation[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.reservation.v1.Reservation + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listReservations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listReservations, request) + ); + assert.strictEqual( + (client.descriptors.page.listReservations + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listReservations without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Reservation() + ), + ]; + client.descriptors.page.listReservations.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.bigquery.reservation.v1.IReservation[] = []; + const iterable = client.listReservationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listReservations + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listReservations + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listReservations with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listReservations.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listReservationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.reservation.v1.IReservation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listReservations + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listReservations + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('listCapacityCommitments', () => { + it('invokes listCapacityCommitments without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + ]; + client.innerApiCalls.listCapacityCommitments = stubSimpleCall( + expectedResponse + ); + const [response] = await client.listCapacityCommitments(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listCapacityCommitments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listCapacityCommitments without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + ]; + client.innerApiCalls.listCapacityCommitments = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listCapacityCommitments( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listCapacityCommitments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listCapacityCommitments with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listCapacityCommitments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listCapacityCommitments(request), + expectedError + ); + assert( + (client.innerApiCalls.listCapacityCommitments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listCapacityCommitmentsStream without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + ]; + client.descriptors.page.listCapacityCommitments.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listCapacityCommitmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.reservation.v1.CapacityCommitment[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.reservation.v1.CapacityCommitment + ) => { + 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.listCapacityCommitments + .createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCapacityCommitments, request) + ); + assert.strictEqual( + (client.descriptors.page.listCapacityCommitments + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listCapacityCommitmentsStream with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listCapacityCommitments.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listCapacityCommitmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.reservation.v1.CapacityCommitment[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.reservation.v1.CapacityCommitment + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listCapacityCommitments + .createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCapacityCommitments, request) + ); + assert.strictEqual( + (client.descriptors.page.listCapacityCommitments + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listCapacityCommitments without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() + ), + ]; + client.descriptors.page.listCapacityCommitments.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment[] = []; + const iterable = client.listCapacityCommitmentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listCapacityCommitments + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listCapacityCommitments + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listCapacityCommitments with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listCapacityCommitments.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listCapacityCommitmentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listCapacityCommitments + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listCapacityCommitments + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('listAssignments', () => { + it('invokes listAssignments without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.innerApiCalls.listAssignments = stubSimpleCall(expectedResponse); + const [response] = await client.listAssignments(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAssignments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAssignments without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.innerApiCalls.listAssignments = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listAssignments( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.bigquery.reservation.v1.IAssignment[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAssignments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listAssignments with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listAssignments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listAssignments(request), expectedError); + assert( + (client.innerApiCalls.listAssignments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAssignmentsStream without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.descriptors.page.listAssignments.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listAssignmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.reservation.v1.Assignment[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.reservation.v1.Assignment + ) => { + 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.listAssignments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssignments, request) + ); + assert.strictEqual( + (client.descriptors.page.listAssignments + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listAssignmentsStream with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAssignments.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listAssignmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.reservation.v1.Assignment[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.reservation.v1.Assignment + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAssignments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAssignments, request) + ); + assert.strictEqual( + (client.descriptors.page.listAssignments + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAssignments without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.descriptors.page.listAssignments.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.bigquery.reservation.v1.IAssignment[] = []; + const iterable = client.listAssignmentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAssignments + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listAssignments + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAssignments with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAssignments.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAssignmentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.reservation.v1.IAssignment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAssignments + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listAssignments + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('searchAssignments', () => { + it('invokes searchAssignments without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.innerApiCalls.searchAssignments = stubSimpleCall(expectedResponse); + const [response] = await client.searchAssignments(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.searchAssignments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes searchAssignments without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.innerApiCalls.searchAssignments = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.searchAssignments( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.bigquery.reservation.v1.IAssignment[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.searchAssignments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes searchAssignments with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.searchAssignments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.searchAssignments(request), expectedError); + assert( + (client.innerApiCalls.searchAssignments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes searchAssignmentsStream without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.descriptors.page.searchAssignments.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.searchAssignmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.reservation.v1.Assignment[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.reservation.v1.Assignment + ) => { + 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.searchAssignments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchAssignments, request) + ); + assert.strictEqual( + (client.descriptors.page.searchAssignments + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes searchAssignmentsStream with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.searchAssignments.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.searchAssignmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.reservation.v1.Assignment[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.reservation.v1.Assignment + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.searchAssignments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchAssignments, request) + ); + assert.strictEqual( + (client.descriptors.page.searchAssignments + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchAssignments without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.descriptors.page.searchAssignments.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.bigquery.reservation.v1.IAssignment[] = []; + const iterable = client.searchAssignmentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchAssignments + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.searchAssignments + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchAssignments with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.searchAssignments.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.searchAssignmentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.reservation.v1.IAssignment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchAssignments + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.searchAssignments + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('assignment', () => { + const fakePath = '/rendered/path/assignment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reservation: 'reservationValue', + assignment: 'assignmentValue', + }; + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.assignmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.assignmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('assignmentPath', () => { + const result = client.assignmentPath( + 'projectValue', + 'locationValue', + 'reservationValue', + 'assignmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.assignmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAssignmentName', () => { + const result = client.matchProjectFromAssignmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.assignmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAssignmentName', () => { + const result = client.matchLocationFromAssignmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.assignmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReservationFromAssignmentName', () => { + const result = client.matchReservationFromAssignmentName(fakePath); + assert.strictEqual(result, 'reservationValue'); + assert( + (client.pathTemplates.assignmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAssignmentFromAssignmentName', () => { + const result = client.matchAssignmentFromAssignmentName(fakePath); + assert.strictEqual(result, 'assignmentValue'); + assert( + (client.pathTemplates.assignmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('biReservation', () => { + const fakePath = '/rendered/path/biReservation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.biReservationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.biReservationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('biReservationPath', () => { + const result = client.biReservationPath( + 'projectValue', + 'locationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.biReservationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBiReservationName', () => { + const result = client.matchProjectFromBiReservationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.biReservationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBiReservationName', () => { + const result = client.matchLocationFromBiReservationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.biReservationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('capacityCommitment', () => { + const fakePath = '/rendered/path/capacityCommitment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + capacity_commitment: 'capacityCommitmentValue', + }; + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.capacityCommitmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.capacityCommitmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('capacityCommitmentPath', () => { + const result = client.capacityCommitmentPath( + 'projectValue', + 'locationValue', + 'capacityCommitmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.capacityCommitmentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCapacityCommitmentName', () => { + const result = client.matchProjectFromCapacityCommitmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.capacityCommitmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCapacityCommitmentName', () => { + const result = client.matchLocationFromCapacityCommitmentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.capacityCommitmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCapacityCommitmentFromCapacityCommitmentName', () => { + const result = client.matchCapacityCommitmentFromCapacityCommitmentName( + fakePath + ); + assert.strictEqual(result, 'capacityCommitmentValue'); + assert( + (client.pathTemplates.capacityCommitmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new reservationserviceModule.v1.ReservationServiceClient({ + 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('reservation', () => { + const fakePath = '/rendered/path/reservation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reservation: 'reservationValue', + }; + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reservationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reservationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reservationPath', () => { + const result = client.reservationPath( + 'projectValue', + 'locationValue', + 'reservationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reservationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReservationName', () => { + const result = client.matchProjectFromReservationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reservationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReservationName', () => { + const result = client.matchLocationFromReservationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reservationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReservationFromReservationName', () => { + const result = client.matchReservationFromReservationName(fakePath); + assert.strictEqual(result, 'reservationValue'); + assert( + (client.pathTemplates.reservationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-bigquery-reservation/tsconfig.json b/packages/google-cloud-bigquery-reservation/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-bigquery-reservation/webpack.config.js b/packages/google-cloud-bigquery-reservation/webpack.config.js new file mode 100644 index 00000000000..eb09bada2de --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'ReservationService', + filename: './reservation-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader', + }, + ], + }, + mode: 'production', +}; From d694e0de0cc349c4f4482af6428ff97c2eb07134 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 14 Jul 2020 13:44:55 -0700 Subject: [PATCH 003/105] chore: release 1.0.0 (#3) * created 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-bigquery-reservation/CHANGELOG.md | 8 ++++++++ packages/google-cloud-bigquery-reservation/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-bigquery-reservation/CHANGELOG.md diff --git a/packages/google-cloud-bigquery-reservation/CHANGELOG.md b/packages/google-cloud-bigquery-reservation/CHANGELOG.md new file mode 100644 index 00000000000..2658d7aa26e --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +## 1.0.0 (2020-07-14) + + +### Features + +* generate v1 of the API ([#2](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/2)) ([e368d52](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/e368d5289c8c18b974a6e470320e0c23f2772dcd)) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 219b85c72cd..025f0024f1f 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-reservation", - "version": "0.1.0", + "version": "1.0.0", "description": "BigQuery Reservation client for Node.js", "repository": "googleapis/nodejs-bigquery-reservation", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-reservation/samples/package.json b/packages/google-cloud-bigquery-reservation/samples/package.json index 7ea0c72973f..250d987886b 100644 --- a/packages/google-cloud-bigquery-reservation/samples/package.json +++ b/packages/google-cloud-bigquery-reservation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-reservation": "^0.1.0" + "@google-cloud/bigquery-reservation": "^1.0.0" }, "devDependencies": { "c8": "^7.1.0", From 98167ac3ae6f15f4cc093fe9c45f30bf0114dca3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 15 Jul 2020 03:51:06 +0200 Subject: [PATCH 004/105] chore(deps): update dependency mocha to v8 (#4) --- packages/google-cloud-bigquery-reservation/package.json | 2 +- packages/google-cloud-bigquery-reservation/samples/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 025f0024f1f..b4e43f01829 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -42,7 +42,7 @@ "google-gax": "^2.6.2" }, "devDependencies": { - "@types/mocha": "^7.0.2", + "@types/mocha": "^8.0.0", "@types/node": "^14.0.19", "@types/sinon": "^9.0.4", "c8": "^7.2.0", diff --git a/packages/google-cloud-bigquery-reservation/samples/package.json b/packages/google-cloud-bigquery-reservation/samples/package.json index 250d987886b..a7822ac4517 100644 --- a/packages/google-cloud-bigquery-reservation/samples/package.json +++ b/packages/google-cloud-bigquery-reservation/samples/package.json @@ -18,6 +18,6 @@ "devDependencies": { "c8": "^7.1.0", "chai": "^4.2.0", - "mocha": "^7.1.0" + "mocha": "^8.0.0" } } From 6aab1fb054f49ff8193a4f5398e453d2d5e8a846 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Tue, 21 Jul 2020 14:46:37 -0400 Subject: [PATCH 005/105] chore: add dev dependencies for cloud-rad ref docs (#8) --- packages/google-cloud-bigquery-reservation/package.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index b4e43f01829..c2d3091b147 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -36,7 +36,9 @@ "prepare": "npm run compile-protos && npm run compile", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" + "test": "c8 mocha build/test", + "api-extractor": "api-extractor run --local", + "api-documenter": "api-documenter yaml --input-folder=temp" }, "dependencies": { "google-gax": "^2.6.2" @@ -58,7 +60,9 @@ "ts-loader": "^7.0.5", "typescript": "^3.9.6", "webpack": "^4.43.0", - "webpack-cli": "^3.3.12" + "webpack-cli": "^3.3.12", + "@microsoft/api-documenter": "^7.8.10", + "@microsoft/api-extractor": "^7.8.10" }, "engines": { "node": ">=10.0.0" From faf9e8ecc8eb11f1c12bb432c54a6650a872e629 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 22 Jul 2020 18:18:13 +0200 Subject: [PATCH 006/105] chore(deps): update dependency ts-loader to v8 (#5) --- packages/google-cloud-bigquery-reservation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index c2d3091b147..e05c80d851e 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -57,7 +57,7 @@ "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.2", - "ts-loader": "^7.0.5", + "ts-loader": "^8.0.0", "typescript": "^3.9.6", "webpack": "^4.43.0", "webpack-cli": "^3.3.12", From e9166253a7f3878770b7359d39b7e3c4d2ddcd74 Mon Sep 17 00:00:00 2001 From: Steffany Brown <30247553+steffnay@users.noreply.github.com> Date: Thu, 10 Sep 2020 15:16:05 -0700 Subject: [PATCH 007/105] build: use the latest build and docs config (#13) --- .../.gitattributes | 1 + .../README.md | 3 + .../api-extractor.json | 369 ++++++++++++++++++ .../linkinator.config.json | 7 +- .../bigquery/reservation/v1/reservation.proto | 1 + .../protos/protos.d.ts | 2 +- .../protos/protos.js | 2 +- .../protos/protos.json | 3 +- .../src/v1/reservation_service_client.ts | 5 +- .../synth.metadata | 10 +- 10 files changed, 388 insertions(+), 15 deletions(-) create mode 100644 packages/google-cloud-bigquery-reservation/api-extractor.json diff --git a/packages/google-cloud-bigquery-reservation/.gitattributes b/packages/google-cloud-bigquery-reservation/.gitattributes index d4f4169b28b..33739cb74e4 100644 --- a/packages/google-cloud-bigquery-reservation/.gitattributes +++ b/packages/google-cloud-bigquery-reservation/.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-bigquery-reservation/README.md b/packages/google-cloud-bigquery-reservation/README.md index f2ca0e63228..3f75b8488a8 100644 --- a/packages/google-cloud-bigquery-reservation/README.md +++ b/packages/google-cloud-bigquery-reservation/README.md @@ -14,6 +14,9 @@ BigQuery Reservation client for Node.js +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-bigquery-reservation/blob/master/CHANGELOG.md). + * [Google BigQuery Reservation Node.js Client API Reference][client-docs] * [Google BigQuery Reservation Documentation][product-docs] * [github.com/googleapis/nodejs-bigquery-reservation](https://github.com/googleapis/nodejs-bigquery-reservation) diff --git a/packages/google-cloud-bigquery-reservation/api-extractor.json b/packages/google-cloud-bigquery-reservation/api-extractor.json new file mode 100644 index 00000000000..de228294b23 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/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-bigquery-reservation/linkinator.config.json b/packages/google-cloud-bigquery-reservation/linkinator.config.json index 6049287911d..29a223b6db6 100644 --- a/packages/google-cloud-bigquery-reservation/linkinator.config.json +++ b/packages/google-cloud-bigquery-reservation/linkinator.config.json @@ -1,10 +1,9 @@ { "recurse": true, "skip": [ - "img.shields.io", - "https://googleapis.dev/nodejs/bigqueryreservation/latest", - "https://github.com/googleapis/nodejs-bigquery-reservation/tree/master/samples", - "https://github.com/googleapis/nodejs-bigquery-reservation/blob/master/samples/quickstart.js" + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io" ], "silent": true, "concurrency": 10 diff --git a/packages/google-cloud-bigquery-reservation/protos/google/cloud/bigquery/reservation/v1/reservation.proto b/packages/google-cloud-bigquery-reservation/protos/google/cloud/bigquery/reservation/v1/reservation.proto index 62a237f2b6e..4b90ffdda5f 100644 --- a/packages/google-cloud-bigquery-reservation/protos/google/cloud/bigquery/reservation/v1/reservation.proto +++ b/packages/google-cloud-bigquery-reservation/protos/google/cloud/bigquery/reservation/v1/reservation.proto @@ -30,6 +30,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/reserv option java_multiple_files = true; option java_outer_classname = "ReservationProto"; option java_package = "com.google.cloud.bigquery.reservation.v1"; +option php_namespace = "Google\\Cloud\\BigQuery\\Reservation\\V1"; // This API allows users to manage their flat-rate BigQuery reservations. // diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts b/packages/google-cloud-bigquery-reservation/protos/protos.d.ts index 34412490242..89dc441b169 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-reservation/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-bigquery-reservation/protos/protos.js b/packages/google-cloud-bigquery-reservation/protos/protos.js index 8b4c41c88a8..32613fd460f 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.js +++ b/packages/google-cloud-bigquery-reservation/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-bigquery-reservation/protos/protos.json b/packages/google-cloud-bigquery-reservation/protos/protos.json index 03658be52da..0348b51b845 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.json +++ b/packages/google-cloud-bigquery-reservation/protos/protos.json @@ -14,7 +14,8 @@ "go_package": "google.golang.org/genproto/googleapis/cloud/bigquery/reservation/v1;reservation", "java_multiple_files": true, "java_outer_classname": "ReservationProto", - "java_package": "com.google.cloud.bigquery.reservation.v1" + "java_package": "com.google.cloud.bigquery.reservation.v1", + "php_namespace": "Google\\Cloud\\BigQuery\\Reservation\\V1" }, "nested": { "ReservationService": { diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index b91d3ed00fd..90c65428c35 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts @@ -301,12 +301,11 @@ export class ReservationServiceClient { } ); + 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-bigquery-reservation/synth.metadata b/packages/google-cloud-bigquery-reservation/synth.metadata index 0d52cfa8291..ac4ae294220 100644 --- a/packages/google-cloud-bigquery-reservation/synth.metadata +++ b/packages/google-cloud-bigquery-reservation/synth.metadata @@ -3,23 +3,23 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-bigquery-reservation.git", - "sha": "606cd4e13daba5128d1ee804c54830341ba2d4e8" + "remote": "git@github.com:steffnay/nodejs-bigquery-reservation.git", + "sha": "7e6f1eb22e70d722bd302de9b92087006eece07c" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "4f4aa3a03e470f1390758b9d89eb1aa88837a5be", - "internalRef": "320300472" + "sha": "3257ba52160dd8a9c7f83c34d13793de843bdb4a", + "internalRef": "330974505" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b" + "sha": "b15c0c042cdea746fc19856527d8baf947c3c220" } } ], From c40369413fa0adad90e5b3af9374d7795db2d488 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 11 Sep 2020 14:28:32 -0700 Subject: [PATCH 008/105] chore: start tracking obsolete files (#14) --- .../synth.metadata | 78 ++++++++++++++++++- 1 file changed, 74 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/synth.metadata b/packages/google-cloud-bigquery-reservation/synth.metadata index ac4ae294220..99b3472f367 100644 --- a/packages/google-cloud-bigquery-reservation/synth.metadata +++ b/packages/google-cloud-bigquery-reservation/synth.metadata @@ -3,16 +3,16 @@ { "git": { "name": ".", - "remote": "git@github.com:steffnay/nodejs-bigquery-reservation.git", - "sha": "7e6f1eb22e70d722bd302de9b92087006eece07c" + "remote": "https://github.com/googleapis/nodejs-bigquery-reservation.git", + "sha": "0069feaaa5b865721378b7a3a85e8314432ae829" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "3257ba52160dd8a9c7f83c34d13793de843bdb4a", - "internalRef": "330974505" + "sha": "b821f320473c8ec05a1c7fb9a496c958b1ab9834", + "internalRef": "331104099" } }, { @@ -33,5 +33,75 @@ "generator": "bazel" } } + ], + "generatedFiles": [ + ".eslintignore", + ".eslintrc.json", + ".gitattributes", + ".github/ISSUE_TEMPLATE/bug_report.md", + ".github/ISSUE_TEMPLATE/feature_request.md", + ".github/ISSUE_TEMPLATE/support_request.md", + ".github/PULL_REQUEST_TEMPLATE.md", + ".github/release-please.yml", + ".github/workflows/ci.yaml", + ".gitignore", + ".jsdoc.js", + ".kokoro/.gitattributes", + ".kokoro/common.cfg", + ".kokoro/continuous/node10/common.cfg", + ".kokoro/continuous/node10/docs.cfg", + ".kokoro/continuous/node10/test.cfg", + ".kokoro/continuous/node12/common.cfg", + ".kokoro/continuous/node12/lint.cfg", + ".kokoro/continuous/node12/samples-test.cfg", + ".kokoro/continuous/node12/system-test.cfg", + ".kokoro/continuous/node12/test.cfg", + ".kokoro/docs.sh", + ".kokoro/lint.sh", + ".kokoro/populate-secrets.sh", + ".kokoro/presubmit/node10/common.cfg", + ".kokoro/presubmit/node12/common.cfg", + ".kokoro/presubmit/node12/samples-test.cfg", + ".kokoro/presubmit/node12/system-test.cfg", + ".kokoro/presubmit/node12/test.cfg", + ".kokoro/publish.sh", + ".kokoro/release/docs-devsite.cfg", + ".kokoro/release/docs-devsite.sh", + ".kokoro/release/docs.cfg", + ".kokoro/release/docs.sh", + ".kokoro/release/publish.cfg", + ".kokoro/samples-test.sh", + ".kokoro/system-test.sh", + ".kokoro/test.bat", + ".kokoro/test.sh", + ".kokoro/trampoline.sh", + ".mocharc.js", + ".nycrc", + ".prettierignore", + ".prettierrc.js", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "README.md", + "api-extractor.json", + "linkinator.config.json", + "package-lock.json.628483412", + "protos/google/cloud/bigquery/reservation/v1/reservation.proto", + "protos/protos.d.ts", + "protos/protos.js", + "protos/protos.json", + "renovate.json", + "samples/README.md", + "src/index.ts", + "src/v1/index.ts", + "src/v1/reservation_service_client.ts", + "src/v1/reservation_service_client_config.json", + "src/v1/reservation_service_proto_list.json", + "system-test/fixtures/sample/src/index.js", + "system-test/fixtures/sample/src/index.ts", + "system-test/install.ts", + "test/gapic_reservation_service_v1.ts", + "tsconfig.json", + "webpack.config.js" ] } \ No newline at end of file From 587a0a12b1bfffd3745ec86bb81589e0362fac30 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 12 Sep 2020 14:06:27 -0700 Subject: [PATCH 009/105] build(test): recursively find test files; fail on unsupported dependency versions (#15) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/4ed21f23-f327-48f6-8054-258670f2c8a0/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/fdd03c161003ab97657cc0218f25c82c89ddf4b6 --- packages/google-cloud-bigquery-reservation/.mocharc.js | 3 ++- packages/google-cloud-bigquery-reservation/synth.metadata | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/.mocharc.js b/packages/google-cloud-bigquery-reservation/.mocharc.js index ff7b34fa5d1..0b600509bed 100644 --- a/packages/google-cloud-bigquery-reservation/.mocharc.js +++ b/packages/google-cloud-bigquery-reservation/.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-bigquery-reservation/synth.metadata b/packages/google-cloud-bigquery-reservation/synth.metadata index 99b3472f367..f7a86ffeba2 100644 --- a/packages/google-cloud-bigquery-reservation/synth.metadata +++ b/packages/google-cloud-bigquery-reservation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-reservation.git", - "sha": "0069feaaa5b865721378b7a3a85e8314432ae829" + "sha": "9072f0898a34637a8ad287e974f0f9233e66b86c" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "b15c0c042cdea746fc19856527d8baf947c3c220" + "sha": "fdd03c161003ab97657cc0218f25c82c89ddf4b6" } } ], @@ -85,7 +85,6 @@ "README.md", "api-extractor.json", "linkinator.config.json", - "package-lock.json.628483412", "protos/google/cloud/bigquery/reservation/v1/reservation.proto", "protos/protos.d.ts", "protos/protos.js", From aaa62edd61a6b075bd4492bd81f6183ebfe7f5cf Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 1 Oct 2020 04:42:21 -0700 Subject: [PATCH 010/105] chore: update bucket for cloud-rad (#17) 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-bigquery-reservation/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/synth.metadata b/packages/google-cloud-bigquery-reservation/synth.metadata index f7a86ffeba2..7db3c180109 100644 --- a/packages/google-cloud-bigquery-reservation/synth.metadata +++ b/packages/google-cloud-bigquery-reservation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-reservation.git", - "sha": "9072f0898a34637a8ad287e974f0f9233e66b86c" + "sha": "e90e40ab367c66f99206a95bcd7e4ce249ce6b2a" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "fdd03c161003ab97657cc0218f25c82c89ddf4b6" + "sha": "079dcce498117f9570cebe6e6cff254b38ba3860" } } ], From ddae23594abce8986766b4a1447a2104b36a05d8 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 5 Oct 2020 10:42:28 -0700 Subject: [PATCH 011/105] build(node_library): migrate to Trampoline V2 (#18) 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-bigquery-reservation/synth.metadata | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/synth.metadata b/packages/google-cloud-bigquery-reservation/synth.metadata index 7db3c180109..1331b8d9a3f 100644 --- a/packages/google-cloud-bigquery-reservation/synth.metadata +++ b/packages/google-cloud-bigquery-reservation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-reservation.git", - "sha": "e90e40ab367c66f99206a95bcd7e4ce249ce6b2a" + "sha": "d9e11b4ad3897c592b4c66eac3f59d51f6d40bc0" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "079dcce498117f9570cebe6e6cff254b38ba3860" + "sha": "0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9" } } ], @@ -75,10 +75,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 cd9c8f1dba0b16b4eba92bdd09c8624df3730c7b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 12 Oct 2020 21:54:40 +0200 Subject: [PATCH 012/105] chore(deps): update dependency webpack-cli to v4 (#21) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [webpack-cli](https://togithub.com/webpack/webpack-cli) | devDependencies | major | [`^3.3.12` -> `^4.0.0`](https://renovatebot.com/diffs/npm/webpack-cli/3.3.12/4.0.0) | --- ### Release Notes
webpack/webpack-cli ### [`v4.0.0`](https://togithub.com/webpack/webpack-cli/blob/master/CHANGELOG.md#​400-httpsgithubcomwebpackwebpack-clicomparewebpack-cli400-rc1webpack-cli400-2020-10-10) [Compare Source](https://togithub.com/webpack/webpack-cli/compare/v3.3.12...webpack-cli@4.0.0) ##### Bug Fixes - add compilation lifecycle in watch instance ([#​1903](https://togithub.com/webpack/webpack-cli/issues/1903)) ([02b6d21](https://togithub.com/webpack/webpack-cli/commit/02b6d21eaa20166a7ed37816de716b8fc22b756a)) - cleanup `package-utils` package ([#​1822](https://togithub.com/webpack/webpack-cli/issues/1822)) ([fd5b92b](https://togithub.com/webpack/webpack-cli/commit/fd5b92b3cd40361daec5bf4486e455a41f4c9738)) - cli-executer supplies args further up ([#​1904](https://togithub.com/webpack/webpack-cli/issues/1904)) ([097564a](https://togithub.com/webpack/webpack-cli/commit/097564a851b36b63e0a6bf88144997ef65aa057a)) - exit code for validation errors ([59f6303](https://togithub.com/webpack/webpack-cli/commit/59f63037fcbdbb8934b578b9adf5725bc4ae1235)) - exit process in case of schema errors ([71e89b4](https://togithub.com/webpack/webpack-cli/commit/71e89b4092d953ea587cc4f606451ab78cbcdb93)) ##### Features - assign config paths in build dependencies in cache config ([#​1900](https://togithub.com/webpack/webpack-cli/issues/1900)) ([7e90f11](https://togithub.com/webpack/webpack-cli/commit/7e90f110b119f36ef9def4f66cf4e17ccf1438cd))
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-bigquery-reservation). --- packages/google-cloud-bigquery-reservation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index e05c80d851e..7467743370c 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -60,7 +60,7 @@ "ts-loader": "^8.0.0", "typescript": "^3.9.6", "webpack": "^4.43.0", - "webpack-cli": "^3.3.12", + "webpack-cli": "^4.0.0", "@microsoft/api-documenter": "^7.8.10", "@microsoft/api-extractor": "^7.8.10" }, From d6dd316bf560cca6755ef928453e9c183bdce3cc Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 14 Oct 2020 23:04:14 +0200 Subject: [PATCH 013/105] chore(deps): update dependency webpack to v5 (#20) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [webpack](https://togithub.com/webpack/webpack) | devDependencies | major | [`^4.43.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-bigquery-reservation). --- packages/google-cloud-bigquery-reservation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 7467743370c..46d8302fd2e 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -59,7 +59,7 @@ "sinon": "^9.0.2", "ts-loader": "^8.0.0", "typescript": "^3.9.6", - "webpack": "^4.43.0", + "webpack": "^5.0.0", "webpack-cli": "^4.0.0", "@microsoft/api-documenter": "^7.8.10", "@microsoft/api-extractor": "^7.8.10" From 2a08da772ddbdcbc1f3ad4f942f91ff952db5588 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 16 Oct 2020 09:06:18 -0700 Subject: [PATCH 014/105] build: only check --engine-strict for production deps (#22) 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-bigquery-reservation/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/synth.metadata b/packages/google-cloud-bigquery-reservation/synth.metadata index 1331b8d9a3f..b628e0f4d0e 100644 --- a/packages/google-cloud-bigquery-reservation/synth.metadata +++ b/packages/google-cloud-bigquery-reservation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-reservation.git", - "sha": "d9e11b4ad3897c592b4c66eac3f59d51f6d40bc0" + "sha": "28be4884f768df61d92bf0956dca0a697d9d7487" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9" + "sha": "5451633881133e5573cc271a18e73b18caca8b1b" } } ], From 35ba3d57e2b827b486e9857fb63b1cf6bd97f179 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 21 Oct 2020 16:16:20 -0700 Subject: [PATCH 015/105] chore: clean up Node.js TOC for cloud-rad (#23) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/5f7bb900-b4ec-41d2-acea-c5c2f5dfb4fa/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/901ddd44e9ef7887ee681b9183bbdea99437fdcc Source-Link: https://github.com/googleapis/synthtool/commit/f96d3b455fe27c3dc7bc37c3c9cd27b1c6d269c8 --- packages/google-cloud-bigquery-reservation/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/synth.metadata b/packages/google-cloud-bigquery-reservation/synth.metadata index b628e0f4d0e..4dcdc8841f2 100644 --- a/packages/google-cloud-bigquery-reservation/synth.metadata +++ b/packages/google-cloud-bigquery-reservation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-reservation.git", - "sha": "28be4884f768df61d92bf0956dca0a697d9d7487" + "sha": "54bd9fced8eb244afc54789dfb6e0f38a1526a32" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5451633881133e5573cc271a18e73b18caca8b1b" + "sha": "901ddd44e9ef7887ee681b9183bbdea99437fdcc" } } ], From d8c439156bd6afb7afe60a266bd751410b80348d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 27 Oct 2020 11:12:14 -0700 Subject: [PATCH 016/105] docs: updated code of conduct (includes update to actions) (#26) 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 --- .../CODE_OF_CONDUCT.md | 123 +++++++++++++----- .../synth.metadata | 4 +- 2 files changed, 89 insertions(+), 38 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/CODE_OF_CONDUCT.md b/packages/google-cloud-bigquery-reservation/CODE_OF_CONDUCT.md index 46b2a08ea6d..2add2547a81 100644 --- a/packages/google-cloud-bigquery-reservation/CODE_OF_CONDUCT.md +++ b/packages/google-cloud-bigquery-reservation/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-bigquery-reservation/synth.metadata b/packages/google-cloud-bigquery-reservation/synth.metadata index 4dcdc8841f2..65ca07945ea 100644 --- a/packages/google-cloud-bigquery-reservation/synth.metadata +++ b/packages/google-cloud-bigquery-reservation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-reservation.git", - "sha": "54bd9fced8eb244afc54789dfb6e0f38a1526a32" + "sha": "1673874458e86c527ecf68d94e28ef4c6c967278" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "901ddd44e9ef7887ee681b9183bbdea99437fdcc" + "sha": "89c849ba5013e45e8fb688b138f33c2ec6083dc5" } } ], From 89380fb14dd2cea20e54eb867d2b51328970be5c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 2 Nov 2020 15:58:45 -0800 Subject: [PATCH 017/105] build(node): add KOKORO_BUILD_ARTIFACTS_SUBDIR to env (#27) 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-bigquery-reservation/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/synth.metadata b/packages/google-cloud-bigquery-reservation/synth.metadata index 65ca07945ea..c6ee9247c61 100644 --- a/packages/google-cloud-bigquery-reservation/synth.metadata +++ b/packages/google-cloud-bigquery-reservation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-reservation.git", - "sha": "1673874458e86c527ecf68d94e28ef4c6c967278" + "sha": "8a0675517b35102a2b385b936085956465e6d953" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "89c849ba5013e45e8fb688b138f33c2ec6083dc5" + "sha": "ba9918cd22874245b55734f57470c719b577e591" } } ], From 9235c15cd423a7f07bfc2e10401f52d832dafc73 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Fri, 6 Nov 2020 15:42:36 -0800 Subject: [PATCH 018/105] fix: do not modify options object, use defaultScopes (#28) Regenerated the library using [gapic-generator-typescript](https://github.com/googleapis/gapic-generator-typescript) v1.2.1. --- .../package.json | 2 +- .../src/index.ts | 1 + .../src/v1/reservation_service_client.ts | 384 ++++++++++-------- .../synth.metadata | 15 +- .../system-test/fixtures/sample/src/index.ts | 9 +- .../system-test/install.ts | 18 +- 6 files changed, 248 insertions(+), 181 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 46d8302fd2e..99feec837da 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -41,7 +41,7 @@ "api-documenter": "api-documenter yaml --input-folder=temp" }, "dependencies": { - "google-gax": "^2.6.2" + "google-gax": "^2.9.2" }, "devDependencies": { "@types/mocha": "^8.0.0", diff --git a/packages/google-cloud-bigquery-reservation/src/index.ts b/packages/google-cloud-bigquery-reservation/src/index.ts index 929f8dca0fc..1ef6db0cc82 100644 --- a/packages/google-cloud-bigquery-reservation/src/index.ts +++ b/packages/google-cloud-bigquery-reservation/src/index.ts @@ -18,6 +18,7 @@ import * as v1 from './v1'; const ReservationServiceClient = v1.ReservationServiceClient; +type ReservationServiceClient = v1.ReservationServiceClient; export {v1, ReservationServiceClient}; export default {v1, ReservationServiceClient}; import * as protos from '../protos/protos'; diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index 90c65428c35..f94e4e77bb8 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts @@ -74,8 +74,10 @@ export class ReservationServiceClient { /** * Construct an instance of ReservationServiceClient. * - * @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] @@ -95,42 +97,33 @@ export class ReservationServiceClient { * 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 ReservationServiceClient; 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 ReservationServiceClient 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 ReservationServiceClient).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. @@ -139,6 +132,11 @@ export class ReservationServiceClient { // 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) { @@ -316,6 +314,7 @@ export class ReservationServiceClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'bigqueryreservation.googleapis.com'; @@ -324,6 +323,7 @@ export class ReservationServiceClient { /** * 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 'bigqueryreservation.googleapis.com'; @@ -331,6 +331,7 @@ export class ReservationServiceClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -339,6 +340,7 @@ export class ReservationServiceClient { /** * The scopes needed to make gRPC calls for every method defined * in this service. + * @returns {string[]} List of default scopes. */ static get scopes() { return [ @@ -351,8 +353,7 @@ export class ReservationServiceClient { 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 @@ -418,7 +419,11 @@ export class ReservationServiceClient { * 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 [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation}. - * 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.createReservation(request); */ createReservation( request: protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest, @@ -513,7 +518,11 @@ export class ReservationServiceClient { * 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 [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation}. - * 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.getReservation(request); */ getReservation( request: protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest, @@ -610,7 +619,11 @@ export class ReservationServiceClient { * 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.deleteReservation(request); */ deleteReservation( request: protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, @@ -706,7 +719,11 @@ export class ReservationServiceClient { * 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 [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation}. - * 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.updateReservation(request); */ updateReservation( request: protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, @@ -806,7 +823,11 @@ export class ReservationServiceClient { * 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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. - * 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.createCapacityCommitment(request); */ createCapacityCommitment( request: protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, @@ -905,7 +926,11 @@ export class ReservationServiceClient { * 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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. - * 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.getCapacityCommitment(request); */ getCapacityCommitment( request: protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, @@ -1002,7 +1027,11 @@ export class ReservationServiceClient { * 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.deleteCapacityCommitment(request); */ deleteCapacityCommitment( request: protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, @@ -1108,7 +1137,11 @@ export class ReservationServiceClient { * 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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. - * 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.updateCapacityCommitment(request); */ updateCapacityCommitment( request: protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, @@ -1216,7 +1249,11 @@ export class ReservationServiceClient { * 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 [SplitCapacityCommitmentResponse]{@link google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse}. - * 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.splitCapacityCommitment(request); */ splitCapacityCommitment( request: protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, @@ -1327,7 +1364,11 @@ export class ReservationServiceClient { * 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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. - * 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.mergeCapacityCommitments(request); */ mergeCapacityCommitments( request: protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, @@ -1457,7 +1498,11 @@ export class ReservationServiceClient { * 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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. - * 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.createAssignment(request); */ createAssignment( request: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, @@ -1566,7 +1611,11 @@ export class ReservationServiceClient { * 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.deleteAssignment(request); */ deleteAssignment( request: protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, @@ -1669,7 +1718,11 @@ export class ReservationServiceClient { * 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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. - * 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.moveAssignment(request); */ moveAssignment( request: protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, @@ -1764,7 +1817,11 @@ export class ReservationServiceClient { * 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 [BiReservation]{@link google.cloud.bigquery.reservation.v1.BiReservation}. - * 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.getBiReservation(request); */ getBiReservation( request: protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, @@ -1867,7 +1924,11 @@ export class ReservationServiceClient { * 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 [BiReservation]{@link google.cloud.bigquery.reservation.v1.BiReservation}. - * 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.updateBiReservation(request); */ updateBiReservation( request: protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, @@ -1964,19 +2025,14 @@ export class ReservationServiceClient { * 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 [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation}. - * 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 [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation} 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 [ListReservationsRequest]{@link google.cloud.bigquery.reservation.v1.ListReservationsRequest} - * 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 - * [ListReservationsResponse]{@link google.cloud.bigquery.reservation.v1.ListReservationsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `listReservationsAsync()` + * 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. */ listReservations( request: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, @@ -2024,18 +2080,7 @@ export class ReservationServiceClient { } /** - * Equivalent to {@link listReservations}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listReservations} 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 @@ -2049,6 +2094,13 @@ export class ReservationServiceClient { * 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 [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation} 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 `listReservationsAsync()` + * 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. */ listReservationsStream( request?: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, @@ -2073,10 +2125,9 @@ export class ReservationServiceClient { } /** - * Equivalent to {@link listReservations}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `listReservations`, 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 @@ -2089,7 +2140,18 @@ export class ReservationServiceClient { * @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 + * [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation}. 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.listReservationsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listReservationsAsync( request?: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, @@ -2162,19 +2224,14 @@ export class ReservationServiceClient { * 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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. - * 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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment} 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 [ListCapacityCommitmentsRequest]{@link google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest} - * 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 - * [ListCapacityCommitmentsResponse]{@link google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `listCapacityCommitmentsAsync()` + * 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. */ listCapacityCommitments( request: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, @@ -2226,18 +2283,7 @@ export class ReservationServiceClient { } /** - * Equivalent to {@link listCapacityCommitments}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listCapacityCommitments} 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 @@ -2251,6 +2297,13 @@ export class ReservationServiceClient { * 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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment} 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 `listCapacityCommitmentsAsync()` + * 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. */ listCapacityCommitmentsStream( request?: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, @@ -2275,10 +2328,9 @@ export class ReservationServiceClient { } /** - * Equivalent to {@link listCapacityCommitments}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `listCapacityCommitments`, 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 @@ -2291,7 +2343,18 @@ export class ReservationServiceClient { * @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 + * [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. 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.listCapacityCommitmentsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listCapacityCommitmentsAsync( request?: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, @@ -2391,19 +2454,14 @@ export class ReservationServiceClient { * 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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. - * 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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment} 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 [ListAssignmentsRequest]{@link google.cloud.bigquery.reservation.v1.ListAssignmentsRequest} - * 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 - * [ListAssignmentsResponse]{@link google.cloud.bigquery.reservation.v1.ListAssignmentsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `listAssignmentsAsync()` + * 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. */ listAssignments( request: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, @@ -2451,18 +2509,7 @@ export class ReservationServiceClient { } /** - * Equivalent to {@link listAssignments}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listAssignments} 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 @@ -2481,6 +2528,13 @@ export class ReservationServiceClient { * 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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment} 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 `listAssignmentsAsync()` + * 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. */ listAssignmentsStream( request?: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, @@ -2505,10 +2559,9 @@ export class ReservationServiceClient { } /** - * Equivalent to {@link listAssignments}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `listAssignments`, 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 @@ -2526,7 +2579,18 @@ export class ReservationServiceClient { * @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 + * [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. 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.listAssignmentsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listAssignmentsAsync( request?: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, @@ -2628,19 +2692,14 @@ export class ReservationServiceClient { * 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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. - * 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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment} 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 [SearchAssignmentsRequest]{@link google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest} - * 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 - * [SearchAssignmentsResponse]{@link google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `searchAssignmentsAsync()` + * 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. */ searchAssignments( request: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, @@ -2688,18 +2747,7 @@ export class ReservationServiceClient { } /** - * Equivalent to {@link searchAssignments}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link searchAssignments} 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 @@ -2722,6 +2770,13 @@ export class ReservationServiceClient { * 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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment} 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 `searchAssignmentsAsync()` + * 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. */ searchAssignmentsStream( request?: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, @@ -2746,10 +2801,9 @@ export class ReservationServiceClient { } /** - * Equivalent to {@link searchAssignments}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `searchAssignments`, 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 @@ -2771,7 +2825,18 @@ export class ReservationServiceClient { * @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 + * [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. 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.searchAssignmentsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ searchAssignmentsAsync( request?: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, @@ -3081,9 +3146,10 @@ export class ReservationServiceClient { } /** - * 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-bigquery-reservation/synth.metadata b/packages/google-cloud-bigquery-reservation/synth.metadata index c6ee9247c61..218dc87799c 100644 --- a/packages/google-cloud-bigquery-reservation/synth.metadata +++ b/packages/google-cloud-bigquery-reservation/synth.metadata @@ -3,23 +3,15 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-bigquery-reservation.git", - "sha": "8a0675517b35102a2b385b936085956465e6d953" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "b821f320473c8ec05a1c7fb9a496c958b1ab9834", - "internalRef": "331104099" + "remote": "git@github.com:googleapis/nodejs-bigquery-reservation.git", + "sha": "0657268261a19710d1c2c76d093dd2f87fa7cfa4" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ba9918cd22874245b55734f57470c719b577e591" + "sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b" } } ], @@ -87,6 +79,7 @@ "README.md", "api-extractor.json", "linkinator.config.json", + "package-lock.json.2966301757", "protos/google/cloud/bigquery/reservation/v1/reservation.proto", "protos/protos.d.ts", "protos/protos.js", diff --git a/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.ts index cd145827e36..da4ef68fad3 100644 --- a/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.ts @@ -18,8 +18,15 @@ import {ReservationServiceClient} from '@google-cloud/bigquery-reservation'; +// check that the client class type name can be used +function doStuffWithReservationServiceClient(client: ReservationServiceClient) { + client.close(); +} + function main() { - new ReservationServiceClient(); + // check that the client instance can be created + const reservationServiceClient = new ReservationServiceClient(); + doStuffWithReservationServiceClient(reservationServiceClient); } main(); diff --git a/packages/google-cloud-bigquery-reservation/system-test/install.ts b/packages/google-cloud-bigquery-reservation/system-test/install.ts index 4c1ba3eb79a..39d90f771de 100644 --- a/packages/google-cloud-bigquery-reservation/system-test/install.ts +++ b/packages/google-cloud-bigquery-reservation/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 71ca7a8e2bd7e87fcff241e9fd18fab0180e357a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 16 Nov 2020 09:35:46 -0800 Subject: [PATCH 019/105] chore: release 1.0.1 (#29) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-bigquery-reservation/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-reservation/package.json | 2 +- .../google-cloud-bigquery-reservation/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/CHANGELOG.md b/packages/google-cloud-bigquery-reservation/CHANGELOG.md index 2658d7aa26e..e8d3c47b81d 100644 --- a/packages/google-cloud-bigquery-reservation/CHANGELOG.md +++ b/packages/google-cloud-bigquery-reservation/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.0.1](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.0.0...v1.0.1) (2020-11-06) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#28](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/28)) ([fa58436](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/fa584362f0c9ef485bbb8e76db143565cb144317)) + ## 1.0.0 (2020-07-14) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 99feec837da..83c140b8a72 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-reservation", - "version": "1.0.0", + "version": "1.0.1", "description": "BigQuery Reservation client for Node.js", "repository": "googleapis/nodejs-bigquery-reservation", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-reservation/samples/package.json b/packages/google-cloud-bigquery-reservation/samples/package.json index a7822ac4517..e7036dd669d 100644 --- a/packages/google-cloud-bigquery-reservation/samples/package.json +++ b/packages/google-cloud-bigquery-reservation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-reservation": "^1.0.0" + "@google-cloud/bigquery-reservation": "^1.0.1" }, "devDependencies": { "c8": "^7.1.0", From 96a27498a8fe122b22e53ca4d1d1cc4f8cce7e75 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 23 Nov 2020 12:38:54 -0800 Subject: [PATCH 020/105] fix(browser): check for fetch on window --- .../protos/protos.json | 237 ++++++++++++++++-- .../src/v1/reservation_service_client.ts | 222 ++++++++-------- .../synth.metadata | 13 +- 3 files changed, 343 insertions(+), 129 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.json b/packages/google-cloud-bigquery-reservation/protos/protos.json index 0348b51b845..90fff85e009 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.json +++ b/packages/google-cloud-bigquery-reservation/protos/protos.json @@ -31,7 +31,18 @@ "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/reservations", "(google.api.http).body": "reservation", "(google.api.method_signature)": "parent,reservation,reservation_id" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/reservations", + "body": "reservation" + } + }, + { + "(google.api.method_signature)": "parent,reservation,reservation_id" + } + ] }, "ListReservations": { "requestType": "ListReservationsRequest", @@ -39,7 +50,17 @@ "options": { "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/reservations", "(google.api.method_signature)": "parent" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/reservations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, "GetReservation": { "requestType": "GetReservationRequest", @@ -47,7 +68,17 @@ "options": { "(google.api.http).get": "/v1/{name=projects/*/locations/*/reservations/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/reservations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "DeleteReservation": { "requestType": "DeleteReservationRequest", @@ -55,7 +86,17 @@ "options": { "(google.api.http).delete": "/v1/{name=projects/*/locations/*/reservations/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/reservations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "UpdateReservation": { "requestType": "UpdateReservationRequest", @@ -64,7 +105,18 @@ "(google.api.http).patch": "/v1/{reservation.name=projects/*/locations/*/reservations/*}", "(google.api.http).body": "reservation", "(google.api.method_signature)": "reservation,update_mask" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{reservation.name=projects/*/locations/*/reservations/*}", + "body": "reservation" + } + }, + { + "(google.api.method_signature)": "reservation,update_mask" + } + ] }, "CreateCapacityCommitment": { "requestType": "CreateCapacityCommitmentRequest", @@ -73,7 +125,18 @@ "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/capacityCommitments", "(google.api.http).body": "capacity_commitment", "(google.api.method_signature)": "parent,capacity_commitment" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/capacityCommitments", + "body": "capacity_commitment" + } + }, + { + "(google.api.method_signature)": "parent,capacity_commitment" + } + ] }, "ListCapacityCommitments": { "requestType": "ListCapacityCommitmentsRequest", @@ -81,7 +144,17 @@ "options": { "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/capacityCommitments", "(google.api.method_signature)": "parent" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/capacityCommitments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, "GetCapacityCommitment": { "requestType": "GetCapacityCommitmentRequest", @@ -89,7 +162,17 @@ "options": { "(google.api.http).get": "/v1/{name=projects/*/locations/*/capacityCommitments/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/capacityCommitments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "DeleteCapacityCommitment": { "requestType": "DeleteCapacityCommitmentRequest", @@ -97,7 +180,17 @@ "options": { "(google.api.http).delete": "/v1/{name=projects/*/locations/*/capacityCommitments/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/capacityCommitments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "UpdateCapacityCommitment": { "requestType": "UpdateCapacityCommitmentRequest", @@ -106,7 +199,18 @@ "(google.api.http).patch": "/v1/{capacity_commitment.name=projects/*/locations/*/capacityCommitments/*}", "(google.api.http).body": "capacity_commitment", "(google.api.method_signature)": "capacity_commitment,update_mask" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{capacity_commitment.name=projects/*/locations/*/capacityCommitments/*}", + "body": "capacity_commitment" + } + }, + { + "(google.api.method_signature)": "capacity_commitment,update_mask" + } + ] }, "SplitCapacityCommitment": { "requestType": "SplitCapacityCommitmentRequest", @@ -115,7 +219,18 @@ "(google.api.http).post": "/v1/{name=projects/*/locations/*/capacityCommitments/*}:split", "(google.api.http).body": "*", "(google.api.method_signature)": "name,slot_count" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/capacityCommitments/*}:split", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,slot_count" + } + ] }, "MergeCapacityCommitments": { "requestType": "MergeCapacityCommitmentsRequest", @@ -124,7 +239,18 @@ "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/capacityCommitments:merge", "(google.api.http).body": "*", "(google.api.method_signature)": "parent,capacity_commitment_ids" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/capacityCommitments:merge", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,capacity_commitment_ids" + } + ] }, "CreateAssignment": { "requestType": "CreateAssignmentRequest", @@ -133,7 +259,18 @@ "(google.api.http).post": "/v1/{parent=projects/*/locations/*/reservations/*}/assignments", "(google.api.http).body": "assignment", "(google.api.method_signature)": "parent,assignment" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/reservations/*}/assignments", + "body": "assignment" + } + }, + { + "(google.api.method_signature)": "parent,assignment" + } + ] }, "ListAssignments": { "requestType": "ListAssignmentsRequest", @@ -141,7 +278,17 @@ "options": { "(google.api.http).get": "/v1/{parent=projects/*/locations/*/reservations/*}/assignments", "(google.api.method_signature)": "parent" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/reservations/*}/assignments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, "DeleteAssignment": { "requestType": "DeleteAssignmentRequest", @@ -149,7 +296,17 @@ "options": { "(google.api.http).delete": "/v1/{name=projects/*/locations/*/reservations/*/assignments/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/reservations/*/assignments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "SearchAssignments": { "requestType": "SearchAssignmentsRequest", @@ -157,7 +314,17 @@ "options": { "(google.api.http).get": "/v1/{parent=projects/*/locations/*}:searchAssignments", "(google.api.method_signature)": "parent,query" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}:searchAssignments" + } + }, + { + "(google.api.method_signature)": "parent,query" + } + ] }, "MoveAssignment": { "requestType": "MoveAssignmentRequest", @@ -166,7 +333,18 @@ "(google.api.http).post": "/v1/{name=projects/*/locations/*/reservations/*/assignments/*}:move", "(google.api.http).body": "*", "(google.api.method_signature)": "name,destination_id" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/reservations/*/assignments/*}:move", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,destination_id" + } + ] }, "GetBiReservation": { "requestType": "GetBiReservationRequest", @@ -174,7 +352,17 @@ "options": { "(google.api.http).get": "/v1/{name=projects/*/locations/*/biReservation}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/biReservation}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "UpdateBiReservation": { "requestType": "UpdateBiReservationRequest", @@ -183,7 +371,18 @@ "(google.api.http).patch": "/v1/{bi_reservation.name=projects/*/locations/*/biReservation}", "(google.api.http).body": "bi_reservation", "(google.api.method_signature)": "bi_reservation,update_mask" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{bi_reservation.name=projects/*/locations/*/biReservation}", + "body": "bi_reservation" + } + }, + { + "(google.api.method_signature)": "bi_reservation,update_mask" + } + ] } } }, diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index f94e4e77bb8..87571e19e99 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_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/v1/reservation_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './reservation_service_client_config.json'; const version = require('../../../package.json').version; @@ -97,9 +103,9 @@ export class ReservationServiceClient { * 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` @@ -112,7 +118,9 @@ export class ReservationServiceClient { 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. @@ -370,7 +378,7 @@ export class ReservationServiceClient { // ------------------- createReservation( request: protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.bigquery.reservation.v1.IReservation, @@ -383,7 +391,7 @@ export class ReservationServiceClient { >; createReservation( request: protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.bigquery.reservation.v1.IReservation, | protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest @@ -428,7 +436,7 @@ export class ReservationServiceClient { createReservation( request: protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.bigquery.reservation.v1.IReservation, | protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest @@ -454,12 +462,12 @@ export class ReservationServiceClient { ] > | 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 || {}; @@ -474,7 +482,7 @@ export class ReservationServiceClient { } getReservation( request: protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.bigquery.reservation.v1.IReservation, @@ -487,7 +495,7 @@ export class ReservationServiceClient { >; getReservation( request: protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.bigquery.reservation.v1.IReservation, | protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest @@ -527,7 +535,7 @@ export class ReservationServiceClient { getReservation( request: protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.bigquery.reservation.v1.IReservation, | protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest @@ -553,12 +561,12 @@ export class ReservationServiceClient { ] > | 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 || {}; @@ -573,7 +581,7 @@ export class ReservationServiceClient { } deleteReservation( request: protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.protobuf.IEmpty, @@ -586,7 +594,7 @@ export class ReservationServiceClient { >; deleteReservation( request: protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.protobuf.IEmpty, | protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest @@ -628,7 +636,7 @@ export class ReservationServiceClient { deleteReservation( request: protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.protobuf.IEmpty, | protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest @@ -654,12 +662,12 @@ export class ReservationServiceClient { ] > | 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 || {}; @@ -674,7 +682,7 @@ export class ReservationServiceClient { } updateReservation( request: protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.bigquery.reservation.v1.IReservation, @@ -687,7 +695,7 @@ export class ReservationServiceClient { >; updateReservation( request: protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.bigquery.reservation.v1.IReservation, | protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest @@ -728,7 +736,7 @@ export class ReservationServiceClient { updateReservation( request: protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.bigquery.reservation.v1.IReservation, | protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest @@ -754,12 +762,12 @@ export class ReservationServiceClient { ] > | 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 || {}; @@ -774,7 +782,7 @@ export class ReservationServiceClient { } createCapacityCommitment( request: protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, @@ -787,7 +795,7 @@ export class ReservationServiceClient { >; createCapacityCommitment( request: protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, | protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest @@ -832,7 +840,7 @@ export class ReservationServiceClient { createCapacityCommitment( request: protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, | protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest @@ -858,12 +866,12 @@ export class ReservationServiceClient { ] > | 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 || {}; @@ -882,7 +890,7 @@ export class ReservationServiceClient { } getCapacityCommitment( request: protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, @@ -895,7 +903,7 @@ export class ReservationServiceClient { >; getCapacityCommitment( request: protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, | protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest @@ -935,7 +943,7 @@ export class ReservationServiceClient { getCapacityCommitment( request: protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, | protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest @@ -961,12 +969,12 @@ export class ReservationServiceClient { ] > | 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 || {}; @@ -981,7 +989,7 @@ export class ReservationServiceClient { } deleteCapacityCommitment( request: protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.protobuf.IEmpty, @@ -994,7 +1002,7 @@ export class ReservationServiceClient { >; deleteCapacityCommitment( request: protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.protobuf.IEmpty, | protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest @@ -1036,7 +1044,7 @@ export class ReservationServiceClient { deleteCapacityCommitment( request: protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.protobuf.IEmpty, | protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest @@ -1062,12 +1070,12 @@ export class ReservationServiceClient { ] > | 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 || {}; @@ -1086,7 +1094,7 @@ export class ReservationServiceClient { } updateCapacityCommitment( request: protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, @@ -1099,7 +1107,7 @@ export class ReservationServiceClient { >; updateCapacityCommitment( request: protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, | protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest @@ -1146,7 +1154,7 @@ export class ReservationServiceClient { updateCapacityCommitment( request: protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, | protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest @@ -1172,12 +1180,12 @@ export class ReservationServiceClient { ] > | 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 || {}; @@ -1196,7 +1204,7 @@ export class ReservationServiceClient { } splitCapacityCommitment( request: protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, @@ -1209,7 +1217,7 @@ export class ReservationServiceClient { >; splitCapacityCommitment( request: protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, | protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest @@ -1258,7 +1266,7 @@ export class ReservationServiceClient { splitCapacityCommitment( request: protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, | protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest @@ -1284,12 +1292,12 @@ export class ReservationServiceClient { ] > | 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 || {}; @@ -1308,7 +1316,7 @@ export class ReservationServiceClient { } mergeCapacityCommitments( request: protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, @@ -1321,7 +1329,7 @@ export class ReservationServiceClient { >; mergeCapacityCommitments( request: protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, | protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest @@ -1373,7 +1381,7 @@ export class ReservationServiceClient { mergeCapacityCommitments( request: protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, | protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest @@ -1399,12 +1407,12 @@ export class ReservationServiceClient { ] > | 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 || {}; @@ -1423,7 +1431,7 @@ export class ReservationServiceClient { } createAssignment( request: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.bigquery.reservation.v1.IAssignment, @@ -1436,7 +1444,7 @@ export class ReservationServiceClient { >; createAssignment( request: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.bigquery.reservation.v1.IAssignment, | protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest @@ -1507,7 +1515,7 @@ export class ReservationServiceClient { createAssignment( request: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.bigquery.reservation.v1.IAssignment, | protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest @@ -1533,12 +1541,12 @@ export class ReservationServiceClient { ] > | 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 || {}; @@ -1553,7 +1561,7 @@ export class ReservationServiceClient { } deleteAssignment( request: protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.protobuf.IEmpty, @@ -1566,7 +1574,7 @@ export class ReservationServiceClient { >; deleteAssignment( request: protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.protobuf.IEmpty, | protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest @@ -1620,7 +1628,7 @@ export class ReservationServiceClient { deleteAssignment( request: protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.protobuf.IEmpty, | protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest @@ -1646,12 +1654,12 @@ export class ReservationServiceClient { ] > | 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 || {}; @@ -1666,7 +1674,7 @@ export class ReservationServiceClient { } moveAssignment( request: protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.bigquery.reservation.v1.IAssignment, @@ -1679,7 +1687,7 @@ export class ReservationServiceClient { >; moveAssignment( request: protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.bigquery.reservation.v1.IAssignment, | protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest @@ -1727,7 +1735,7 @@ export class ReservationServiceClient { moveAssignment( request: protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.bigquery.reservation.v1.IAssignment, | protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest @@ -1753,12 +1761,12 @@ export class ReservationServiceClient { ] > | 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 || {}; @@ -1773,7 +1781,7 @@ export class ReservationServiceClient { } getBiReservation( request: protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.bigquery.reservation.v1.IBiReservation, @@ -1786,7 +1794,7 @@ export class ReservationServiceClient { >; getBiReservation( request: protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.bigquery.reservation.v1.IBiReservation, | protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest @@ -1826,7 +1834,7 @@ export class ReservationServiceClient { getBiReservation( request: protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.bigquery.reservation.v1.IBiReservation, | protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest @@ -1852,12 +1860,12 @@ export class ReservationServiceClient { ] > | 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 || {}; @@ -1872,7 +1880,7 @@ export class ReservationServiceClient { } updateBiReservation( request: protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.bigquery.reservation.v1.IBiReservation, @@ -1885,7 +1893,7 @@ export class ReservationServiceClient { >; updateBiReservation( request: protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.bigquery.reservation.v1.IBiReservation, | protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest @@ -1933,7 +1941,7 @@ export class ReservationServiceClient { updateBiReservation( request: protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.bigquery.reservation.v1.IBiReservation, | protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest @@ -1959,12 +1967,12 @@ export class ReservationServiceClient { ] > | 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 || {}; @@ -1980,7 +1988,7 @@ export class ReservationServiceClient { listReservations( request: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.bigquery.reservation.v1.IReservation[], @@ -1990,7 +1998,7 @@ export class ReservationServiceClient { >; listReservations( request: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, | protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse @@ -2037,7 +2045,7 @@ export class ReservationServiceClient { listReservations( request: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, | protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse @@ -2060,12 +2068,12 @@ export class ReservationServiceClient { ] > | 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 || {}; @@ -2104,7 +2112,7 @@ export class ReservationServiceClient { */ listReservationsStream( request?: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -2155,7 +2163,7 @@ export class ReservationServiceClient { */ listReservationsAsync( request?: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; @@ -2179,7 +2187,7 @@ export class ReservationServiceClient { } listCapacityCommitments( request: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment[], @@ -2189,7 +2197,7 @@ export class ReservationServiceClient { >; listCapacityCommitments( request: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, | protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse @@ -2236,7 +2244,7 @@ export class ReservationServiceClient { listCapacityCommitments( request: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, | protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse @@ -2259,12 +2267,12 @@ export class ReservationServiceClient { ] > | 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 || {}; @@ -2307,7 +2315,7 @@ export class ReservationServiceClient { */ listCapacityCommitmentsStream( request?: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -2358,7 +2366,7 @@ export class ReservationServiceClient { */ listCapacityCommitmentsAsync( request?: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable< protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment > { @@ -2384,7 +2392,7 @@ export class ReservationServiceClient { } listAssignments( request: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.bigquery.reservation.v1.IAssignment[], @@ -2394,7 +2402,7 @@ export class ReservationServiceClient { >; listAssignments( request: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, | protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse @@ -2466,7 +2474,7 @@ export class ReservationServiceClient { listAssignments( request: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, | protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse @@ -2489,12 +2497,12 @@ export class ReservationServiceClient { ] > | 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 || {}; @@ -2538,7 +2546,7 @@ export class ReservationServiceClient { */ listAssignmentsStream( request?: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -2594,7 +2602,7 @@ export class ReservationServiceClient { */ listAssignmentsAsync( request?: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; @@ -2616,7 +2624,7 @@ export class ReservationServiceClient { } searchAssignments( request: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.bigquery.reservation.v1.IAssignment[], @@ -2626,7 +2634,7 @@ export class ReservationServiceClient { >; searchAssignments( request: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, | protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse @@ -2704,7 +2712,7 @@ export class ReservationServiceClient { searchAssignments( request: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, | protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse @@ -2727,12 +2735,12 @@ export class ReservationServiceClient { ] > | 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 || {}; @@ -2780,7 +2788,7 @@ export class ReservationServiceClient { */ searchAssignmentsStream( request?: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -2840,7 +2848,7 @@ export class ReservationServiceClient { */ searchAssignmentsAsync( request?: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; diff --git a/packages/google-cloud-bigquery-reservation/synth.metadata b/packages/google-cloud-bigquery-reservation/synth.metadata index 218dc87799c..4482d488c17 100644 --- a/packages/google-cloud-bigquery-reservation/synth.metadata +++ b/packages/google-cloud-bigquery-reservation/synth.metadata @@ -3,8 +3,16 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-bigquery-reservation.git", - "sha": "0657268261a19710d1c2c76d093dd2f87fa7cfa4" + "remote": "https://github.com/googleapis/nodejs-bigquery-reservation.git", + "sha": "2dae800050325af1944c50b121a6dfd1b26f4639" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "2f019bf70bfe06f1e2af1b04011b0a2405190e43", + "internalRef": "343202295" } }, { @@ -79,7 +87,6 @@ "README.md", "api-extractor.json", "linkinator.config.json", - "package-lock.json.2966301757", "protos/google/cloud/bigquery/reservation/v1/reservation.proto", "protos/protos.d.ts", "protos/protos.js", From a626c6c6c6384645f2990cc0953035d99de9e3cf Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 24 Nov 2020 07:04:39 -0800 Subject: [PATCH 021/105] build: stop tracking generated files --- .../src/v1/reservation_service_client.ts | 12 +-- .../synth.metadata | 73 +------------------ 2 files changed, 4 insertions(+), 81 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index 87571e19e99..71648c76b39 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts @@ -2181,9 +2181,7 @@ export class ReservationServiceClient { this.innerApiCalls['listReservations'] as GaxCall, (request as unknown) as RequestType, callSettings - ) as AsyncIterable< - protos.google.cloud.bigquery.reservation.v1.IReservation - >; + ) as AsyncIterable; } listCapacityCommitments( request: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, @@ -2367,9 +2365,7 @@ export class ReservationServiceClient { listCapacityCommitmentsAsync( request?: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, options?: CallOptions - ): AsyncIterable< - protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment - > { + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -2386,9 +2382,7 @@ export class ReservationServiceClient { this.innerApiCalls['listCapacityCommitments'] as GaxCall, (request as unknown) as RequestType, callSettings - ) as AsyncIterable< - protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment - >; + ) as AsyncIterable; } listAssignments( request: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, diff --git a/packages/google-cloud-bigquery-reservation/synth.metadata b/packages/google-cloud-bigquery-reservation/synth.metadata index 4482d488c17..28c6e4b2d3c 100644 --- a/packages/google-cloud-bigquery-reservation/synth.metadata +++ b/packages/google-cloud-bigquery-reservation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-reservation.git", - "sha": "2dae800050325af1944c50b121a6dfd1b26f4639" + "sha": "5a32067bdc000025c3166c72069db861800be5d8" } }, { @@ -33,76 +33,5 @@ "generator": "bazel" } } - ], - "generatedFiles": [ - ".eslintignore", - ".eslintrc.json", - ".gitattributes", - ".github/ISSUE_TEMPLATE/bug_report.md", - ".github/ISSUE_TEMPLATE/feature_request.md", - ".github/ISSUE_TEMPLATE/support_request.md", - ".github/PULL_REQUEST_TEMPLATE.md", - ".github/release-please.yml", - ".github/workflows/ci.yaml", - ".gitignore", - ".jsdoc.js", - ".kokoro/.gitattributes", - ".kokoro/common.cfg", - ".kokoro/continuous/node10/common.cfg", - ".kokoro/continuous/node10/docs.cfg", - ".kokoro/continuous/node10/test.cfg", - ".kokoro/continuous/node12/common.cfg", - ".kokoro/continuous/node12/lint.cfg", - ".kokoro/continuous/node12/samples-test.cfg", - ".kokoro/continuous/node12/system-test.cfg", - ".kokoro/continuous/node12/test.cfg", - ".kokoro/docs.sh", - ".kokoro/lint.sh", - ".kokoro/populate-secrets.sh", - ".kokoro/presubmit/node10/common.cfg", - ".kokoro/presubmit/node12/common.cfg", - ".kokoro/presubmit/node12/samples-test.cfg", - ".kokoro/presubmit/node12/system-test.cfg", - ".kokoro/presubmit/node12/test.cfg", - ".kokoro/publish.sh", - ".kokoro/release/docs-devsite.cfg", - ".kokoro/release/docs-devsite.sh", - ".kokoro/release/docs.cfg", - ".kokoro/release/docs.sh", - ".kokoro/release/publish.cfg", - ".kokoro/samples-test.sh", - ".kokoro/system-test.sh", - ".kokoro/test.bat", - ".kokoro/test.sh", - ".kokoro/trampoline.sh", - ".kokoro/trampoline_v2.sh", - ".mocharc.js", - ".nycrc", - ".prettierignore", - ".prettierrc.js", - ".trampolinerc", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "README.md", - "api-extractor.json", - "linkinator.config.json", - "protos/google/cloud/bigquery/reservation/v1/reservation.proto", - "protos/protos.d.ts", - "protos/protos.js", - "protos/protos.json", - "renovate.json", - "samples/README.md", - "src/index.ts", - "src/v1/index.ts", - "src/v1/reservation_service_client.ts", - "src/v1/reservation_service_client_config.json", - "src/v1/reservation_service_proto_list.json", - "system-test/fixtures/sample/src/index.js", - "system-test/fixtures/sample/src/index.ts", - "system-test/install.ts", - "test/gapic_reservation_service_v1.ts", - "tsconfig.json", - "webpack.config.js" ] } \ No newline at end of file From ab833f94671eea1004bd5091740508dd174c1859 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 25 Nov 2020 08:36:22 -0800 Subject: [PATCH 022/105] docs: spelling correction for "targetting" (#36) 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-bigquery-reservation/README.md | 2 +- packages/google-cloud-bigquery-reservation/synth.metadata | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/README.md b/packages/google-cloud-bigquery-reservation/README.md index 3f75b8488a8..3289bb5c2b1 100644 --- a/packages/google-cloud-bigquery-reservation/README.md +++ b/packages/google-cloud-bigquery-reservation/README.md @@ -114,7 +114,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-bigquery-reservation/synth.metadata b/packages/google-cloud-bigquery-reservation/synth.metadata index 28c6e4b2d3c..bf4b6d71afa 100644 --- a/packages/google-cloud-bigquery-reservation/synth.metadata +++ b/packages/google-cloud-bigquery-reservation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-reservation.git", - "sha": "5a32067bdc000025c3166c72069db861800be5d8" + "sha": "6a7743c63b1e360823b5065f26f1f493baf3fd3b" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b" + "sha": "15013eff642a7e7e855aed5a29e6e83c39beba2a" } } ], From ed10c1d18d50b1f64373ea480dbd8c08da639ee7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 30 Nov 2020 13:59:51 -0800 Subject: [PATCH 023/105] chore: release 1.0.2 (#34) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-bigquery-reservation/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-reservation/package.json | 2 +- .../google-cloud-bigquery-reservation/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/CHANGELOG.md b/packages/google-cloud-bigquery-reservation/CHANGELOG.md index e8d3c47b81d..a5d915fb62c 100644 --- a/packages/google-cloud-bigquery-reservation/CHANGELOG.md +++ b/packages/google-cloud-bigquery-reservation/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.0.2](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.0.1...v1.0.2) (2020-11-25) + + +### Bug Fixes + +* **browser:** check for fetch on window ([5a32067](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/5a32067bdc000025c3166c72069db861800be5d8)) + ### [1.0.1](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.0.0...v1.0.1) (2020-11-06) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 83c140b8a72..10c348f7eb9 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-reservation", - "version": "1.0.1", + "version": "1.0.2", "description": "BigQuery Reservation client for Node.js", "repository": "googleapis/nodejs-bigquery-reservation", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-reservation/samples/package.json b/packages/google-cloud-bigquery-reservation/samples/package.json index e7036dd669d..5353e1f448a 100644 --- a/packages/google-cloud-bigquery-reservation/samples/package.json +++ b/packages/google-cloud-bigquery-reservation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-reservation": "^1.0.1" + "@google-cloud/bigquery-reservation": "^1.0.2" }, "devDependencies": { "c8": "^7.1.0", From 00cc4f18bd465b079e8f2bdfb13f4ad932f52397 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 1 Dec 2020 13:07:49 +0100 Subject: [PATCH 024/105] fix(deps): roll back dependency @google-cloud/bigquery-reservation to ^1.0.1 (#38) --- packages/google-cloud-bigquery-reservation/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/samples/package.json b/packages/google-cloud-bigquery-reservation/samples/package.json index 5353e1f448a..e7036dd669d 100644 --- a/packages/google-cloud-bigquery-reservation/samples/package.json +++ b/packages/google-cloud-bigquery-reservation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-reservation": "^1.0.2" + "@google-cloud/bigquery-reservation": "^1.0.1" }, "devDependencies": { "c8": "^7.1.0", From fb4cb011e702e31f4d31f8656ffb4bf5a2bbabe3 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 4 Dec 2020 08:56:30 -0800 Subject: [PATCH 025/105] chore: generate GAPIC metadata JSON file (#39) 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 | 229 ++++++++++++++++++ .../synth.metadata | 6 +- 2 files changed, 232 insertions(+), 3 deletions(-) create mode 100644 packages/google-cloud-bigquery-reservation/src/v1/gapic_metadata.json diff --git a/packages/google-cloud-bigquery-reservation/src/v1/gapic_metadata.json b/packages/google-cloud-bigquery-reservation/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..197360bed17 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/src/v1/gapic_metadata.json @@ -0,0 +1,229 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.bigquery.reservation.v1", + "libraryPackage": "@google-cloud/bigquery-reservation", + "services": { + "ReservationService": { + "clients": { + "grpc": { + "libraryClient": "ReservationServiceClient", + "rpcs": { + "CreateReservation": { + "methods": [ + "createReservation" + ] + }, + "GetReservation": { + "methods": [ + "getReservation" + ] + }, + "DeleteReservation": { + "methods": [ + "deleteReservation" + ] + }, + "UpdateReservation": { + "methods": [ + "updateReservation" + ] + }, + "CreateCapacityCommitment": { + "methods": [ + "createCapacityCommitment" + ] + }, + "GetCapacityCommitment": { + "methods": [ + "getCapacityCommitment" + ] + }, + "DeleteCapacityCommitment": { + "methods": [ + "deleteCapacityCommitment" + ] + }, + "UpdateCapacityCommitment": { + "methods": [ + "updateCapacityCommitment" + ] + }, + "SplitCapacityCommitment": { + "methods": [ + "splitCapacityCommitment" + ] + }, + "MergeCapacityCommitments": { + "methods": [ + "mergeCapacityCommitments" + ] + }, + "CreateAssignment": { + "methods": [ + "createAssignment" + ] + }, + "DeleteAssignment": { + "methods": [ + "deleteAssignment" + ] + }, + "MoveAssignment": { + "methods": [ + "moveAssignment" + ] + }, + "GetBiReservation": { + "methods": [ + "getBiReservation" + ] + }, + "UpdateBiReservation": { + "methods": [ + "updateBiReservation" + ] + }, + "ListReservations": { + "methods": [ + "listReservations", + "listReservationsStream", + "listReservationsAsync" + ] + }, + "ListCapacityCommitments": { + "methods": [ + "listCapacityCommitments", + "listCapacityCommitmentsStream", + "listCapacityCommitmentsAsync" + ] + }, + "ListAssignments": { + "methods": [ + "listAssignments", + "listAssignmentsStream", + "listAssignmentsAsync" + ] + }, + "SearchAssignments": { + "methods": [ + "searchAssignments", + "searchAssignmentsStream", + "searchAssignmentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ReservationServiceClient", + "rpcs": { + "CreateReservation": { + "methods": [ + "createReservation" + ] + }, + "GetReservation": { + "methods": [ + "getReservation" + ] + }, + "DeleteReservation": { + "methods": [ + "deleteReservation" + ] + }, + "UpdateReservation": { + "methods": [ + "updateReservation" + ] + }, + "CreateCapacityCommitment": { + "methods": [ + "createCapacityCommitment" + ] + }, + "GetCapacityCommitment": { + "methods": [ + "getCapacityCommitment" + ] + }, + "DeleteCapacityCommitment": { + "methods": [ + "deleteCapacityCommitment" + ] + }, + "UpdateCapacityCommitment": { + "methods": [ + "updateCapacityCommitment" + ] + }, + "SplitCapacityCommitment": { + "methods": [ + "splitCapacityCommitment" + ] + }, + "MergeCapacityCommitments": { + "methods": [ + "mergeCapacityCommitments" + ] + }, + "CreateAssignment": { + "methods": [ + "createAssignment" + ] + }, + "DeleteAssignment": { + "methods": [ + "deleteAssignment" + ] + }, + "MoveAssignment": { + "methods": [ + "moveAssignment" + ] + }, + "GetBiReservation": { + "methods": [ + "getBiReservation" + ] + }, + "UpdateBiReservation": { + "methods": [ + "updateBiReservation" + ] + }, + "ListReservations": { + "methods": [ + "listReservations", + "listReservationsStream", + "listReservationsAsync" + ] + }, + "ListCapacityCommitments": { + "methods": [ + "listCapacityCommitments", + "listCapacityCommitmentsStream", + "listCapacityCommitmentsAsync" + ] + }, + "ListAssignments": { + "methods": [ + "listAssignments", + "listAssignmentsStream", + "listAssignmentsAsync" + ] + }, + "SearchAssignments": { + "methods": [ + "searchAssignments", + "searchAssignmentsStream", + "searchAssignmentsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-reservation/synth.metadata b/packages/google-cloud-bigquery-reservation/synth.metadata index bf4b6d71afa..8b35511eea0 100644 --- a/packages/google-cloud-bigquery-reservation/synth.metadata +++ b/packages/google-cloud-bigquery-reservation/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-reservation.git", - "sha": "6a7743c63b1e360823b5065f26f1f493baf3fd3b" + "sha": "b4ee172520adbbdff077d2a1db7d72c88401f98a" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "2f019bf70bfe06f1e2af1b04011b0a2405190e43", - "internalRef": "343202295" + "sha": "d189e871205fea665a9648f7c4676f027495ccaf", + "internalRef": "345596855" } }, { From 42704342a798a9e045005037338a4fc6d8e4f698 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 22 Dec 2020 11:46:27 -0800 Subject: [PATCH 026/105] docs: add instructions for authenticating for system tests (#41) 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 --- .../CONTRIBUTING.md | 15 +++++++++++++-- .../google-cloud-bigquery-reservation/README.md | 3 +-- .../synth.metadata | 4 ++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/CONTRIBUTING.md b/packages/google-cloud-bigquery-reservation/CONTRIBUTING.md index f6c4cf010e3..c5e938c011b 100644 --- a/packages/google-cloud-bigquery-reservation/CONTRIBUTING.md +++ b/packages/google-cloud-bigquery-reservation/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 Google BigQuery Reservation 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=bigqueryreservation.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-bigquery-reservation/README.md b/packages/google-cloud-bigquery-reservation/README.md index 3289bb5c2b1..7333abf4a9a 100644 --- a/packages/google-cloud-bigquery-reservation/README.md +++ b/packages/google-cloud-bigquery-reservation/README.md @@ -96,8 +96,7 @@ listCapacityCommitments(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-bigquery-reservation/tree/master/samples) directory. The samples' `README.md` -has instructions for running the samples. +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-bigquery-reservation/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-bigquery-reservation/synth.metadata b/packages/google-cloud-bigquery-reservation/synth.metadata index 8b35511eea0..a92a25db630 100644 --- a/packages/google-cloud-bigquery-reservation/synth.metadata +++ b/packages/google-cloud-bigquery-reservation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-reservation.git", - "sha": "b4ee172520adbbdff077d2a1db7d72c88401f98a" + "sha": "b0d457316070a5ad62d59f31c066ecd2ccba0e03" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "15013eff642a7e7e855aed5a29e6e83c39beba2a" + "sha": "363fe305e9ce34a6cd53951c6ee5f997094b54ee" } } ], From e0301e131a83df70f0a30f3e60f4852dad2cbb65 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 1 Jan 2021 19:42:03 -0800 Subject: [PATCH 027/105] chore: update license headers (#42) --- packages/google-cloud-bigquery-reservation/.jsdoc.js | 4 ++-- packages/google-cloud-bigquery-reservation/protos/protos.d.ts | 2 +- packages/google-cloud-bigquery-reservation/protos/protos.js | 2 +- packages/google-cloud-bigquery-reservation/src/index.ts | 2 +- packages/google-cloud-bigquery-reservation/src/v1/index.ts | 2 +- .../src/v1/reservation_service_client.ts | 2 +- packages/google-cloud-bigquery-reservation/synth.metadata | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- .../google-cloud-bigquery-reservation/system-test/install.ts | 2 +- .../test/gapic_reservation_service_v1.ts | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/.jsdoc.js b/packages/google-cloud-bigquery-reservation/.jsdoc.js index 1f221730902..67bf2454f61 100644 --- a/packages/google-cloud-bigquery-reservation/.jsdoc.js +++ b/packages/google-cloud-bigquery-reservation/.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/bigquery-reservation', diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts b/packages/google-cloud-bigquery-reservation/protos/protos.d.ts index 89dc441b169..93a601ac367 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-reservation/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-bigquery-reservation/protos/protos.js b/packages/google-cloud-bigquery-reservation/protos/protos.js index 32613fd460f..e110b58369f 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.js +++ b/packages/google-cloud-bigquery-reservation/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-bigquery-reservation/src/index.ts b/packages/google-cloud-bigquery-reservation/src/index.ts index 1ef6db0cc82..0d452a1e493 100644 --- a/packages/google-cloud-bigquery-reservation/src/index.ts +++ b/packages/google-cloud-bigquery-reservation/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-bigquery-reservation/src/v1/index.ts b/packages/google-cloud-bigquery-reservation/src/v1/index.ts index 59513ffd54d..e7e4fb286b1 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/index.ts +++ b/packages/google-cloud-bigquery-reservation/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-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index 71648c76b39..544310638dd 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_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-bigquery-reservation/synth.metadata b/packages/google-cloud-bigquery-reservation/synth.metadata index a92a25db630..b4be2d5070c 100644 --- a/packages/google-cloud-bigquery-reservation/synth.metadata +++ b/packages/google-cloud-bigquery-reservation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-reservation.git", - "sha": "b0d457316070a5ad62d59f31c066ecd2ccba0e03" + "sha": "3fac6b6f38da08dbf2e61423f8473451adc2f010" } }, { diff --git a/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.js index 062b949e3bb..253921327a1 100644 --- a/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-bigquery-reservation/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-bigquery-reservation/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.ts index da4ef68fad3..3d7b72431e4 100644 --- a/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-bigquery-reservation/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-bigquery-reservation/system-test/install.ts b/packages/google-cloud-bigquery-reservation/system-test/install.ts index 39d90f771de..d2d61c0396f 100644 --- a/packages/google-cloud-bigquery-reservation/system-test/install.ts +++ b/packages/google-cloud-bigquery-reservation/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-bigquery-reservation/test/gapic_reservation_service_v1.ts b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts index fc2f2edda7d..d3b02abe9a5 100644 --- a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts +++ b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_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. From 7f65a4a740e5cff4f39561aeacded8d64d048d3b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 8 Jan 2021 18:42:28 -0800 Subject: [PATCH 028/105] feat: introduce style enumeration (#43) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/99ff624a-f7e4-4941-b7ed-794cee704ba0/targets - [ ] To automatically regenerate this PR, check this box. --- .../protos/protos.d.ts | 12 +++ .../protos/protos.js | 78 ++++++++++++++++++- .../protos/protos.json | 13 +++- .../synth.metadata | 2 +- 4 files changed, 102 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts b/packages/google-cloud-bigquery-reservation/protos/protos.d.ts index 93a601ac367..7692daa259f 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-reservation/protos/protos.d.ts @@ -3613,6 +3613,9 @@ export namespace google { /** ResourceDescriptor singular */ singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); } /** Represents a ResourceDescriptor. */ @@ -3642,6 +3645,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 @@ -3721,6 +3727,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-bigquery-reservation/protos/protos.js b/packages/google-cloud-bigquery-reservation/protos/protos.js index e110b58369f..38914da3802 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.js +++ b/packages/google-cloud-bigquery-reservation/protos/protos.js @@ -8201,6 +8201,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 */ /** @@ -8213,6 +8214,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) @@ -8267,6 +8269,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 @@ -8304,6 +8314,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; }; @@ -8358,6 +8374,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; @@ -8421,6 +8447,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; }; @@ -8465,6 +8503,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; }; @@ -8481,8 +8536,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 = ""; @@ -8505,6 +8562,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; }; @@ -8535,6 +8597,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-bigquery-reservation/protos/protos.json b/packages/google-cloud-bigquery-reservation/protos/protos.json index 90fff85e009..d6784d817c1 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.json +++ b/packages/google-cloud-bigquery-reservation/protos/protos.json @@ -1084,6 +1084,11 @@ "singular": { "type": "string", "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 } }, "nested": { @@ -1093,6 +1098,12 @@ "ORIGINALLY_SINGLE_PATTERN": 1, "FUTURE_MULTI_PATTERN": 2 } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } } } }, @@ -1112,7 +1123,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-bigquery-reservation/synth.metadata b/packages/google-cloud-bigquery-reservation/synth.metadata index b4be2d5070c..77923a99944 100644 --- a/packages/google-cloud-bigquery-reservation/synth.metadata +++ b/packages/google-cloud-bigquery-reservation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-reservation.git", - "sha": "3fac6b6f38da08dbf2e61423f8473451adc2f010" + "sha": "5a48547293feab6c96de01e6c7e40a6364916862" } }, { From cef0d43fb55c9da8fb04c3552c3ae42c0ebb4e6b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 12 Jan 2021 18:38:05 +0000 Subject: [PATCH 029/105] chore: release 1.1.0 (#44) :robot: I have created a release \*beep\* \*boop\* --- ## [1.1.0](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.0.2...v1.1.0) (2021-01-09) ### Features * introduce style enumeration ([#43](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/43)) ([06bfdc6](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/06bfdc6a0c6c3b0416bbb34ff5b46e96256215ef)) ### Bug Fixes * **deps:** roll back dependency @google-cloud/bigquery-reservation to ^1.0.1 ([#38](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/38)) ([b4ee172](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/b4ee172520adbbdff077d2a1db7d72c88401f98a)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- .../google-cloud-bigquery-reservation/CHANGELOG.md | 12 ++++++++++++ .../google-cloud-bigquery-reservation/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/CHANGELOG.md b/packages/google-cloud-bigquery-reservation/CHANGELOG.md index a5d915fb62c..2dd30c3b592 100644 --- a/packages/google-cloud-bigquery-reservation/CHANGELOG.md +++ b/packages/google-cloud-bigquery-reservation/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [1.1.0](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.0.2...v1.1.0) (2021-01-09) + + +### Features + +* introduce style enumeration ([#43](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/43)) ([06bfdc6](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/06bfdc6a0c6c3b0416bbb34ff5b46e96256215ef)) + + +### Bug Fixes + +* **deps:** roll back dependency @google-cloud/bigquery-reservation to ^1.0.1 ([#38](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/38)) ([b4ee172](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/b4ee172520adbbdff077d2a1db7d72c88401f98a)) + ### [1.0.2](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.0.1...v1.0.2) (2020-11-25) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 10c348f7eb9..56f64eae8c9 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-reservation", - "version": "1.0.2", + "version": "1.1.0", "description": "BigQuery Reservation client for Node.js", "repository": "googleapis/nodejs-bigquery-reservation", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-reservation/samples/package.json b/packages/google-cloud-bigquery-reservation/samples/package.json index e7036dd669d..0ce9d4cf907 100644 --- a/packages/google-cloud-bigquery-reservation/samples/package.json +++ b/packages/google-cloud-bigquery-reservation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-reservation": "^1.0.1" + "@google-cloud/bigquery-reservation": "^1.1.0" }, "devDependencies": { "c8": "^7.1.0", From 512d36d48a5c55fb0db98f78957347f317bd0ac9 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 27 Jan 2021 08:44:27 -0800 Subject: [PATCH 030/105] refactor(nodejs): move build cop to flakybot (#46) 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-bigquery-reservation/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/synth.metadata b/packages/google-cloud-bigquery-reservation/synth.metadata index 77923a99944..a20d42a0db0 100644 --- a/packages/google-cloud-bigquery-reservation/synth.metadata +++ b/packages/google-cloud-bigquery-reservation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-reservation.git", - "sha": "5a48547293feab6c96de01e6c7e40a6364916862" + "sha": "c7e8f75c78ac2dc1fb041106f09a92ff17a6af98" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "363fe305e9ce34a6cd53951c6ee5f997094b54ee" + "sha": "57c23fa5705499a4181095ced81f0ee0933b64f6" } } ], From 2e0bfd913a8f6637fa320c0a546986ecebaf00b7 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 2 Feb 2021 17:54:10 -0800 Subject: [PATCH 031/105] chore: update CODEOWNERS config (#47) --- .../google-cloud-bigquery-reservation/.repo-metadata.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/.repo-metadata.json b/packages/google-cloud-bigquery-reservation/.repo-metadata.json index f476a3e9a21..5caa5822afb 100644 --- a/packages/google-cloud-bigquery-reservation/.repo-metadata.json +++ b/packages/google-cloud-bigquery-reservation/.repo-metadata.json @@ -9,5 +9,6 @@ "repo": "googleapis/nodejs-bigquery-reservation", "distribution_name": "@google-cloud/bigquery-reservation", "api_id": "bigqueryreservation.googleapis.com", - "requires_billing": true -} \ No newline at end of file + "requires_billing": true, + "codeowner_team": "@googleapis/api-bigquery" +} From c0f0051e2110c15a0c269eaa3f7a23778fba5dd0 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 3 Feb 2021 18:10:13 -0800 Subject: [PATCH 032/105] build: adds UNORDERED_LIST enum (#48) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/3c80116f-2a08-4668-9798-3d8677b45629/targets - [ ] To automatically regenerate this PR, check this box. --- .../google-cloud-bigquery-reservation/protos/protos.d.ts | 3 ++- .../google-cloud-bigquery-reservation/protos/protos.js | 7 +++++++ .../google-cloud-bigquery-reservation/protos/protos.json | 3 ++- packages/google-cloud-bigquery-reservation/synth.metadata | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts b/packages/google-cloud-bigquery-reservation/protos/protos.d.ts index 7692daa259f..0ce980cb796 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-reservation/protos/protos.d.ts @@ -3590,7 +3590,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-bigquery-reservation/protos/protos.js b/packages/google-cloud-bigquery-reservation/protos/protos.js index 38914da3802..53b96540fd5 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.js +++ b/packages/google-cloud-bigquery-reservation/protos/protos.js @@ -8177,6 +8177,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); @@ -8186,6 +8187,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; })(); @@ -14353,6 +14355,7 @@ case 3: case 4: case 5: + case 6: break; } } @@ -14453,6 +14456,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-bigquery-reservation/protos/protos.json b/packages/google-cloud-bigquery-reservation/protos/protos.json index d6784d817c1..00a0c5b289e 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.json +++ b/packages/google-cloud-bigquery-reservation/protos/protos.json @@ -1039,7 +1039,8 @@ "REQUIRED": 2, "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, - "IMMUTABLE": 5 + "IMMUTABLE": 5, + "UNORDERED_LIST": 6 } }, "resourceReference": { diff --git a/packages/google-cloud-bigquery-reservation/synth.metadata b/packages/google-cloud-bigquery-reservation/synth.metadata index a20d42a0db0..1b4ef4e0b28 100644 --- a/packages/google-cloud-bigquery-reservation/synth.metadata +++ b/packages/google-cloud-bigquery-reservation/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-reservation.git", - "sha": "c7e8f75c78ac2dc1fb041106f09a92ff17a6af98" + "sha": "df6d7f30b092c1b291f2682df2c6e40dee8c9f4c" } }, { From 3bf0d7dfcdd7930a07e7dea8db2bbb8e900cca61 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 7 Mar 2021 09:00:32 -0800 Subject: [PATCH 033/105] build: update gapic-generator-typescript to v1.2.10. (#49) 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-bigquery-reservation/synth.metadata | 6 +++--- .../google-cloud-bigquery-reservation/webpack.config.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/synth.metadata b/packages/google-cloud-bigquery-reservation/synth.metadata index 1b4ef4e0b28..e5fec067272 100644 --- a/packages/google-cloud-bigquery-reservation/synth.metadata +++ b/packages/google-cloud-bigquery-reservation/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-reservation.git", - "sha": "df6d7f30b092c1b291f2682df2c6e40dee8c9f4c" + "sha": "b5e73a947ebc2c15eb2713774db3f0e9b4ce60ff" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d189e871205fea665a9648f7c4676f027495ccaf", - "internalRef": "345596855" + "sha": "5477122b3e8037a1dc5bc920536158edbd151dc4", + "internalRef": "361273630" } }, { diff --git a/packages/google-cloud-bigquery-reservation/webpack.config.js b/packages/google-cloud-bigquery-reservation/webpack.config.js index eb09bada2de..8c448d5547d 100644 --- a/packages/google-cloud-bigquery-reservation/webpack.config.js +++ b/packages/google-cloud-bigquery-reservation/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 85831773639e60474f59fab045f40465b1f875b3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 23 Mar 2021 17:52:18 +0100 Subject: [PATCH 034/105] chore(deps): update dependency sinon to v10 (#50) [![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.2` -> `^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-bigquery-reservation). --- packages/google-cloud-bigquery-reservation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 56f64eae8c9..286aeee3d4d 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -56,7 +56,7 @@ "mocha": "^8.0.1", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^9.0.2", + "sinon": "^10.0.0", "ts-loader": "^8.0.0", "typescript": "^3.9.6", "webpack": "^5.0.0", From a50459633071a3d9540458e08d7747613fd673bd Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Thu, 1 Apr 2021 23:53:50 -0700 Subject: [PATCH 035/105] chore: migrate to owl bot (#51) * chore: migrate to owl bot * chore: copy files from googleapis-gen fb91803ccef5d7c695139b22788b309e2197856b * chore: run the post processor --- .../.github/.OwlBot.yaml | 28 +++++++++++++ .../.repo-metadata.json | 17 ++++---- .../src/index.ts | 8 ++-- .../synth.metadata | 37 ----------------- .../synth.py | 40 ------------------- 5 files changed, 42 insertions(+), 88 deletions(-) create mode 100644 packages/google-cloud-bigquery-reservation/.github/.OwlBot.yaml delete mode 100644 packages/google-cloud-bigquery-reservation/synth.metadata delete mode 100644 packages/google-cloud-bigquery-reservation/synth.py diff --git a/packages/google-cloud-bigquery-reservation/.github/.OwlBot.yaml b/packages/google-cloud-bigquery-reservation/.github/.OwlBot.yaml new file mode 100644 index 00000000000..3486c47fa21 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/.github/.OwlBot.yaml @@ -0,0 +1,28 @@ +# 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/v1beta1 + +deep-copy-regex: + - source: /google/cloud/bigquery/reservation/(.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 + +begin-after-commit-hash: fb91803ccef5d7c695139b22788b309e2197856b + diff --git a/packages/google-cloud-bigquery-reservation/.repo-metadata.json b/packages/google-cloud-bigquery-reservation/.repo-metadata.json index 5caa5822afb..09e1763f235 100644 --- a/packages/google-cloud-bigquery-reservation/.repo-metadata.json +++ b/packages/google-cloud-bigquery-reservation/.repo-metadata.json @@ -1,14 +1,15 @@ { - "name": "bigqueryreservation", - "name_pretty": "Google BigQuery Reservation", - "product_documentation": "https://cloud.google.com/bigquery/docs/reference/reservations", - "client_documentation": "https://googleapis.dev/nodejs/bigqueryreservation/latest", - "issue_tracker": "https://b.corp.google.com/savedsearches/559654", - "release_level": "ga", "language": "nodejs", "repo": "googleapis/nodejs-bigquery-reservation", - "distribution_name": "@google-cloud/bigquery-reservation", + "name": "bigqueryreservation", + "issue_tracker": "https://b.corp.google.com/savedsearches/559654", + "default_version": "v1", "api_id": "bigqueryreservation.googleapis.com", + "distribution_name": "@google-cloud/bigquery-reservation", "requires_billing": true, - "codeowner_team": "@googleapis/api-bigquery" + "product_documentation": "https://cloud.google.com/bigquery/docs/reference/reservations", + "codeowner_team": "@googleapis/api-bigquery", + "name_pretty": "Google BigQuery Reservation", + "client_documentation": "https://googleapis.dev/nodejs/bigqueryreservation/latest", + "release_level": "ga" } diff --git a/packages/google-cloud-bigquery-reservation/src/index.ts b/packages/google-cloud-bigquery-reservation/src/index.ts index 0d452a1e493..228457ddf0b 100644 --- a/packages/google-cloud-bigquery-reservation/src/index.ts +++ b/packages/google-cloud-bigquery-reservation/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,13 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. // -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** import * as v1 from './v1'; + const ReservationServiceClient = v1.ReservationServiceClient; type ReservationServiceClient = v1.ReservationServiceClient; + export {v1, ReservationServiceClient}; export default {v1, ReservationServiceClient}; import * as protos from '../protos/protos'; diff --git a/packages/google-cloud-bigquery-reservation/synth.metadata b/packages/google-cloud-bigquery-reservation/synth.metadata deleted file mode 100644 index e5fec067272..00000000000 --- a/packages/google-cloud-bigquery-reservation/synth.metadata +++ /dev/null @@ -1,37 +0,0 @@ -{ - "sources": [ - { - "git": { - "name": ".", - "remote": "https://github.com/googleapis/nodejs-bigquery-reservation.git", - "sha": "b5e73a947ebc2c15eb2713774db3f0e9b4ce60ff" - } - }, - { - "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": "bigquery-reservation", - "apiVersion": "v1", - "language": "nodejs", - "generator": "bazel" - } - } - ] -} \ No newline at end of file diff --git a/packages/google-cloud-bigquery-reservation/synth.py b/packages/google-cloud-bigquery-reservation/synth.py deleted file mode 100644 index ba9341780dc..00000000000 --- a/packages/google-cloud-bigquery-reservation/synth.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""This script is used to synthesize generated parts of this library.""" - -import synthtool as s -import synthtool.gcp as gcp -import subprocess -import logging - -logging.basicConfig(level=logging.DEBUG) - -# run the gapic generator -gapic = gcp.GAPICBazel() -versions = ['v1'] -name = 'bigquery-reservation' -for version in versions: - library = gapic.node_library( - name, version, proto_path='google/cloud/bigquery/reservation/v1') -s.copy(library, excludes=['README.md', 'package.json']) - -# Copy common templates -common_templates = gcp.CommonTemplates() -templates = common_templates.node_library(source_location='build/src') -s.copy(templates, excludes=[]) - -# Node.js specific cleanup -subprocess.run(['npm', 'install']) -subprocess.run(['npm', 'run', 'fix']) -subprocess.run(['npx', 'compileProtos', 'src']) \ No newline at end of file From bd4509cfb3a37d74221f8d45b1f6966bf3d71a1f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 14 Apr 2021 23:12:09 +0200 Subject: [PATCH 036/105] chore(deps): update dependency @types/sinon to v10 (#55) [![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.4` -> `^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-bigquery-reservation). --- packages/google-cloud-bigquery-reservation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 286aeee3d4d..c08693c3d62 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -46,7 +46,7 @@ "devDependencies": { "@types/mocha": "^8.0.0", "@types/node": "^14.0.19", - "@types/sinon": "^9.0.4", + "@types/sinon": "^10.0.0", "c8": "^7.2.0", "gts": "^2.0.2", "jsdoc": "^3.6.4", From 3acbebdbf5e8e4d2999cfbe98cacfcfce352b6d2 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 6 May 2021 17:48:06 -0700 Subject: [PATCH 037/105] fix(deps): require google-gax v2.12.0 (#64) --- packages/google-cloud-bigquery-reservation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index c08693c3d62..3cba9b536a3 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -41,7 +41,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 9ccc7f9dcdfaf8f891efe19d91ee969facad4c74 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:01:02 +0000 Subject: [PATCH 038/105] chore: new owl bot post processor docker image (#66) gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:f93bb861d6f12574437bb9aee426b71eafd63b419669ff0ed029f4b7e7162e3f --- .../protos/protos.d.ts | 10 +- .../protos/protos.js | 20 +- .../src/v1/reservation_service_client.ts | 266 +++++----- .../test/gapic_reservation_service_v1.ts | 477 +++++++++--------- 4 files changed, 360 insertions(+), 413 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts b/packages/google-cloud-bigquery-reservation/protos/protos.d.ts index 0ce980cb796..63bb479a960 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-reservation/protos/protos.d.ts @@ -3387,19 +3387,19 @@ export namespace google { public selector: string; /** HttpRule get. */ - public get: string; + public get?: (string|null); /** HttpRule put. */ - public put: string; + public put?: (string|null); /** HttpRule post. */ - public post: string; + public post?: (string|null); /** HttpRule delete. */ - public delete: string; + public delete?: (string|null); /** HttpRule patch. */ - public patch: string; + public patch?: (string|null); /** HttpRule custom. */ public custom?: (google.api.ICustomHttpPattern|null); diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.js b/packages/google-cloud-bigquery-reservation/protos/protos.js index 53b96540fd5..8b019378739 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.js +++ b/packages/google-cloud-bigquery-reservation/protos/protos.js @@ -7538,43 +7538,43 @@ /** * HttpRule get. - * @member {string} get + * @member {string|null|undefined} get * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.get = ""; + HttpRule.prototype.get = null; /** * HttpRule put. - * @member {string} put + * @member {string|null|undefined} put * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.put = ""; + HttpRule.prototype.put = null; /** * HttpRule post. - * @member {string} post + * @member {string|null|undefined} post * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.post = ""; + HttpRule.prototype.post = null; /** * HttpRule delete. - * @member {string} delete + * @member {string|null|undefined} delete * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype["delete"] = ""; + HttpRule.prototype["delete"] = null; /** * HttpRule patch. - * @member {string} patch + * @member {string|null|undefined} patch * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.patch = ""; + HttpRule.prototype.patch = null; /** * HttpRule custom. diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index 544310638dd..e74fb67a073 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts @@ -295,13 +295,14 @@ export class ReservationServiceClient { ]; for (const methodName of reservationServiceStubMethods) { const callPromise = this.reservationServiceStub.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; } @@ -472,11 +473,10 @@ export class ReservationServiceClient { 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.createReservation(request, options, callback); } @@ -571,11 +571,10 @@ export class ReservationServiceClient { 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.getReservation(request, options, callback); } @@ -672,11 +671,10 @@ export class ReservationServiceClient { 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.deleteReservation(request, options, callback); } @@ -772,11 +770,10 @@ export class ReservationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'reservation.name': request.reservation!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'reservation.name': request.reservation!.name || '', + }); this.initialize(); return this.innerApiCalls.updateReservation(request, options, callback); } @@ -876,11 +873,10 @@ export class ReservationServiceClient { 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.createCapacityCommitment( request, @@ -979,11 +975,10 @@ export class ReservationServiceClient { 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.getCapacityCommitment(request, options, callback); } @@ -1080,11 +1075,10 @@ export class ReservationServiceClient { 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.deleteCapacityCommitment( request, @@ -1190,11 +1184,10 @@ export class ReservationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'capacity_commitment.name': request.capacityCommitment!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'capacity_commitment.name': request.capacityCommitment!.name || '', + }); this.initialize(); return this.innerApiCalls.updateCapacityCommitment( request, @@ -1302,11 +1295,10 @@ export class ReservationServiceClient { 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.splitCapacityCommitment( request, @@ -1417,11 +1409,10 @@ export class ReservationServiceClient { 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.mergeCapacityCommitments( request, @@ -1551,11 +1542,10 @@ export class ReservationServiceClient { 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.createAssignment(request, options, callback); } @@ -1664,11 +1654,10 @@ export class ReservationServiceClient { 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.deleteAssignment(request, options, callback); } @@ -1771,11 +1760,10 @@ export class ReservationServiceClient { 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.moveAssignment(request, options, callback); } @@ -1870,11 +1858,10 @@ export class ReservationServiceClient { 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.getBiReservation(request, options, callback); } @@ -1977,11 +1964,10 @@ export class ReservationServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'bi_reservation.name': request.biReservation!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'bi_reservation.name': request.biReservation!.name || '', + }); this.initialize(); return this.innerApiCalls.updateBiReservation(request, options, callback); } @@ -2078,11 +2064,10 @@ export class ReservationServiceClient { 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.listReservations(request, options, callback); } @@ -2118,11 +2103,10 @@ export class ReservationServiceClient { 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.listReservations.createStream( @@ -2169,17 +2153,16 @@ export class ReservationServiceClient { 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.listReservations.asyncIterate( this.innerApiCalls['listReservations'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -2275,11 +2258,10 @@ export class ReservationServiceClient { 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.listCapacityCommitments( request, @@ -2319,11 +2301,10 @@ export class ReservationServiceClient { 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.listCapacityCommitments.createStream( @@ -2370,17 +2351,16 @@ export class ReservationServiceClient { 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.listCapacityCommitments.asyncIterate( this.innerApiCalls['listCapacityCommitments'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -2501,11 +2481,10 @@ export class ReservationServiceClient { 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.listAssignments(request, options, callback); } @@ -2546,11 +2525,10 @@ export class ReservationServiceClient { 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.listAssignments.createStream( @@ -2602,17 +2580,16 @@ export class ReservationServiceClient { 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.listAssignments.asyncIterate( this.innerApiCalls['listAssignments'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -2739,11 +2716,10 @@ export class ReservationServiceClient { 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.searchAssignments(request, options, callback); } @@ -2788,11 +2764,10 @@ export class ReservationServiceClient { 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.searchAssignments.createStream( @@ -2848,17 +2823,16 @@ export class ReservationServiceClient { 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.searchAssignments.asyncIterate( this.innerApiCalls['searchAssignments'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts index d3b02abe9a5..e8586b3d53d 100644 --- a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts +++ b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.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; @@ -249,9 +248,8 @@ describe('v1.ReservationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() ); - client.innerApiCalls.createReservation = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createReservation = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createReservation( request, @@ -361,9 +359,8 @@ describe('v1.ReservationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() ); - client.innerApiCalls.getReservation = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getReservation = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getReservation( request, @@ -473,9 +470,8 @@ describe('v1.ReservationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteReservation = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteReservation = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteReservation( request, @@ -587,9 +583,8 @@ describe('v1.ReservationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() ); - client.innerApiCalls.updateReservation = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateReservation = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateReservation( request, @@ -669,9 +664,8 @@ describe('v1.ReservationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); - client.innerApiCalls.createCapacityCommitment = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.createCapacityCommitment = + stubSimpleCall(expectedResponse); const [response] = await client.createCapacityCommitment(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -702,9 +696,8 @@ describe('v1.ReservationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); - client.innerApiCalls.createCapacityCommitment = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createCapacityCommitment = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createCapacityCommitment( request, @@ -786,9 +779,8 @@ describe('v1.ReservationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); - client.innerApiCalls.getCapacityCommitment = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.getCapacityCommitment = + stubSimpleCall(expectedResponse); const [response] = await client.getCapacityCommitment(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -819,9 +811,8 @@ describe('v1.ReservationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); - client.innerApiCalls.getCapacityCommitment = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getCapacityCommitment = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getCapacityCommitment( request, @@ -903,9 +894,8 @@ describe('v1.ReservationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteCapacityCommitment = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.deleteCapacityCommitment = + stubSimpleCall(expectedResponse); const [response] = await client.deleteCapacityCommitment(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -936,9 +926,8 @@ describe('v1.ReservationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteCapacityCommitment = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteCapacityCommitment = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteCapacityCommitment( request, @@ -1021,9 +1010,8 @@ describe('v1.ReservationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); - client.innerApiCalls.updateCapacityCommitment = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.updateCapacityCommitment = + stubSimpleCall(expectedResponse); const [response] = await client.updateCapacityCommitment(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1055,9 +1043,8 @@ describe('v1.ReservationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); - client.innerApiCalls.updateCapacityCommitment = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateCapacityCommitment = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateCapacityCommitment( request, @@ -1140,9 +1127,8 @@ describe('v1.ReservationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse() ); - client.innerApiCalls.splitCapacityCommitment = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.splitCapacityCommitment = + stubSimpleCall(expectedResponse); const [response] = await client.splitCapacityCommitment(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1173,9 +1159,8 @@ describe('v1.ReservationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse() ); - client.innerApiCalls.splitCapacityCommitment = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.splitCapacityCommitment = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.splitCapacityCommitment( request, @@ -1257,9 +1242,8 @@ describe('v1.ReservationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); - client.innerApiCalls.mergeCapacityCommitments = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.mergeCapacityCommitments = + stubSimpleCall(expectedResponse); const [response] = await client.mergeCapacityCommitments(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1290,9 +1274,8 @@ describe('v1.ReservationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); - client.innerApiCalls.mergeCapacityCommitments = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.mergeCapacityCommitments = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.mergeCapacityCommitments( request, @@ -1405,9 +1388,8 @@ describe('v1.ReservationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() ); - client.innerApiCalls.createAssignment = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createAssignment = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createAssignment( request, @@ -1517,9 +1499,8 @@ describe('v1.ReservationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteAssignment = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteAssignment = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteAssignment( request, @@ -1629,9 +1610,8 @@ describe('v1.ReservationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() ); - client.innerApiCalls.moveAssignment = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.moveAssignment = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.moveAssignment( request, @@ -1741,9 +1721,8 @@ describe('v1.ReservationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.BiReservation() ); - client.innerApiCalls.getBiReservation = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getBiReservation = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getBiReservation( request, @@ -1823,9 +1802,8 @@ describe('v1.ReservationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.BiReservation() ); - client.innerApiCalls.updateBiReservation = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.updateBiReservation = + stubSimpleCall(expectedResponse); const [response] = await client.updateBiReservation(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1857,9 +1835,8 @@ describe('v1.ReservationServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.BiReservation() ); - client.innerApiCalls.updateBiReservation = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateBiReservation = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateBiReservation( request, @@ -1986,9 +1963,8 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.Reservation() ), ]; - client.innerApiCalls.listReservations = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listReservations = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listReservations( request, @@ -2068,12 +2044,12 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.Reservation() ), ]; - client.descriptors.page.listReservations.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listReservations.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listReservationsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.bigquery.reservation.v1.Reservation[] = []; + const responses: protos.google.cloud.bigquery.reservation.v1.Reservation[] = + []; stream.on( 'data', ( @@ -2097,10 +2073,9 @@ describe('v1.ReservationServiceClient', () => { .calledWith(client.innerApiCalls.listReservations, request) ); assert.strictEqual( - (client.descriptors.page.listReservations - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listReservations.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2117,13 +2092,12 @@ describe('v1.ReservationServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listReservations.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listReservations.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listReservationsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.bigquery.reservation.v1.Reservation[] = []; + const responses: protos.google.cloud.bigquery.reservation.v1.Reservation[] = + []; stream.on( 'data', ( @@ -2146,10 +2120,9 @@ describe('v1.ReservationServiceClient', () => { .calledWith(client.innerApiCalls.listReservations, request) ); assert.strictEqual( - (client.descriptors.page.listReservations - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listReservations.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2176,25 +2149,25 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.Reservation() ), ]; - client.descriptors.page.listReservations.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.bigquery.reservation.v1.IReservation[] = []; + client.descriptors.page.listReservations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.reservation.v1.IReservation[] = + []; const iterable = client.listReservationsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listReservations - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listReservations.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listReservations - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listReservations.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2211,27 +2184,26 @@ describe('v1.ReservationServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listReservations.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listReservations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listReservationsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.bigquery.reservation.v1.IReservation[] = []; + const responses: protos.google.cloud.bigquery.reservation.v1.IReservation[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listReservations - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listReservations.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listReservations - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listReservations.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2267,9 +2239,8 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ), ]; - client.innerApiCalls.listCapacityCommitments = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.listCapacityCommitments = + stubSimpleCall(expectedResponse); const [response] = await client.listCapacityCommitments(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -2308,9 +2279,8 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ), ]; - client.innerApiCalls.listCapacityCommitments = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listCapacityCommitments = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listCapacityCommitments( request, @@ -2393,12 +2363,12 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ), ]; - client.descriptors.page.listCapacityCommitments.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listCapacityCommitments.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listCapacityCommitmentsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.bigquery.reservation.v1.CapacityCommitment[] = []; + const responses: protos.google.cloud.bigquery.reservation.v1.CapacityCommitment[] = + []; stream.on( 'data', ( @@ -2417,16 +2387,18 @@ describe('v1.ReservationServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listCapacityCommitments - .createStream as SinonStub) + ( + client.descriptors.page.listCapacityCommitments + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listCapacityCommitments, request) ); assert.strictEqual( - (client.descriptors.page.listCapacityCommitments - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCapacityCommitments + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2443,13 +2415,12 @@ describe('v1.ReservationServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listCapacityCommitments.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listCapacityCommitments.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listCapacityCommitmentsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.bigquery.reservation.v1.CapacityCommitment[] = []; + const responses: protos.google.cloud.bigquery.reservation.v1.CapacityCommitment[] = + []; stream.on( 'data', ( @@ -2467,16 +2438,18 @@ describe('v1.ReservationServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listCapacityCommitments - .createStream as SinonStub) + ( + client.descriptors.page.listCapacityCommitments + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listCapacityCommitments, request) ); assert.strictEqual( - (client.descriptors.page.listCapacityCommitments - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCapacityCommitments + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2503,25 +2476,27 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ), ]; - client.descriptors.page.listCapacityCommitments.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment[] = []; + client.descriptors.page.listCapacityCommitments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment[] = + []; const iterable = client.listCapacityCommitmentsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listCapacityCommitments - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listCapacityCommitments + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listCapacityCommitments - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCapacityCommitments + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2538,27 +2513,28 @@ describe('v1.ReservationServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listCapacityCommitments.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listCapacityCommitments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listCapacityCommitmentsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment[] = []; + const responses: protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listCapacityCommitments - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listCapacityCommitments + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listCapacityCommitments - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listCapacityCommitments + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2633,9 +2609,8 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.Assignment() ), ]; - client.innerApiCalls.listAssignments = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listAssignments = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listAssignments( request, @@ -2715,12 +2690,12 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.Assignment() ), ]; - client.descriptors.page.listAssignments.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listAssignments.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listAssignmentsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.bigquery.reservation.v1.Assignment[] = []; + const responses: protos.google.cloud.bigquery.reservation.v1.Assignment[] = + []; stream.on( 'data', ( @@ -2744,10 +2719,9 @@ describe('v1.ReservationServiceClient', () => { .calledWith(client.innerApiCalls.listAssignments, request) ); assert.strictEqual( - (client.descriptors.page.listAssignments - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listAssignments.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2764,13 +2738,12 @@ describe('v1.ReservationServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listAssignments.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listAssignments.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listAssignmentsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.bigquery.reservation.v1.Assignment[] = []; + const responses: protos.google.cloud.bigquery.reservation.v1.Assignment[] = + []; stream.on( 'data', ( @@ -2793,10 +2766,9 @@ describe('v1.ReservationServiceClient', () => { .calledWith(client.innerApiCalls.listAssignments, request) ); assert.strictEqual( - (client.descriptors.page.listAssignments - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listAssignments.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2823,25 +2795,25 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.Assignment() ), ]; - client.descriptors.page.listAssignments.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.bigquery.reservation.v1.IAssignment[] = []; + client.descriptors.page.listAssignments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.reservation.v1.IAssignment[] = + []; const iterable = client.listAssignmentsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listAssignments - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listAssignments.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listAssignments - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listAssignments.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2858,27 +2830,26 @@ describe('v1.ReservationServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listAssignments.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listAssignments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listAssignmentsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.bigquery.reservation.v1.IAssignment[] = []; + const responses: protos.google.cloud.bigquery.reservation.v1.IAssignment[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listAssignments - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listAssignments.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listAssignments - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listAssignments.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -2953,9 +2924,8 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.Assignment() ), ]; - client.innerApiCalls.searchAssignments = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.searchAssignments = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.searchAssignments( request, @@ -3035,12 +3005,12 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.Assignment() ), ]; - client.descriptors.page.searchAssignments.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.searchAssignments.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.searchAssignmentsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.bigquery.reservation.v1.Assignment[] = []; + const responses: protos.google.cloud.bigquery.reservation.v1.Assignment[] = + []; stream.on( 'data', ( @@ -3064,10 +3034,9 @@ describe('v1.ReservationServiceClient', () => { .calledWith(client.innerApiCalls.searchAssignments, request) ); assert.strictEqual( - (client.descriptors.page.searchAssignments - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.searchAssignments.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3084,13 +3053,12 @@ describe('v1.ReservationServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.searchAssignments.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.searchAssignments.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.searchAssignmentsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.bigquery.reservation.v1.Assignment[] = []; + const responses: protos.google.cloud.bigquery.reservation.v1.Assignment[] = + []; stream.on( 'data', ( @@ -3113,10 +3081,9 @@ describe('v1.ReservationServiceClient', () => { .calledWith(client.innerApiCalls.searchAssignments, request) ); assert.strictEqual( - (client.descriptors.page.searchAssignments - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.searchAssignments.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3143,25 +3110,25 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.Assignment() ), ]; - client.descriptors.page.searchAssignments.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.bigquery.reservation.v1.IAssignment[] = []; + client.descriptors.page.searchAssignments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.reservation.v1.IAssignment[] = + []; const iterable = client.searchAssignmentsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.searchAssignments - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.searchAssignments.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.searchAssignments - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.searchAssignments.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3178,27 +3145,26 @@ describe('v1.ReservationServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.searchAssignments.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.searchAssignments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.searchAssignmentsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.bigquery.reservation.v1.IAssignment[] = []; + const responses: protos.google.cloud.bigquery.reservation.v1.IAssignment[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.searchAssignments - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.searchAssignments.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.searchAssignments - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.searchAssignments.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -3360,8 +3326,10 @@ describe('v1.ReservationServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.capacityCommitmentPathTemplate - .render as SinonStub) + ( + client.pathTemplates.capacityCommitmentPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -3371,8 +3339,10 @@ describe('v1.ReservationServiceClient', () => { const result = client.matchProjectFromCapacityCommitmentName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.capacityCommitmentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.capacityCommitmentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -3382,21 +3352,24 @@ describe('v1.ReservationServiceClient', () => { const result = client.matchLocationFromCapacityCommitmentName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.capacityCommitmentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.capacityCommitmentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchCapacityCommitmentFromCapacityCommitmentName', () => { - const result = client.matchCapacityCommitmentFromCapacityCommitmentName( - fakePath - ); + const result = + client.matchCapacityCommitmentFromCapacityCommitmentName(fakePath); assert.strictEqual(result, 'capacityCommitmentValue'); assert( - (client.pathTemplates.capacityCommitmentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.capacityCommitmentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); From 0b5186c409a21c9ad654fe8aa39a0a7ccfbb69d6 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:26 +0000 Subject: [PATCH 039/105] fix: use require() to load JSON protos (#67) 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/reservation_service_client.ts | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index e74fb67a073..56628ef2110 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_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/v1/reservation_service_client_config.json`. @@ -159,22 +160,7 @@ export class ReservationServiceClient { 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. From 0d03351ece83a9628a96b19d73f39aa0be8415df 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:49 +0000 Subject: [PATCH 040/105] chore: update gapic-generator-typescript to v1.3.2 (#68) Committer: @alexander-fenster PiperOrigin-RevId: 372656503 Source-Link: https://github.com/googleapis/googleapis/commit/6fa858c6489b1bbc505a7d7afe39f2dc45819c38 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d7c95df3ab1ea1b4c22a4542bad4924cc46d1388 --- .../src/v1/reservation_service_client.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index 56628ef2110..af8ed64136f 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_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 714686a552d574bfa94a6335dccfd219f89af9fb Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 13 May 2021 10:29:01 -0700 Subject: [PATCH 041/105] chore: release 1.1.1 (#65) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-bigquery-reservation/CHANGELOG.md | 8 ++++++++ packages/google-cloud-bigquery-reservation/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/CHANGELOG.md b/packages/google-cloud-bigquery-reservation/CHANGELOG.md index 2dd30c3b592..2ad8eb54e81 100644 --- a/packages/google-cloud-bigquery-reservation/CHANGELOG.md +++ b/packages/google-cloud-bigquery-reservation/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [1.1.1](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.0...v1.1.1) (2021-05-12) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#64](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/64)) ([57b7f5b](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/57b7f5b3356bf9f00d28d3a0d8b4c329ae8d61b9)) +* use require() to load JSON protos ([#67](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/67)) ([ea052ed](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/ea052ed26f0474c849def47d73d41c0ebdc9f432)) + ## [1.1.0](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.0.2...v1.1.0) (2021-01-09) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 3cba9b536a3..b97984910e4 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-reservation", - "version": "1.1.0", + "version": "1.1.1", "description": "BigQuery Reservation client for Node.js", "repository": "googleapis/nodejs-bigquery-reservation", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-reservation/samples/package.json b/packages/google-cloud-bigquery-reservation/samples/package.json index 0ce9d4cf907..63c36968c1e 100644 --- a/packages/google-cloud-bigquery-reservation/samples/package.json +++ b/packages/google-cloud-bigquery-reservation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-reservation": "^1.1.0" + "@google-cloud/bigquery-reservation": "^1.1.1" }, "devDependencies": { "c8": "^7.1.0", From 7f269b89027b730838992fc5001bdecdb4172f22 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 25 May 2021 18:00:15 +0200 Subject: [PATCH 042/105] chore(deps): update dependency sinon to v11 (#71) 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-bigquery-reservation). --- packages/google-cloud-bigquery-reservation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index b97984910e4..c99d8d045b8 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -56,7 +56,7 @@ "mocha": "^8.0.1", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^10.0.0", + "sinon": "^11.0.0", "ts-loader": "^8.0.0", "typescript": "^3.9.6", "webpack": "^5.0.0", From e6cda03ac0a11d167fd9eb6e195fe84107487a84 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:49 +0000 Subject: [PATCH 043/105] fix: GoogleAdsError missing using generator version after 1.3.0 (#72) [PR](https://github.com/googleapis/gapic-generator-typescript/pull/878) within updated gapic-generator-typescript version 1.4.0 Committer: @summer-ji-eng PiperOrigin-RevId: 375759421 Source-Link: https://github.com/googleapis/googleapis/commit/95fa72fdd0d69b02d72c33b37d1e4cc66d4b1446 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f40a34377ad488a7c2bc3992b3c8d5faf5a15c46 --- .../src/v1/reservation_service_client.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index af8ed64136f..6318c1138a2 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts @@ -154,6 +154,8 @@ export class ReservationServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); From 9554cdcece38cf648fa7d490321668d26b7dd8ec Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 7 Jun 2021 13:25:34 -0700 Subject: [PATCH 044/105] chore: release 1.1.2 (#73) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-bigquery-reservation/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-reservation/package.json | 2 +- .../google-cloud-bigquery-reservation/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/CHANGELOG.md b/packages/google-cloud-bigquery-reservation/CHANGELOG.md index 2ad8eb54e81..d6ed7aa23e9 100644 --- a/packages/google-cloud-bigquery-reservation/CHANGELOG.md +++ b/packages/google-cloud-bigquery-reservation/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.1.2](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.1...v1.1.2) (2021-06-07) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#72](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/72)) ([17a06f7](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/17a06f7921e7c0200f1ff73ed29cd03c4c85b560)) + ### [1.1.1](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.0...v1.1.1) (2021-05-12) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index c99d8d045b8..eda7481eb72 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-reservation", - "version": "1.1.1", + "version": "1.1.2", "description": "BigQuery Reservation client for Node.js", "repository": "googleapis/nodejs-bigquery-reservation", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-reservation/samples/package.json b/packages/google-cloud-bigquery-reservation/samples/package.json index 63c36968c1e..b0e9934262a 100644 --- a/packages/google-cloud-bigquery-reservation/samples/package.json +++ b/packages/google-cloud-bigquery-reservation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-reservation": "^1.1.1" + "@google-cloud/bigquery-reservation": "^1.1.2" }, "devDependencies": { "c8": "^7.1.0", From d7f5b51692af9047b33f811b6a836c92c335ed78 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Fri, 11 Jun 2021 01:00:12 +0200 Subject: [PATCH 045/105] chore(nodejs): remove api-extractor dependencies (#78) --- packages/google-cloud-bigquery-reservation/package.json | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index eda7481eb72..6def75b7dba 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -36,9 +36,7 @@ "prepare": "npm run compile-protos && npm run compile", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test", - "api-extractor": "api-extractor run --local", - "api-documenter": "api-documenter yaml --input-folder=temp" + "test": "c8 mocha build/test" }, "dependencies": { "google-gax": "^2.12.0" @@ -60,9 +58,7 @@ "ts-loader": "^8.0.0", "typescript": "^3.9.6", "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" }, "engines": { "node": ">=10.0.0" From 182c0862971f2cf16af2c82280aee74657628bcc 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:20:46 +0000 Subject: [PATCH 046/105] fix: make request optional in all cases (#80) ... 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/reservation_service_client.ts | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index 6318c1138a2..ebfa7476769 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts @@ -365,7 +365,7 @@ export class ReservationServiceClient { // -- Service calls -- // ------------------- createReservation( - request: protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest, + request?: protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest, options?: CallOptions ): Promise< [ @@ -422,7 +422,7 @@ export class ReservationServiceClient { * const [response] = await client.createReservation(request); */ createReservation( - request: protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest, + request?: protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest, optionsOrCallback?: | CallOptions | Callback< @@ -468,7 +468,7 @@ export class ReservationServiceClient { return this.innerApiCalls.createReservation(request, options, callback); } getReservation( - request: protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest, options?: CallOptions ): Promise< [ @@ -520,7 +520,7 @@ export class ReservationServiceClient { * const [response] = await client.getReservation(request); */ getReservation( - request: protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest, optionsOrCallback?: | CallOptions | Callback< @@ -566,7 +566,7 @@ export class ReservationServiceClient { return this.innerApiCalls.getReservation(request, options, callback); } deleteReservation( - request: protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, options?: CallOptions ): Promise< [ @@ -620,7 +620,7 @@ export class ReservationServiceClient { * const [response] = await client.deleteReservation(request); */ deleteReservation( - request: protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, optionsOrCallback?: | CallOptions | Callback< @@ -666,7 +666,7 @@ export class ReservationServiceClient { return this.innerApiCalls.deleteReservation(request, options, callback); } updateReservation( - request: protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, options?: CallOptions ): Promise< [ @@ -719,7 +719,7 @@ export class ReservationServiceClient { * const [response] = await client.updateReservation(request); */ updateReservation( - request: protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, optionsOrCallback?: | CallOptions | Callback< @@ -765,7 +765,7 @@ export class ReservationServiceClient { return this.innerApiCalls.updateReservation(request, options, callback); } createCapacityCommitment( - request: protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, + request?: protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, options?: CallOptions ): Promise< [ @@ -822,7 +822,7 @@ export class ReservationServiceClient { * const [response] = await client.createCapacityCommitment(request); */ createCapacityCommitment( - request: protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, + request?: protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, optionsOrCallback?: | CallOptions | Callback< @@ -872,7 +872,7 @@ export class ReservationServiceClient { ); } getCapacityCommitment( - request: protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, options?: CallOptions ): Promise< [ @@ -924,7 +924,7 @@ export class ReservationServiceClient { * const [response] = await client.getCapacityCommitment(request); */ getCapacityCommitment( - request: protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, optionsOrCallback?: | CallOptions | Callback< @@ -970,7 +970,7 @@ export class ReservationServiceClient { return this.innerApiCalls.getCapacityCommitment(request, options, callback); } deleteCapacityCommitment( - request: protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, options?: CallOptions ): Promise< [ @@ -1024,7 +1024,7 @@ export class ReservationServiceClient { * const [response] = await client.deleteCapacityCommitment(request); */ deleteCapacityCommitment( - request: protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1074,7 +1074,7 @@ export class ReservationServiceClient { ); } updateCapacityCommitment( - request: protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, options?: CallOptions ): Promise< [ @@ -1133,7 +1133,7 @@ export class ReservationServiceClient { * const [response] = await client.updateCapacityCommitment(request); */ updateCapacityCommitment( - request: protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1183,7 +1183,7 @@ export class ReservationServiceClient { ); } splitCapacityCommitment( - request: protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, + request?: protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, options?: CallOptions ): Promise< [ @@ -1244,7 +1244,7 @@ export class ReservationServiceClient { * const [response] = await client.splitCapacityCommitment(request); */ splitCapacityCommitment( - request: protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, + request?: protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1294,7 +1294,7 @@ export class ReservationServiceClient { ); } mergeCapacityCommitments( - request: protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, options?: CallOptions ): Promise< [ @@ -1358,7 +1358,7 @@ export class ReservationServiceClient { * const [response] = await client.mergeCapacityCommitments(request); */ mergeCapacityCommitments( - request: protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1408,7 +1408,7 @@ export class ReservationServiceClient { ); } createAssignment( - request: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, + request?: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, options?: CallOptions ): Promise< [ @@ -1491,7 +1491,7 @@ export class ReservationServiceClient { * const [response] = await client.createAssignment(request); */ createAssignment( - request: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, + request?: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1537,7 +1537,7 @@ export class ReservationServiceClient { return this.innerApiCalls.createAssignment(request, options, callback); } deleteAssignment( - request: protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, options?: CallOptions ): Promise< [ @@ -1603,7 +1603,7 @@ export class ReservationServiceClient { * const [response] = await client.deleteAssignment(request); */ deleteAssignment( - request: protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1649,7 +1649,7 @@ export class ReservationServiceClient { return this.innerApiCalls.deleteAssignment(request, options, callback); } moveAssignment( - request: protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, options?: CallOptions ): Promise< [ @@ -1709,7 +1709,7 @@ export class ReservationServiceClient { * const [response] = await client.moveAssignment(request); */ moveAssignment( - request: protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1755,7 +1755,7 @@ export class ReservationServiceClient { return this.innerApiCalls.moveAssignment(request, options, callback); } getBiReservation( - request: protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, options?: CallOptions ): Promise< [ @@ -1807,7 +1807,7 @@ export class ReservationServiceClient { * const [response] = await client.getBiReservation(request); */ getBiReservation( - request: protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1853,7 +1853,7 @@ export class ReservationServiceClient { return this.innerApiCalls.getBiReservation(request, options, callback); } updateBiReservation( - request: protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, options?: CallOptions ): Promise< [ @@ -1913,7 +1913,7 @@ export class ReservationServiceClient { * const [response] = await client.updateBiReservation(request); */ updateBiReservation( - request: protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1960,7 +1960,7 @@ export class ReservationServiceClient { } listReservations( - request: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, options?: CallOptions ): Promise< [ @@ -2016,7 +2016,7 @@ export class ReservationServiceClient { * for more details and examples. */ listReservations( - request: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< @@ -2154,7 +2154,7 @@ export class ReservationServiceClient { ) as AsyncIterable; } listCapacityCommitments( - request: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, options?: CallOptions ): Promise< [ @@ -2210,7 +2210,7 @@ export class ReservationServiceClient { * for more details and examples. */ listCapacityCommitments( - request: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< @@ -2352,7 +2352,7 @@ export class ReservationServiceClient { ) as AsyncIterable; } listAssignments( - request: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, options?: CallOptions ): Promise< [ @@ -2433,7 +2433,7 @@ export class ReservationServiceClient { * for more details and examples. */ listAssignments( - request: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + request?: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< @@ -2581,7 +2581,7 @@ export class ReservationServiceClient { ) as AsyncIterable; } searchAssignments( - request: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + request?: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, options?: CallOptions ): Promise< [ @@ -2668,7 +2668,7 @@ export class ReservationServiceClient { * for more details and examples. */ searchAssignments( - request: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + request?: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< From bf2afdbf5735e2ff564c83c041e68c067f67ba6e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 25 Jun 2021 09:29:19 -0700 Subject: [PATCH 047/105] chore: release 1.1.3 (#81) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-bigquery-reservation/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-reservation/package.json | 2 +- .../google-cloud-bigquery-reservation/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/CHANGELOG.md b/packages/google-cloud-bigquery-reservation/CHANGELOG.md index d6ed7aa23e9..616e0dc0eff 100644 --- a/packages/google-cloud-bigquery-reservation/CHANGELOG.md +++ b/packages/google-cloud-bigquery-reservation/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.1.3](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.2...v1.1.3) (2021-06-25) + + +### Bug Fixes + +* make request optional in all cases ([#80](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/80)) ([5cf25a7](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/5cf25a7b312ce3a009635a18125ab8f10a096089)) + ### [1.1.2](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.1...v1.1.2) (2021-06-07) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 6def75b7dba..ce8c87739ad 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-reservation", - "version": "1.1.2", + "version": "1.1.3", "description": "BigQuery Reservation client for Node.js", "repository": "googleapis/nodejs-bigquery-reservation", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-reservation/samples/package.json b/packages/google-cloud-bigquery-reservation/samples/package.json index b0e9934262a..79b30c5f33b 100644 --- a/packages/google-cloud-bigquery-reservation/samples/package.json +++ b/packages/google-cloud-bigquery-reservation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-reservation": "^1.1.2" + "@google-cloud/bigquery-reservation": "^1.1.3" }, "devDependencies": { "c8": "^7.1.0", From b64b1a8d2b309351012d3fecf017905901a255ed Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 30 Jun 2021 12:26:22 -0400 Subject: [PATCH 048/105] fix(deps): google-gax v2.17.0 with mTLS (#84) --- packages/google-cloud-bigquery-reservation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index ce8c87739ad..0b24b1607fa 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -39,7 +39,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.12.0" + "google-gax": "^2.17.0" }, "devDependencies": { "@types/mocha": "^8.0.0", From 1243732b1b39a4fa0ff4b14c118e837d3843c249 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:47 +0000 Subject: [PATCH 049/105] chore: release 1.1.4 (#86) :robot: I have created a release \*beep\* \*boop\* --- ### [1.1.4](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.3...v1.1.4) (2021-06-30) ### Bug Fixes * **deps:** google-gax v2.17.0 with mTLS ([#84](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/84)) ([42c4bcb](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/42c4bcb09e5f1c7b604e923a89b05fa895f663c8)) --- 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-bigquery-reservation/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-reservation/package.json | 2 +- .../google-cloud-bigquery-reservation/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/CHANGELOG.md b/packages/google-cloud-bigquery-reservation/CHANGELOG.md index 616e0dc0eff..dd33c3443be 100644 --- a/packages/google-cloud-bigquery-reservation/CHANGELOG.md +++ b/packages/google-cloud-bigquery-reservation/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.1.4](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.3...v1.1.4) (2021-06-30) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#84](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/84)) ([42c4bcb](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/42c4bcb09e5f1c7b604e923a89b05fa895f663c8)) + ### [1.1.3](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.2...v1.1.3) (2021-06-25) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 0b24b1607fa..ab967e1b7a0 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-reservation", - "version": "1.1.3", + "version": "1.1.4", "description": "BigQuery Reservation client for Node.js", "repository": "googleapis/nodejs-bigquery-reservation", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-reservation/samples/package.json b/packages/google-cloud-bigquery-reservation/samples/package.json index 79b30c5f33b..ecfca4beb70 100644 --- a/packages/google-cloud-bigquery-reservation/samples/package.json +++ b/packages/google-cloud-bigquery-reservation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-reservation": "^1.1.3" + "@google-cloud/bigquery-reservation": "^1.1.4" }, "devDependencies": { "c8": "^7.1.0", From 80d7f0e0c0141bddfa1155f628051ab3498adb56 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 12 Jul 2021 17:48:15 -0400 Subject: [PATCH 050/105] fix(deps): google-gax v2.17.1 (#87) --- packages/google-cloud-bigquery-reservation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index ab967e1b7a0..8437155940d 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -39,7 +39,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.17.0" + "google-gax": "^2.17.1" }, "devDependencies": { "@types/mocha": "^8.0.0", From 925aa5df7f3f76313d3fb3316651c351c4ea8681 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 12 Jul 2021 22:28:37 +0000 Subject: [PATCH 051/105] chore: release 1.1.5 (#88) :robot: I have created a release \*beep\* \*boop\* --- ### [1.1.5](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.4...v1.1.5) (2021-07-12) ### Bug Fixes * **deps:** google-gax v2.17.1 ([#87](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/87)) ([9081a32](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/9081a3237099c98bb5d3694785afbe9ff4dcaaea)) --- 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-bigquery-reservation/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-reservation/package.json | 2 +- .../google-cloud-bigquery-reservation/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/CHANGELOG.md b/packages/google-cloud-bigquery-reservation/CHANGELOG.md index dd33c3443be..b866f825582 100644 --- a/packages/google-cloud-bigquery-reservation/CHANGELOG.md +++ b/packages/google-cloud-bigquery-reservation/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.1.5](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.4...v1.1.5) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#87](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/87)) ([9081a32](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/9081a3237099c98bb5d3694785afbe9ff4dcaaea)) + ### [1.1.4](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.3...v1.1.4) (2021-06-30) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 8437155940d..b374a1d8d82 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-reservation", - "version": "1.1.4", + "version": "1.1.5", "description": "BigQuery Reservation client for Node.js", "repository": "googleapis/nodejs-bigquery-reservation", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-reservation/samples/package.json b/packages/google-cloud-bigquery-reservation/samples/package.json index ecfca4beb70..f4337e32c90 100644 --- a/packages/google-cloud-bigquery-reservation/samples/package.json +++ b/packages/google-cloud-bigquery-reservation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-reservation": "^1.1.4" + "@google-cloud/bigquery-reservation": "^1.1.5" }, "devDependencies": { "c8": "^7.1.0", From 94b9595bca5e631f291139c033bbefd90b68856a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 16 Jul 2021 19:10:36 +0000 Subject: [PATCH 052/105] fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#89) Also removing the explicit generator tag for the IAMPolicy mixin for the kms and pubsub APIS as the generator will now read it from the .yaml file. PiperOrigin-RevId: 385101839 Source-Link: https://github.com/googleapis/googleapis/commit/80f404215a9346259db760d80d0671f28c433453 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d3509d2520fb8db862129633f1cf8406d17454e1 --- .../src/v1/reservation_service_client.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index ebfa7476769..6467d32f681 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts @@ -62,6 +62,7 @@ const version = require('../../../package.json').version; export class ReservationServiceClient { 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: {}; @@ -73,6 +74,7 @@ export class ReservationServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; reservationServiceStub?: Promise<{[name: string]: Function}>; @@ -116,6 +118,9 @@ export class ReservationServiceClient { const staticMembers = this.constructor as typeof ReservationServiceClient; 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 = @@ -225,6 +230,9 @@ export class ReservationServiceClient { // 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; } /** @@ -254,7 +262,8 @@ export class ReservationServiceClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.bigquery.reservation.v1 .ReservationService, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides From 7d5fb237a48e5a9c52ad42bb677f7ba7e823dd50 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 21 Jul 2021 00:14:13 +0000 Subject: [PATCH 053/105] chore: release 1.1.6 (#90) :robot: I have created a release \*beep\* \*boop\* --- ### [1.1.6](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.5...v1.1.6) (2021-07-21) ### Bug Fixes * Updating WORKSPACE files to use the newest version of the Typescript generator. ([#89](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/89)) ([b7b0b92](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/b7b0b9263f2f8fd0fcb8fd977fc7f24727138b29)) --- 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-bigquery-reservation/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-reservation/package.json | 2 +- .../google-cloud-bigquery-reservation/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/CHANGELOG.md b/packages/google-cloud-bigquery-reservation/CHANGELOG.md index b866f825582..1d096a877de 100644 --- a/packages/google-cloud-bigquery-reservation/CHANGELOG.md +++ b/packages/google-cloud-bigquery-reservation/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.1.6](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.5...v1.1.6) (2021-07-21) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#89](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/89)) ([b7b0b92](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/b7b0b9263f2f8fd0fcb8fd977fc7f24727138b29)) + ### [1.1.5](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.4...v1.1.5) (2021-07-12) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index b374a1d8d82..e438bd9fa37 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-reservation", - "version": "1.1.5", + "version": "1.1.6", "description": "BigQuery Reservation client for Node.js", "repository": "googleapis/nodejs-bigquery-reservation", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-reservation/samples/package.json b/packages/google-cloud-bigquery-reservation/samples/package.json index f4337e32c90..0aebfbc09f8 100644 --- a/packages/google-cloud-bigquery-reservation/samples/package.json +++ b/packages/google-cloud-bigquery-reservation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-reservation": "^1.1.5" + "@google-cloud/bigquery-reservation": "^1.1.6" }, "devDependencies": { "c8": "^7.1.0", From 006f7d7bb6cc754795da55f3ab19ba138e351e72 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Wed, 4 Aug 2021 16:06:45 -0400 Subject: [PATCH 054/105] chore(nodejs): update client ref docs link in metadata (#95) --- packages/google-cloud-bigquery-reservation/.repo-metadata.json | 2 +- packages/google-cloud-bigquery-reservation/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/.repo-metadata.json b/packages/google-cloud-bigquery-reservation/.repo-metadata.json index 09e1763f235..0b977217fb8 100644 --- a/packages/google-cloud-bigquery-reservation/.repo-metadata.json +++ b/packages/google-cloud-bigquery-reservation/.repo-metadata.json @@ -10,6 +10,6 @@ "product_documentation": "https://cloud.google.com/bigquery/docs/reference/reservations", "codeowner_team": "@googleapis/api-bigquery", "name_pretty": "Google BigQuery Reservation", - "client_documentation": "https://googleapis.dev/nodejs/bigqueryreservation/latest", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/bigquery-reservation/latest", "release_level": "ga" } diff --git a/packages/google-cloud-bigquery-reservation/README.md b/packages/google-cloud-bigquery-reservation/README.md index 7333abf4a9a..6e91b44e2ec 100644 --- a/packages/google-cloud-bigquery-reservation/README.md +++ b/packages/google-cloud-bigquery-reservation/README.md @@ -163,7 +163,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-bigquery-reservation/blob/master/LICENSE) -[client-docs]: https://googleapis.dev/nodejs/bigqueryreservation/latest +[client-docs]: https://cloud.google.com/nodejs/docs/reference/bigquery-reservation/latest [product-docs]: https://cloud.google.com/bigquery/docs/reference/reservations [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project From 1932bf71021e08601927af5b93851b1ac0e27107 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Tue, 10 Aug 2021 19:09:31 -0700 Subject: [PATCH 055/105] fix(build): migrate to using main branch (#97) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(build): migrate to using main branch * 🦉 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-bigquery-reservation/README.md | 16 ++++++++-------- .../samples/README.md | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/README.md b/packages/google-cloud-bigquery-reservation/README.md index 6e91b44e2ec..b3fd360197c 100644 --- a/packages/google-cloud-bigquery-reservation/README.md +++ b/packages/google-cloud-bigquery-reservation/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/bigquery-reservation.svg)](https://www.npmjs.org/package/@google-cloud/bigquery-reservation) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-bigquery-reservation/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-bigquery-reservation) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-bigquery-reservation/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-bigquery-reservation) @@ -15,7 +15,7 @@ BigQuery Reservation client for Node.js A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-bigquery-reservation/blob/master/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/nodejs-bigquery-reservation/blob/main/CHANGELOG.md). * [Google BigQuery Reservation Node.js Client API Reference][client-docs] * [Google BigQuery Reservation Documentation][product-docs] @@ -96,11 +96,11 @@ listCapacityCommitments(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-bigquery-reservation/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-bigquery-reservation/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Quickstart | [source code](https://github.com/googleapis/nodejs-bigquery-reservation/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-bigquery-reservation&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/nodejs-bigquery-reservation/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-bigquery-reservation&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | @@ -149,19 +149,19 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-bigquery-reservation/blob/master/CONTRIBUTING.md). +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-bigquery-reservation/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-bigquery-reservation/blob/master/LICENSE) +See [LICENSE](https://github.com/googleapis/nodejs-bigquery-reservation/blob/main/LICENSE) [client-docs]: https://cloud.google.com/nodejs/docs/reference/bigquery-reservation/latest [product-docs]: https://cloud.google.com/bigquery/docs/reference/reservations diff --git a/packages/google-cloud-bigquery-reservation/samples/README.md b/packages/google-cloud-bigquery-reservation/samples/README.md index 7ef0fea94ee..d51af5fa62e 100644 --- a/packages/google-cloud-bigquery-reservation/samples/README.md +++ b/packages/google-cloud-bigquery-reservation/samples/README.md @@ -31,7 +31,7 @@ Before running the samples, make sure you've followed the steps outlined in ### Quickstart -View the [source code](https://github.com/googleapis/nodejs-bigquery-reservation/blob/master/samples/quickstart.js). +View the [source code](https://github.com/googleapis/nodejs-bigquery-reservation/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-bigquery-reservation&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) From e041f837b719536031fc5475f38326d898f74aec Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 16 Aug 2021 22:42:43 -0400 Subject: [PATCH 056/105] fix(deps): google-gax v2.24.1 (#99) --- packages/google-cloud-bigquery-reservation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index e438bd9fa37..b3c9907aeff 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -39,7 +39,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.17.1" + "google-gax": "^2.24.1" }, "devDependencies": { "@types/mocha": "^8.0.0", From 0a92eb8e097cab082f3801194cea8fffe3e2ec78 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:28:29 +0000 Subject: [PATCH 057/105] feat: turns on self-signed JWT feature flag (#100) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 392067151 Source-Link: https://github.com/googleapis/googleapis/commit/06345f7b95c4b4a3ffe4303f1f2984ccc304b2e0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/95882b37970e41e4cd51b22fa507cfd46dc7c4b6 --- .../src/v1/reservation_service_client.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index 6467d32f681..7791a4e26c7 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts @@ -145,6 +145,12 @@ export class ReservationServiceClient { // 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 b81cbb26e1025509f548bd92170abec3982b74a0 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 23 Aug 2021 18:36:24 +0000 Subject: [PATCH 058/105] chore: release 1.2.0 (#101) :robot: I have created a release \*beep\* \*boop\* --- ## [1.2.0](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.6...v1.2.0) (2021-08-23) ### Features * turns on self-signed JWT feature flag ([#100](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/100)) ([0047223](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/004722310ece662732fe60c8941be1b30214ed6d)) ### Bug Fixes * **build:** migrate to using main branch ([#97](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/97)) ([2e5a332](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/2e5a332b21067dd73ec6d2b218b87b61b8ebf59e)) * **deps:** google-gax v2.24.1 ([#99](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/99)) ([3a4cdec](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/3a4cdec8d028f0d6fd6d8ebc3977c00231b290bb)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- .../google-cloud-bigquery-reservation/CHANGELOG.md | 13 +++++++++++++ .../google-cloud-bigquery-reservation/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/CHANGELOG.md b/packages/google-cloud-bigquery-reservation/CHANGELOG.md index 1d096a877de..637dfc1a6af 100644 --- a/packages/google-cloud-bigquery-reservation/CHANGELOG.md +++ b/packages/google-cloud-bigquery-reservation/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [1.2.0](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.6...v1.2.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#100](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/100)) ([0047223](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/004722310ece662732fe60c8941be1b30214ed6d)) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#97](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/97)) ([2e5a332](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/2e5a332b21067dd73ec6d2b218b87b61b8ebf59e)) +* **deps:** google-gax v2.24.1 ([#99](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/99)) ([3a4cdec](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/3a4cdec8d028f0d6fd6d8ebc3977c00231b290bb)) + ### [1.1.6](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.5...v1.1.6) (2021-07-21) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index b3c9907aeff..dc1aa0da552 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-reservation", - "version": "1.1.6", + "version": "1.2.0", "description": "BigQuery Reservation client for Node.js", "repository": "googleapis/nodejs-bigquery-reservation", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-reservation/samples/package.json b/packages/google-cloud-bigquery-reservation/samples/package.json index 0aebfbc09f8..de2d27562ee 100644 --- a/packages/google-cloud-bigquery-reservation/samples/package.json +++ b/packages/google-cloud-bigquery-reservation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-reservation": "^1.1.6" + "@google-cloud/bigquery-reservation": "^1.2.0" }, "devDependencies": { "c8": "^7.1.0", From 4a2af67714b0e1b0fbc22a66578c0f54c955e95a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 1 Sep 2021 10:06:33 -0700 Subject: [PATCH 059/105] feat: Deprecated SearchAssignments in favor of SearchAllAssignments feat: Deprecated SearchAssignments in favor of SearchAllAssignments feat: Reservation objects now contain a creation time and an update time feat: Added commitment_start_time to capacity commitments feat: Force deleting capacity commitments is allowed ... (#103) PiperOrigin-RevId: 394129271 Source-Link: https://github.com/googleapis/googleapis/commit/2c7f233a072ce7acf72a1db871a94a7c3e8ad36e Source-Link: https://github.com/googleapis/googleapis-gen/commit/711f2cd1d3072ad3d974a40a0c19a3c873a328b1 Co-authored-by: Owl Bot --- .../bigquery/reservation/v1/reservation.proto | 123 +++- .../protos/protos.d.ts | 264 ++++++- .../protos/protos.js | 675 +++++++++++++++++- .../protos/protos.json | 97 ++- .../src/v1/gapic_metadata.json | 14 + .../src/v1/reservation_service_client.ts | 290 +++++++- .../v1/reservation_service_client_config.json | 22 +- .../test/gapic_reservation_service_v1.ts | 330 +++++++++ 8 files changed, 1791 insertions(+), 24 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/protos/google/cloud/bigquery/reservation/v1/reservation.proto b/packages/google-cloud-bigquery-reservation/protos/google/cloud/bigquery/reservation/v1/reservation.proto index 4b90ffdda5f..d631978f7ca 100644 --- a/packages/google-cloud-bigquery-reservation/protos/google/cloud/bigquery/reservation/v1/reservation.proto +++ b/packages/google-cloud-bigquery-reservation/protos/google/cloud/bigquery/reservation/v1/reservation.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. @@ -202,6 +202,11 @@ service ReservationService { // `project2`) could all be created and mapped to the same or different // reservations. // + // "None" assignments represent an absence of the assignment. Projects + // assigned to None use on-demand pricing. To create a "None" assignment, use + // "none" as a reservation_id in the parent. Example parent: + // `projects/myproject/locations/US/reservations/none`. + // // Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have // 'bigquery.admin' permissions on the project using the reservation // and the project that owns this reservation. @@ -266,7 +271,7 @@ service ReservationService { option (google.api.method_signature) = "name"; } - // Looks up assignments for a specified resource for a particular region. + // Deprecated: Looks up assignments for a specified resource for a particular region. // If the request is about a project: // // 1. Assignments created on the project will be returned if they exist. @@ -290,12 +295,40 @@ service ReservationService { // **Note** "-" cannot be used for projects // nor locations. rpc SearchAssignments(SearchAssignmentsRequest) returns (SearchAssignmentsResponse) { + option deprecated = true; option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*}:searchAssignments" }; option (google.api.method_signature) = "parent,query"; } + // Looks up assignments for a specified resource for a particular region. + // If the request is about a project: + // + // 1. Assignments created on the project will be returned if they exist. + // 2. Otherwise assignments created on the closest ancestor will be + // returned. + // 3. Assignments for different JobTypes will all be returned. + // + // The same logic applies if the request is about a folder. + // + // If the request is about an organization, then assignments created on the + // organization will be returned (organization doesn't have ancestors). + // + // Comparing to ListAssignments, there are some behavior + // differences: + // + // 1. permission on the assignee will be verified in this API. + // 2. Hierarchy lookup (project->folder->organization) happens in this API. + // 3. Parent here is `projects/*/locations/*`, instead of + // `projects/*/locations/*reservations/*`. + rpc SearchAllAssignments(SearchAllAssignmentsRequest) returns (SearchAllAssignmentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}:searchAllAssignments" + }; + option (google.api.method_signature) = "parent,query"; + } + // Moves an assignment under a new reservation. // // This differs from removing an existing assignment and recreating a new one @@ -357,10 +390,17 @@ message Reservation { // `google.rpc.Code.RESOURCE_EXHAUSTED`. int64 slot_capacity = 2; - // If false, any query using this reservation will use idle slots from other - // reservations within the same admin project. If true, a query using this - // reservation will execute with the slot capacity specified above at most. + // If false, any query or pipeline job using this reservation will use idle + // slots from other reservations within the same admin project. If true, a + // query or pipeline job using this reservation will execute with the slot + // capacity specified in the slot_capacity field at most. bool ignore_idle_slots = 4; + + // Output only. Creation time of the reservation. + google.protobuf.Timestamp creation_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update time of the reservation. + google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Capacity commitment is a way to purchase compute capacity for BigQuery jobs @@ -439,6 +479,10 @@ message CapacityCommitment { // Output only. State of the commitment. State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The start of the current commitment period. It is applicable only for + // ACTIVE capacity commitments. + google.protobuf.Timestamp commitment_start_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The end of the current commitment period. It is applicable only for ACTIVE // capacity commitments. google.protobuf.Timestamp commitment_end_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -549,6 +593,13 @@ message CreateCapacityCommitmentRequest { // If true, fail the request if another project in the organization has a // capacity commitment. bool enforce_single_admin_project_per_org = 4; + + // The optional capacity commitment ID. Capacity commitment name will be + // generated automatically if this field is empty. + // This field must only contain lower case alphanumeric characters or dash. + // Max length is 64 characters. + // NOTE: this ID won't be kept if the capacity commitment is split or merged. + string capacity_commitment_id = 5; } // The request for [ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments]. @@ -601,6 +652,11 @@ message DeleteCapacityCommitmentRequest { type: "bigqueryreservation.googleapis.com/CapacityCommitment" } ]; + + // Can be used to force delete commitments even if assignments exist. Deleting + // commitments with assignments may cause queries to fail if they no longer + // have access to slots. + bool force = 3; } // The request for [ReservationService.UpdateCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment]. @@ -671,6 +727,10 @@ message Assignment { // Query jobs from the project will use the reservation. QUERY = 2; + + // BigQuery ML jobs that use services external to BigQuery for model + // training. These jobs will not utilize idle slots from other reservations. + ML_EXTERNAL = 3; } // Assignment will remain in PENDING state if no active capacity commitment is @@ -718,6 +778,12 @@ message CreateAssignmentRequest { // Assignment resource to create. Assignment assignment = 2; + + // The optional assignment ID. Assignment name will be generated automatically + // if this field is empty. + // This field must only contain lower case alphanumeric characters or dash. + // Max length is 64 characters. + string assignment_id = 4; } // The request for [ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments]. @@ -798,6 +864,37 @@ message SearchAssignmentsRequest { string page_token = 4; } +// The request for +// [ReservationService.SearchAllAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments]. +// Note: "bigquery.reservationAssignments.search" permission is required on the +// related assignee. +message SearchAllAssignmentsRequest { + // Required. The resource name with location (project name could be the wildcard '-'), + // e.g.: + // `projects/-/locations/US`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Please specify resource name as assignee in the query. + // + // Examples: + // + // * `assignee=projects/myproject` + // * `assignee=folders/123` + // * `assignee=organizations/456` + string query = 2; + + // The maximum number of items to return per page. + int32 page_size = 3; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 4; +} + // The response for [ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments]. message SearchAssignmentsResponse { // List of assignments visible to the user. @@ -808,6 +905,16 @@ message SearchAssignmentsResponse { string next_page_token = 2; } +// The response for [ReservationService.SearchAllAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments]. +message SearchAllAssignmentsResponse { + // List of assignments visible to the user. + repeated Assignment assignments = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + // The request for // [ReservationService.MoveAssignment][google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignment]. // @@ -839,12 +946,12 @@ message MoveAssignmentRequest { message BiReservation { option (google.api.resource) = { type: "bigqueryreservation.googleapis.com/BiReservation" - pattern: "projects/{project}/locations/{location}/bireservation" + pattern: "projects/{project}/locations/{location}/biReservation" }; // The resource name of the singleton BI reservation. // Reservation names have the form - // `projects/{project_id}/locations/{location_id}/bireservation`. + // `projects/{project_id}/locations/{location_id}/biReservation`. string name = 1; // Output only. The last update timestamp of a reservation. @@ -857,7 +964,7 @@ message BiReservation { // A request to get a singleton BI reservation. message GetBiReservationRequest { // Required. Name of the requested reservation, for example: - // `projects/{project_id}/locations/{location_id}/bireservation` + // `projects/{project_id}/locations/{location_id}/biReservation` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts b/packages/google-cloud-bigquery-reservation/protos/protos.d.ts index 63bb479a960..e303e2c5b21 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-reservation/protos/protos.d.ts @@ -273,6 +273,20 @@ export namespace google { */ public searchAssignments(request: google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest): Promise; + /** + * Calls SearchAllAssignments. + * @param request SearchAllAssignmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchAllAssignmentsResponse + */ + public searchAllAssignments(request: google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignmentsCallback): void; + + /** + * Calls SearchAllAssignments. + * @param request SearchAllAssignmentsRequest message or plain object + * @returns Promise + */ + public searchAllAssignments(request: google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest): Promise; + /** * Calls MoveAssignment. * @param request MoveAssignmentRequest message or plain object @@ -430,6 +444,13 @@ export namespace google { */ type SearchAssignmentsCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse) => void; + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#searchAllAssignments}. + * @param error Error, if any + * @param [response] SearchAllAssignmentsResponse + */ + type SearchAllAssignmentsCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse) => void; + /** * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#moveAssignment}. * @param error Error, if any @@ -463,6 +484,12 @@ export namespace google { /** Reservation ignoreIdleSlots */ ignoreIdleSlots?: (boolean|null); + + /** Reservation creationTime */ + creationTime?: (google.protobuf.ITimestamp|null); + + /** Reservation updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); } /** Represents a Reservation. */ @@ -483,6 +510,12 @@ export namespace google { /** Reservation ignoreIdleSlots. */ public ignoreIdleSlots: boolean; + /** Reservation creationTime. */ + public creationTime?: (google.protobuf.ITimestamp|null); + + /** Reservation updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + /** * Creates a new Reservation instance using the specified properties. * @param [properties] Properties to set @@ -569,6 +602,9 @@ export namespace google { /** CapacityCommitment state */ state?: (google.cloud.bigquery.reservation.v1.CapacityCommitment.State|keyof typeof google.cloud.bigquery.reservation.v1.CapacityCommitment.State|null); + /** CapacityCommitment commitmentStartTime */ + commitmentStartTime?: (google.protobuf.ITimestamp|null); + /** CapacityCommitment commitmentEndTime */ commitmentEndTime?: (google.protobuf.ITimestamp|null); @@ -600,6 +636,9 @@ export namespace google { /** CapacityCommitment state. */ public state: (google.cloud.bigquery.reservation.v1.CapacityCommitment.State|keyof typeof google.cloud.bigquery.reservation.v1.CapacityCommitment.State); + /** CapacityCommitment commitmentStartTime. */ + public commitmentStartTime?: (google.protobuf.ITimestamp|null); + /** CapacityCommitment commitmentEndTime. */ public commitmentEndTime?: (google.protobuf.ITimestamp|null); @@ -1287,6 +1326,9 @@ export namespace google { /** CreateCapacityCommitmentRequest enforceSingleAdminProjectPerOrg */ enforceSingleAdminProjectPerOrg?: (boolean|null); + + /** CreateCapacityCommitmentRequest capacityCommitmentId */ + capacityCommitmentId?: (string|null); } /** Represents a CreateCapacityCommitmentRequest. */ @@ -1307,6 +1349,9 @@ export namespace google { /** CreateCapacityCommitmentRequest enforceSingleAdminProjectPerOrg. */ public enforceSingleAdminProjectPerOrg: boolean; + /** CreateCapacityCommitmentRequest capacityCommitmentId. */ + public capacityCommitmentId: string; + /** * Creates a new CreateCapacityCommitmentRequest instance using the specified properties. * @param [properties] Properties to set @@ -1671,6 +1716,9 @@ export namespace google { /** DeleteCapacityCommitmentRequest name */ name?: (string|null); + + /** DeleteCapacityCommitmentRequest force */ + force?: (boolean|null); } /** Represents a DeleteCapacityCommitmentRequest. */ @@ -1685,6 +1733,9 @@ export namespace google { /** DeleteCapacityCommitmentRequest name. */ public name: string; + /** DeleteCapacityCommitmentRequest force. */ + public force: boolean; + /** * Creates a new DeleteCapacityCommitmentRequest instance using the specified properties. * @param [properties] Properties to set @@ -2254,7 +2305,8 @@ export namespace google { enum JobType { JOB_TYPE_UNSPECIFIED = 0, PIPELINE = 1, - QUERY = 2 + QUERY = 2, + ML_EXTERNAL = 3 } /** State enum. */ @@ -2273,6 +2325,9 @@ export namespace google { /** CreateAssignmentRequest assignment */ assignment?: (google.cloud.bigquery.reservation.v1.IAssignment|null); + + /** CreateAssignmentRequest assignmentId */ + assignmentId?: (string|null); } /** Represents a CreateAssignmentRequest. */ @@ -2290,6 +2345,9 @@ export namespace google { /** CreateAssignmentRequest assignment. */ public assignment?: (google.cloud.bigquery.reservation.v1.IAssignment|null); + /** CreateAssignmentRequest assignmentId. */ + public assignmentId: string; + /** * Creates a new CreateAssignmentRequest instance using the specified properties. * @param [properties] Properties to set @@ -2757,6 +2815,114 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a SearchAllAssignmentsRequest. */ + interface ISearchAllAssignmentsRequest { + + /** SearchAllAssignmentsRequest parent */ + parent?: (string|null); + + /** SearchAllAssignmentsRequest query */ + query?: (string|null); + + /** SearchAllAssignmentsRequest pageSize */ + pageSize?: (number|null); + + /** SearchAllAssignmentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a SearchAllAssignmentsRequest. */ + class SearchAllAssignmentsRequest implements ISearchAllAssignmentsRequest { + + /** + * Constructs a new SearchAllAssignmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest); + + /** SearchAllAssignmentsRequest parent. */ + public parent: string; + + /** SearchAllAssignmentsRequest query. */ + public query: string; + + /** SearchAllAssignmentsRequest pageSize. */ + public pageSize: number; + + /** SearchAllAssignmentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new SearchAllAssignmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchAllAssignmentsRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest): google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest; + + /** + * Encodes the specified SearchAllAssignmentsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest.verify|verify} messages. + * @param message SearchAllAssignmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchAllAssignmentsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest.verify|verify} messages. + * @param message SearchAllAssignmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchAllAssignmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchAllAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest; + + /** + * Decodes a SearchAllAssignmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchAllAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest; + + /** + * Verifies a SearchAllAssignmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchAllAssignmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchAllAssignmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest; + + /** + * Creates a plain object from a SearchAllAssignmentsRequest message. Also converts values to other types if specified. + * @param message SearchAllAssignmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchAllAssignmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a SearchAssignmentsResponse. */ interface ISearchAssignmentsResponse { @@ -2853,6 +3019,102 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a SearchAllAssignmentsResponse. */ + interface ISearchAllAssignmentsResponse { + + /** SearchAllAssignmentsResponse assignments */ + assignments?: (google.cloud.bigquery.reservation.v1.IAssignment[]|null); + + /** SearchAllAssignmentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchAllAssignmentsResponse. */ + class SearchAllAssignmentsResponse implements ISearchAllAssignmentsResponse { + + /** + * Constructs a new SearchAllAssignmentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse); + + /** SearchAllAssignmentsResponse assignments. */ + public assignments: google.cloud.bigquery.reservation.v1.IAssignment[]; + + /** SearchAllAssignmentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchAllAssignmentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchAllAssignmentsResponse instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse): google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse; + + /** + * Encodes the specified SearchAllAssignmentsResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse.verify|verify} messages. + * @param message SearchAllAssignmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchAllAssignmentsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse.verify|verify} messages. + * @param message SearchAllAssignmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchAllAssignmentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchAllAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse; + + /** + * Decodes a SearchAllAssignmentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchAllAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse; + + /** + * Verifies a SearchAllAssignmentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchAllAssignmentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchAllAssignmentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse; + + /** + * Creates a plain object from a SearchAllAssignmentsResponse message. Also converts values to other types if specified. + * @param message SearchAllAssignmentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchAllAssignmentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a MoveAssignmentRequest. */ interface IMoveAssignmentRequest { diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.js b/packages/google-cloud-bigquery-reservation/protos/protos.js index 8b019378739..b5e2f7c9850 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.js +++ b/packages/google-cloud-bigquery-reservation/protos/protos.js @@ -635,6 +635,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#searchAllAssignments}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef SearchAllAssignmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse} [response] SearchAllAssignmentsResponse + */ + + /** + * Calls SearchAllAssignments. + * @function searchAllAssignments + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest} request SearchAllAssignmentsRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignmentsCallback} callback Node-style callback called with the error, if any, and SearchAllAssignmentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.searchAllAssignments = function searchAllAssignments(request, callback) { + return this.rpcCall(searchAllAssignments, $root.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest, $root.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse, request, callback); + }, "name", { value: "SearchAllAssignments" }); + + /** + * Calls SearchAllAssignments. + * @function searchAllAssignments + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest} request SearchAllAssignmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#moveAssignment}. * @memberof google.cloud.bigquery.reservation.v1.ReservationService @@ -746,6 +779,8 @@ * @property {string|null} [name] Reservation name * @property {number|Long|null} [slotCapacity] Reservation slotCapacity * @property {boolean|null} [ignoreIdleSlots] Reservation ignoreIdleSlots + * @property {google.protobuf.ITimestamp|null} [creationTime] Reservation creationTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Reservation updateTime */ /** @@ -787,6 +822,22 @@ */ Reservation.prototype.ignoreIdleSlots = false; + /** + * Reservation creationTime. + * @member {google.protobuf.ITimestamp|null|undefined} creationTime + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @instance + */ + Reservation.prototype.creationTime = null; + + /** + * Reservation updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @instance + */ + Reservation.prototype.updateTime = null; + /** * Creates a new Reservation instance using the specified properties. * @function create @@ -817,6 +868,10 @@ writer.uint32(/* id 2, wireType 0 =*/16).int64(message.slotCapacity); if (message.ignoreIdleSlots != null && Object.hasOwnProperty.call(message, "ignoreIdleSlots")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.ignoreIdleSlots); + if (message.creationTime != null && Object.hasOwnProperty.call(message, "creationTime")) + $root.google.protobuf.Timestamp.encode(message.creationTime, 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; }; @@ -860,6 +915,12 @@ case 4: message.ignoreIdleSlots = reader.bool(); break; + case 8: + message.creationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 9: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -904,6 +965,16 @@ if (message.ignoreIdleSlots != null && message.hasOwnProperty("ignoreIdleSlots")) if (typeof message.ignoreIdleSlots !== "boolean") return "ignoreIdleSlots: boolean expected"; + if (message.creationTime != null && message.hasOwnProperty("creationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.creationTime); + if (error) + return "creationTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } return null; }; @@ -932,6 +1003,16 @@ message.slotCapacity = new $util.LongBits(object.slotCapacity.low >>> 0, object.slotCapacity.high >>> 0).toNumber(); if (object.ignoreIdleSlots != null) message.ignoreIdleSlots = Boolean(object.ignoreIdleSlots); + if (object.creationTime != null) { + if (typeof object.creationTime !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.Reservation.creationTime: object expected"); + message.creationTime = $root.google.protobuf.Timestamp.fromObject(object.creationTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.Reservation.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } return message; }; @@ -956,6 +1037,8 @@ } else object.slotCapacity = options.longs === String ? "0" : 0; object.ignoreIdleSlots = false; + object.creationTime = null; + object.updateTime = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -966,6 +1049,10 @@ object.slotCapacity = options.longs === String ? $util.Long.prototype.toString.call(message.slotCapacity) : options.longs === Number ? new $util.LongBits(message.slotCapacity.low >>> 0, message.slotCapacity.high >>> 0).toNumber() : message.slotCapacity; if (message.ignoreIdleSlots != null && message.hasOwnProperty("ignoreIdleSlots")) object.ignoreIdleSlots = message.ignoreIdleSlots; + if (message.creationTime != null && message.hasOwnProperty("creationTime")) + object.creationTime = $root.google.protobuf.Timestamp.toObject(message.creationTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); return object; }; @@ -993,6 +1080,7 @@ * @property {number|Long|null} [slotCount] CapacityCommitment slotCount * @property {google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan|null} [plan] CapacityCommitment plan * @property {google.cloud.bigquery.reservation.v1.CapacityCommitment.State|null} [state] CapacityCommitment state + * @property {google.protobuf.ITimestamp|null} [commitmentStartTime] CapacityCommitment commitmentStartTime * @property {google.protobuf.ITimestamp|null} [commitmentEndTime] CapacityCommitment commitmentEndTime * @property {google.rpc.IStatus|null} [failureStatus] CapacityCommitment failureStatus * @property {google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan|null} [renewalPlan] CapacityCommitment renewalPlan @@ -1045,6 +1133,14 @@ */ CapacityCommitment.prototype.state = 0; + /** + * CapacityCommitment commitmentStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} commitmentStartTime + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @instance + */ + CapacityCommitment.prototype.commitmentStartTime = null; + /** * CapacityCommitment commitmentEndTime. * @member {google.protobuf.ITimestamp|null|undefined} commitmentEndTime @@ -1107,6 +1203,8 @@ $root.google.rpc.Status.encode(message.failureStatus, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.renewalPlan != null && Object.hasOwnProperty.call(message, "renewalPlan")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.renewalPlan); + if (message.commitmentStartTime != null && Object.hasOwnProperty.call(message, "commitmentStartTime")) + $root.google.protobuf.Timestamp.encode(message.commitmentStartTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); return writer; }; @@ -1153,6 +1251,9 @@ case 4: message.state = reader.int32(); break; + case 9: + message.commitmentStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; case 5: message.commitmentEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; @@ -1224,6 +1325,11 @@ case 3: break; } + if (message.commitmentStartTime != null && message.hasOwnProperty("commitmentStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.commitmentStartTime); + if (error) + return "commitmentStartTime." + error; + } if (message.commitmentEndTime != null && message.hasOwnProperty("commitmentEndTime")) { var error = $root.google.protobuf.Timestamp.verify(message.commitmentEndTime); if (error) @@ -1311,6 +1417,11 @@ message.state = 3; break; } + if (object.commitmentStartTime != null) { + if (typeof object.commitmentStartTime !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.CapacityCommitment.commitmentStartTime: object expected"); + message.commitmentStartTime = $root.google.protobuf.Timestamp.fromObject(object.commitmentStartTime); + } if (object.commitmentEndTime != null) { if (typeof object.commitmentEndTime !== "object") throw TypeError(".google.cloud.bigquery.reservation.v1.CapacityCommitment.commitmentEndTime: object expected"); @@ -1371,6 +1482,7 @@ object.commitmentEndTime = null; object.failureStatus = null; object.renewalPlan = options.enums === String ? "COMMITMENT_PLAN_UNSPECIFIED" : 0; + object.commitmentStartTime = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -1389,6 +1501,8 @@ object.failureStatus = $root.google.rpc.Status.toObject(message.failureStatus, options); if (message.renewalPlan != null && message.hasOwnProperty("renewalPlan")) object.renewalPlan = options.enums === String ? $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan[message.renewalPlan] : message.renewalPlan; + if (message.commitmentStartTime != null && message.hasOwnProperty("commitmentStartTime")) + object.commitmentStartTime = $root.google.protobuf.Timestamp.toObject(message.commitmentStartTime, options); return object; }; @@ -2747,6 +2861,7 @@ * @property {string|null} [parent] CreateCapacityCommitmentRequest parent * @property {google.cloud.bigquery.reservation.v1.ICapacityCommitment|null} [capacityCommitment] CreateCapacityCommitmentRequest capacityCommitment * @property {boolean|null} [enforceSingleAdminProjectPerOrg] CreateCapacityCommitmentRequest enforceSingleAdminProjectPerOrg + * @property {string|null} [capacityCommitmentId] CreateCapacityCommitmentRequest capacityCommitmentId */ /** @@ -2788,6 +2903,14 @@ */ CreateCapacityCommitmentRequest.prototype.enforceSingleAdminProjectPerOrg = false; + /** + * CreateCapacityCommitmentRequest capacityCommitmentId. + * @member {string} capacityCommitmentId + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @instance + */ + CreateCapacityCommitmentRequest.prototype.capacityCommitmentId = ""; + /** * Creates a new CreateCapacityCommitmentRequest instance using the specified properties. * @function create @@ -2818,6 +2941,8 @@ $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.encode(message.capacityCommitment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.enforceSingleAdminProjectPerOrg != null && Object.hasOwnProperty.call(message, "enforceSingleAdminProjectPerOrg")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enforceSingleAdminProjectPerOrg); + if (message.capacityCommitmentId != null && Object.hasOwnProperty.call(message, "capacityCommitmentId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.capacityCommitmentId); return writer; }; @@ -2861,6 +2986,9 @@ case 4: message.enforceSingleAdminProjectPerOrg = reader.bool(); break; + case 5: + message.capacityCommitmentId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -2907,6 +3035,9 @@ if (message.enforceSingleAdminProjectPerOrg != null && message.hasOwnProperty("enforceSingleAdminProjectPerOrg")) if (typeof message.enforceSingleAdminProjectPerOrg !== "boolean") return "enforceSingleAdminProjectPerOrg: boolean expected"; + if (message.capacityCommitmentId != null && message.hasOwnProperty("capacityCommitmentId")) + if (!$util.isString(message.capacityCommitmentId)) + return "capacityCommitmentId: string expected"; return null; }; @@ -2931,6 +3062,8 @@ } if (object.enforceSingleAdminProjectPerOrg != null) message.enforceSingleAdminProjectPerOrg = Boolean(object.enforceSingleAdminProjectPerOrg); + if (object.capacityCommitmentId != null) + message.capacityCommitmentId = String(object.capacityCommitmentId); return message; }; @@ -2951,6 +3084,7 @@ object.parent = ""; object.capacityCommitment = null; object.enforceSingleAdminProjectPerOrg = false; + object.capacityCommitmentId = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; @@ -2958,6 +3092,8 @@ object.capacityCommitment = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.toObject(message.capacityCommitment, options); if (message.enforceSingleAdminProjectPerOrg != null && message.hasOwnProperty("enforceSingleAdminProjectPerOrg")) object.enforceSingleAdminProjectPerOrg = message.enforceSingleAdminProjectPerOrg; + if (message.capacityCommitmentId != null && message.hasOwnProperty("capacityCommitmentId")) + object.capacityCommitmentId = message.capacityCommitmentId; return object; }; @@ -3632,6 +3768,7 @@ * @memberof google.cloud.bigquery.reservation.v1 * @interface IDeleteCapacityCommitmentRequest * @property {string|null} [name] DeleteCapacityCommitmentRequest name + * @property {boolean|null} [force] DeleteCapacityCommitmentRequest force */ /** @@ -3657,6 +3794,14 @@ */ DeleteCapacityCommitmentRequest.prototype.name = ""; + /** + * DeleteCapacityCommitmentRequest force. + * @member {boolean} force + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @instance + */ + DeleteCapacityCommitmentRequest.prototype.force = false; + /** * Creates a new DeleteCapacityCommitmentRequest instance using the specified properties. * @function create @@ -3683,6 +3828,8 @@ writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); return writer; }; @@ -3720,6 +3867,9 @@ case 1: message.name = reader.string(); break; + case 3: + message.force = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -3758,6 +3908,9 @@ if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; return null; }; @@ -3775,6 +3928,8 @@ var message = new $root.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest(); if (object.name != null) message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); return message; }; @@ -3791,10 +3946,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.force = false; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; return object; }; @@ -4887,6 +5046,7 @@ case 0: case 1: case 2: + case 3: break; } if (message.state != null && message.hasOwnProperty("state")) @@ -4930,6 +5090,10 @@ case 2: message.jobType = 2; break; + case "ML_EXTERNAL": + case 3: + message.jobType = 3; + break; } switch (object.state) { case "STATE_UNSPECIFIED": @@ -4996,12 +5160,14 @@ * @property {number} JOB_TYPE_UNSPECIFIED=0 JOB_TYPE_UNSPECIFIED value * @property {number} PIPELINE=1 PIPELINE value * @property {number} QUERY=2 QUERY value + * @property {number} ML_EXTERNAL=3 ML_EXTERNAL value */ Assignment.JobType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "JOB_TYPE_UNSPECIFIED"] = 0; values[valuesById[1] = "PIPELINE"] = 1; values[valuesById[2] = "QUERY"] = 2; + values[valuesById[3] = "ML_EXTERNAL"] = 3; return values; })(); @@ -5032,6 +5198,7 @@ * @interface ICreateAssignmentRequest * @property {string|null} [parent] CreateAssignmentRequest parent * @property {google.cloud.bigquery.reservation.v1.IAssignment|null} [assignment] CreateAssignmentRequest assignment + * @property {string|null} [assignmentId] CreateAssignmentRequest assignmentId */ /** @@ -5065,6 +5232,14 @@ */ CreateAssignmentRequest.prototype.assignment = null; + /** + * CreateAssignmentRequest assignmentId. + * @member {string} assignmentId + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @instance + */ + CreateAssignmentRequest.prototype.assignmentId = ""; + /** * Creates a new CreateAssignmentRequest instance using the specified properties. * @function create @@ -5093,6 +5268,8 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.assignment != null && Object.hasOwnProperty.call(message, "assignment")) $root.google.cloud.bigquery.reservation.v1.Assignment.encode(message.assignment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.assignmentId != null && Object.hasOwnProperty.call(message, "assignmentId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.assignmentId); return writer; }; @@ -5133,6 +5310,9 @@ case 2: message.assignment = $root.google.cloud.bigquery.reservation.v1.Assignment.decode(reader, reader.uint32()); break; + case 4: + message.assignmentId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -5176,6 +5356,9 @@ if (error) return "assignment." + error; } + if (message.assignmentId != null && message.hasOwnProperty("assignmentId")) + if (!$util.isString(message.assignmentId)) + return "assignmentId: string expected"; return null; }; @@ -5198,6 +5381,8 @@ throw TypeError(".google.cloud.bigquery.reservation.v1.CreateAssignmentRequest.assignment: object expected"); message.assignment = $root.google.cloud.bigquery.reservation.v1.Assignment.fromObject(object.assignment); } + if (object.assignmentId != null) + message.assignmentId = String(object.assignmentId); return message; }; @@ -5217,11 +5402,14 @@ if (options.defaults) { object.parent = ""; object.assignment = null; + object.assignmentId = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.assignment != null && message.hasOwnProperty("assignment")) object.assignment = $root.google.cloud.bigquery.reservation.v1.Assignment.toObject(message.assignment, options); + if (message.assignmentId != null && message.hasOwnProperty("assignmentId")) + object.assignmentId = message.assignmentId; return object; }; @@ -6143,6 +6331,260 @@ return SearchAssignmentsRequest; })(); + v1.SearchAllAssignmentsRequest = (function() { + + /** + * Properties of a SearchAllAssignmentsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface ISearchAllAssignmentsRequest + * @property {string|null} [parent] SearchAllAssignmentsRequest parent + * @property {string|null} [query] SearchAllAssignmentsRequest query + * @property {number|null} [pageSize] SearchAllAssignmentsRequest pageSize + * @property {string|null} [pageToken] SearchAllAssignmentsRequest pageToken + */ + + /** + * Constructs a new SearchAllAssignmentsRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a SearchAllAssignmentsRequest. + * @implements ISearchAllAssignmentsRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest=} [properties] Properties to set + */ + function SearchAllAssignmentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchAllAssignmentsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @instance + */ + SearchAllAssignmentsRequest.prototype.parent = ""; + + /** + * SearchAllAssignmentsRequest query. + * @member {string} query + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @instance + */ + SearchAllAssignmentsRequest.prototype.query = ""; + + /** + * SearchAllAssignmentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @instance + */ + SearchAllAssignmentsRequest.prototype.pageSize = 0; + + /** + * SearchAllAssignmentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @instance + */ + SearchAllAssignmentsRequest.prototype.pageToken = ""; + + /** + * Creates a new SearchAllAssignmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest} SearchAllAssignmentsRequest instance + */ + SearchAllAssignmentsRequest.create = function create(properties) { + return new SearchAllAssignmentsRequest(properties); + }; + + /** + * Encodes the specified SearchAllAssignmentsRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest} message SearchAllAssignmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllAssignmentsRequest.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.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 SearchAllAssignmentsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest} message SearchAllAssignmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllAssignmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchAllAssignmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest} SearchAllAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllAssignmentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = 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; + } + } + return message; + }; + + /** + * Decodes a SearchAllAssignmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest} SearchAllAssignmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllAssignmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchAllAssignmentsRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchAllAssignmentsRequest.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.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 SearchAllAssignmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest} SearchAllAssignmentsRequest + */ + SearchAllAssignmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + 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 SearchAllAssignmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest} message SearchAllAssignmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchAllAssignmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + 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 SearchAllAssignmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @instance + * @returns {Object.} JSON object + */ + SearchAllAssignmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SearchAllAssignmentsRequest; + })(); + v1.SearchAssignmentsResponse = (function() { /** @@ -6374,6 +6816,237 @@ return SearchAssignmentsResponse; })(); + v1.SearchAllAssignmentsResponse = (function() { + + /** + * Properties of a SearchAllAssignmentsResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface ISearchAllAssignmentsResponse + * @property {Array.|null} [assignments] SearchAllAssignmentsResponse assignments + * @property {string|null} [nextPageToken] SearchAllAssignmentsResponse nextPageToken + */ + + /** + * Constructs a new SearchAllAssignmentsResponse. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a SearchAllAssignmentsResponse. + * @implements ISearchAllAssignmentsResponse + * @constructor + * @param {google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse=} [properties] Properties to set + */ + function SearchAllAssignmentsResponse(properties) { + this.assignments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchAllAssignmentsResponse assignments. + * @member {Array.} assignments + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @instance + */ + SearchAllAssignmentsResponse.prototype.assignments = $util.emptyArray; + + /** + * SearchAllAssignmentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @instance + */ + SearchAllAssignmentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchAllAssignmentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse} SearchAllAssignmentsResponse instance + */ + SearchAllAssignmentsResponse.create = function create(properties) { + return new SearchAllAssignmentsResponse(properties); + }; + + /** + * Encodes the specified SearchAllAssignmentsResponse message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse} message SearchAllAssignmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllAssignmentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.assignments != null && message.assignments.length) + for (var i = 0; i < message.assignments.length; ++i) + $root.google.cloud.bigquery.reservation.v1.Assignment.encode(message.assignments[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 SearchAllAssignmentsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse} message SearchAllAssignmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllAssignmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchAllAssignmentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse} SearchAllAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllAssignmentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.assignments && message.assignments.length)) + message.assignments = []; + message.assignments.push($root.google.cloud.bigquery.reservation.v1.Assignment.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchAllAssignmentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse} SearchAllAssignmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllAssignmentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchAllAssignmentsResponse message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchAllAssignmentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.assignments != null && message.hasOwnProperty("assignments")) { + if (!Array.isArray(message.assignments)) + return "assignments: array expected"; + for (var i = 0; i < message.assignments.length; ++i) { + var error = $root.google.cloud.bigquery.reservation.v1.Assignment.verify(message.assignments[i]); + if (error) + return "assignments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchAllAssignmentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse} SearchAllAssignmentsResponse + */ + SearchAllAssignmentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse(); + if (object.assignments) { + if (!Array.isArray(object.assignments)) + throw TypeError(".google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse.assignments: array expected"); + message.assignments = []; + for (var i = 0; i < object.assignments.length; ++i) { + if (typeof object.assignments[i] !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse.assignments: object expected"); + message.assignments[i] = $root.google.cloud.bigquery.reservation.v1.Assignment.fromObject(object.assignments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchAllAssignmentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @static + * @param {google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse} message SearchAllAssignmentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchAllAssignmentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assignments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.assignments && message.assignments.length) { + object.assignments = []; + for (var j = 0; j < message.assignments.length; ++j) + object.assignments[j] = $root.google.cloud.bigquery.reservation.v1.Assignment.toObject(message.assignments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchAllAssignmentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @instance + * @returns {Object.} JSON object + */ + SearchAllAssignmentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SearchAllAssignmentsResponse; + })(); + v1.MoveAssignmentRequest = (function() { /** diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.json b/packages/google-cloud-bigquery-reservation/protos/protos.json index 00a0c5b289e..b45cdc9d9ec 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.json +++ b/packages/google-cloud-bigquery-reservation/protos/protos.json @@ -312,10 +312,14 @@ "requestType": "SearchAssignmentsRequest", "responseType": "SearchAssignmentsResponse", "options": { + "deprecated": true, "(google.api.http).get": "/v1/{parent=projects/*/locations/*}:searchAssignments", "(google.api.method_signature)": "parent,query" }, "parsedOptions": [ + { + "deprecated": true + }, { "(google.api.http)": { "get": "/v1/{parent=projects/*/locations/*}:searchAssignments" @@ -326,6 +330,24 @@ } ] }, + "SearchAllAssignments": { + "requestType": "SearchAllAssignmentsRequest", + "responseType": "SearchAllAssignmentsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}:searchAllAssignments", + "(google.api.method_signature)": "parent,query" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}:searchAllAssignments" + } + }, + { + "(google.api.method_signature)": "parent,query" + } + ] + }, "MoveAssignment": { "requestType": "MoveAssignmentRequest", "responseType": "Assignment", @@ -403,6 +425,20 @@ "ignoreIdleSlots": { "type": "bool", "id": 4 + }, + "creationTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -434,6 +470,13 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, + "commitmentStartTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "commitmentEndTime": { "type": "google.protobuf.Timestamp", "id": 5, @@ -579,6 +622,10 @@ "enforceSingleAdminProjectPerOrg": { "type": "bool", "id": 4 + }, + "capacityCommitmentId": { + "type": "string", + "id": 5 } } }, @@ -636,6 +683,10 @@ "(google.api.field_behavior)": "REQUIRED", "(google.api.resource_reference).type": "bigqueryreservation.googleapis.com/CapacityCommitment" } + }, + "force": { + "type": "bool", + "id": 3 } } }, @@ -729,7 +780,8 @@ "values": { "JOB_TYPE_UNSPECIFIED": 0, "PIPELINE": 1, - "QUERY": 2 + "QUERY": 2, + "ML_EXTERNAL": 3 } }, "State": { @@ -754,6 +806,10 @@ "assignment": { "type": "Assignment", "id": 2 + }, + "assignmentId": { + "type": "string", + "id": 4 } } }, @@ -826,6 +882,30 @@ } } }, + "SearchAllAssignmentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "query": { + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, "SearchAssignmentsResponse": { "fields": { "assignments": { @@ -839,6 +919,19 @@ } } }, + "SearchAllAssignmentsResponse": { + "fields": { + "assignments": { + "rule": "repeated", + "type": "Assignment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, "MoveAssignmentRequest": { "fields": { "name": { @@ -861,7 +954,7 @@ "BiReservation": { "options": { "(google.api.resource).type": "bigqueryreservation.googleapis.com/BiReservation", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/bireservation" + "(google.api.resource).pattern": "projects/{project}/locations/{location}/biReservation" }, "fields": { "name": { diff --git a/packages/google-cloud-bigquery-reservation/src/v1/gapic_metadata.json b/packages/google-cloud-bigquery-reservation/src/v1/gapic_metadata.json index 197360bed17..6e01d0e38af 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/gapic_metadata.json +++ b/packages/google-cloud-bigquery-reservation/src/v1/gapic_metadata.json @@ -112,6 +112,13 @@ "searchAssignmentsStream", "searchAssignmentsAsync" ] + }, + "SearchAllAssignments": { + "methods": [ + "searchAllAssignments", + "searchAllAssignmentsStream", + "searchAllAssignmentsAsync" + ] } } }, @@ -220,6 +227,13 @@ "searchAssignmentsStream", "searchAssignmentsAsync" ] + }, + "SearchAllAssignments": { + "methods": [ + "searchAllAssignments", + "searchAllAssignmentsStream", + "searchAllAssignmentsAsync" + ] } } } diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index 7791a4e26c7..6a6e98ff232 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts @@ -182,7 +182,7 @@ export class ReservationServiceClient { 'projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}' ), biReservationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/bireservation' + 'projects/{project}/locations/{location}/biReservation' ), capacityCommitmentPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}' @@ -222,6 +222,11 @@ export class ReservationServiceClient { 'nextPageToken', 'assignments' ), + searchAllAssignments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'assignments' + ), }; // Put together the default options sent with requests. @@ -291,6 +296,7 @@ export class ReservationServiceClient { 'listAssignments', 'deleteAssignment', 'searchAssignments', + 'searchAllAssignments', 'moveAssignment', 'getBiReservation', 'updateBiReservation', @@ -826,6 +832,12 @@ export class ReservationServiceClient { * @param {boolean} request.enforceSingleAdminProjectPerOrg * If true, fail the request if another project in the organization has a * capacity commitment. + * @param {string} request.capacityCommitmentId + * The optional capacity commitment ID. Capacity commitment name will be + * generated automatically if this field is empty. + * This field must only contain lower case alphanumeric characters or dash. + * Max length is 64 characters. + * NOTE: this ID won't be kept if the capacity commitment is split or merged. * @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. @@ -1028,6 +1040,10 @@ export class ReservationServiceClient { * @param {string} request.name * Required. Resource name of the capacity commitment to delete. E.g., * `projects/myproject/locations/US/capacityCommitments/123` + * @param {boolean} request.force + * Can be used to force delete commitments even if assignments exist. Deleting + * commitments with assignments may cause queries to fail if they no longer + * have access to slots. * @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. @@ -1481,6 +1497,11 @@ export class ReservationServiceClient { * `project2`) could all be created and mapped to the same or different * reservations. * + * "None" assignments represent an absence of the assignment. Projects + * assigned to None use on-demand pricing. To create a "None" assignment, use + * "none" as a reservation_id in the parent. Example parent: + * `projects/myproject/locations/US/reservations/none`. + * * Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have * 'bigquery.admin' permissions on the project using the reservation * and the project that owns this reservation. @@ -1495,6 +1516,11 @@ export class ReservationServiceClient { * E.g. `projects/myproject/locations/US/reservations/team1-prod` * @param {google.cloud.bigquery.reservation.v1.Assignment} request.assignment * Assignment resource to create. + * @param {string} request.assignmentId + * The optional assignment ID. Assignment name will be generated automatically + * if this field is empty. + * This field must only contain lower case alphanumeric characters or dash. + * Max length is 64 characters. * @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. @@ -1810,7 +1836,7 @@ export class ReservationServiceClient { * The request object that will be sent. * @param {string} request.name * Required. Name of the requested reservation, for example: - * `projects/{project_id}/locations/{location_id}/bireservation` + * `projects/{project_id}/locations/{location_id}/biReservation` * @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. @@ -2627,7 +2653,7 @@ export class ReservationServiceClient { > ): void; /** - * Looks up assignments for a specified resource for a particular region. + * Deprecated: Looks up assignments for a specified resource for a particular region. * If the request is about a project: * * 1. Assignments created on the project will be returned if they exist. @@ -2681,6 +2707,7 @@ export class ReservationServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. + * @deprecated SearchAssignments is deprecated and may be removed in a future version. */ searchAssignments( request?: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, @@ -2723,6 +2750,11 @@ export class ReservationServiceClient { parent: request.parent || '', }); this.initialize(); + this.warn( + 'DEP$ReservationService-$SearchAssignments', + 'SearchAssignments is deprecated and may be removed in a future version.', + 'DeprecationWarning' + ); return this.innerApiCalls.searchAssignments(request, options, callback); } @@ -2757,6 +2789,7 @@ export class ReservationServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. + * @deprecated SearchAssignments is deprecated and may be removed in a future version. */ searchAssignmentsStream( request?: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, @@ -2772,6 +2805,11 @@ export class ReservationServiceClient { }); const callSettings = new gax.CallSettings(options); this.initialize(); + this.warn( + 'DEP$ReservationService-$SearchAssignments', + 'SearchAssignments is deprecated and may be removed in a future version.', + 'DeprecationWarning' + ); return this.descriptors.page.searchAssignments.createStream( this.innerApiCalls.searchAssignments as gax.GaxCall, request, @@ -2816,6 +2854,7 @@ export class ReservationServiceClient { * for await (const response of iterable) { * // process response * } + * @deprecated SearchAssignments is deprecated and may be removed in a future version. */ searchAssignmentsAsync( request?: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, @@ -2832,12 +2871,257 @@ export class ReservationServiceClient { options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); + this.warn( + 'DEP$ReservationService-$SearchAssignments', + 'SearchAssignments is deprecated and may be removed in a future version.', + 'DeprecationWarning' + ); return this.descriptors.page.searchAssignments.asyncIterate( this.innerApiCalls['searchAssignments'] as GaxCall, request as unknown as RequestType, callSettings ) as AsyncIterable; } + searchAllAssignments( + request?: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment[], + protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest | null, + protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse + ] + >; + searchAllAssignments( + request: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): void; + searchAllAssignments( + request: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): void; + /** + * Looks up assignments for a specified resource for a particular region. + * If the request is about a project: + * + * 1. Assignments created on the project will be returned if they exist. + * 2. Otherwise assignments created on the closest ancestor will be + * returned. + * 3. Assignments for different JobTypes will all be returned. + * + * The same logic applies if the request is about a folder. + * + * If the request is about an organization, then assignments created on the + * organization will be returned (organization doesn't have ancestors). + * + * Comparing to ListAssignments, there are some behavior + * differences: + * + * 1. permission on the assignee will be verified in this API. + * 2. Hierarchy lookup (project->folder->organization) happens in this API. + * 3. Parent here is `projects/* /locations/*`, instead of + * `projects/* /locations/*reservations/*`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name with location (project name could be the wildcard '-'), + * e.g.: + * `projects/-/locations/US`. + * @param {string} request.query + * Please specify resource name as assignee in the query. + * + * Examples: + * + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. + * 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 `searchAllAssignmentsAsync()` + * 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. + */ + searchAllAssignments( + request?: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + >, + callback?: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment[], + protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest | null, + protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse + ] + > | 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.searchAllAssignments(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 resource name with location (project name could be the wildcard '-'), + * e.g.: + * `projects/-/locations/US`. + * @param {string} request.query + * Please specify resource name as assignee in the query. + * + * Examples: + * + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment} 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 `searchAllAssignmentsAsync()` + * 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. + */ + searchAllAssignmentsStream( + request?: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + 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.searchAllAssignments.createStream( + this.innerApiCalls.searchAllAssignments as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `searchAllAssignments`, 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 resource name with location (project name could be the wildcard '-'), + * e.g.: + * `projects/-/locations/US`. + * @param {string} request.query + * Please specify resource name as assignee in the query. + * + * Examples: + * + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + * @param {number} request.pageSize + * The maximum number of items to return per page. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 + * [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. 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.searchAllAssignmentsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + searchAllAssignmentsAsync( + request?: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + 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.searchAllAssignments.asyncIterate( + this.innerApiCalls['searchAllAssignments'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } // -------------------- // -- Path templates -- // -------------------- diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client_config.json b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client_config.json index 264bc72f619..70059e6ed7a 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client_config.json +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client_config.json @@ -21,7 +21,7 @@ }, "methods": { "CreateReservation": { - "timeout_millis": 60000, + "timeout_millis": 300000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, @@ -41,12 +41,12 @@ "retry_params_name": "default" }, "UpdateReservation": { - "timeout_millis": 60000, + "timeout_millis": 300000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "CreateCapacityCommitment": { - "timeout_millis": 60000, + "timeout_millis": 300000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, @@ -66,22 +66,22 @@ "retry_params_name": "default" }, "UpdateCapacityCommitment": { - "timeout_millis": 60000, + "timeout_millis": 300000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "SplitCapacityCommitment": { - "timeout_millis": 60000, + "timeout_millis": 300000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "MergeCapacityCommitments": { - "timeout_millis": 60000, + "timeout_millis": 300000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, "CreateAssignment": { - "timeout_millis": 60000, + "timeout_millis": 300000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, @@ -100,8 +100,12 @@ "retry_codes_name": "idempotent", "retry_params_name": "default" }, + "SearchAllAssignments": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "MoveAssignment": { - "timeout_millis": 60000, + "timeout_millis": 300000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, @@ -111,7 +115,7 @@ "retry_params_name": "default" }, "UpdateBiReservation": { - "timeout_millis": 60000, + "timeout_millis": 300000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" } diff --git a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts index e8586b3d53d..573757b9b3b 100644 --- a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts +++ b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts @@ -2861,6 +2861,7 @@ describe('v1.ReservationServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + const stub = sinon.stub(client, 'warn'); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() @@ -2887,6 +2888,7 @@ describe('v1.ReservationServiceClient', () => { ]; client.innerApiCalls.searchAssignments = stubSimpleCall(expectedResponse); const [response] = await client.searchAssignments(request); + assert(stub.calledOnce); assert.deepStrictEqual(response, expectedResponse); assert( (client.innerApiCalls.searchAssignments as SinonStub) @@ -2900,6 +2902,7 @@ describe('v1.ReservationServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + const stub = sinon.stub(client, 'warn'); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() @@ -2944,6 +2947,7 @@ describe('v1.ReservationServiceClient', () => { ); }); const response = await promise; + assert(stub.calledOnce); assert.deepStrictEqual(response, expectedResponse); assert( (client.innerApiCalls.searchAssignments as SinonStub) @@ -2957,6 +2961,7 @@ describe('v1.ReservationServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + const stub = sinon.stub(client, 'warn'); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() @@ -2976,6 +2981,7 @@ describe('v1.ReservationServiceClient', () => { expectedError ); await assert.rejects(client.searchAssignments(request), expectedError); + assert(stub.calledOnce); assert( (client.innerApiCalls.searchAssignments as SinonStub) .getCall(0) @@ -2988,6 +2994,7 @@ describe('v1.ReservationServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + const stub = sinon.stub(client, 'warn'); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() @@ -3027,6 +3034,7 @@ describe('v1.ReservationServiceClient', () => { }); }); const responses = await promise; + assert(stub.calledOnce); assert.deepStrictEqual(responses, expectedResponse); assert( (client.descriptors.page.searchAssignments.createStream as SinonStub) @@ -3046,6 +3054,7 @@ describe('v1.ReservationServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + const stub = sinon.stub(client, 'warn'); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() @@ -3075,6 +3084,7 @@ describe('v1.ReservationServiceClient', () => { }); }); await assert.rejects(promise, expectedError); + assert(stub.calledOnce); assert( (client.descriptors.page.searchAssignments.createStream as SinonStub) .getCall(0) @@ -3093,6 +3103,7 @@ describe('v1.ReservationServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + const stub = sinon.stub(client, 'warn'); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() @@ -3118,6 +3129,7 @@ describe('v1.ReservationServiceClient', () => { for await (const resource of iterable) { responses.push(resource!); } + assert(stub.calledOnce); assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( @@ -3138,6 +3150,7 @@ describe('v1.ReservationServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + const stub = sinon.stub(client, 'warn'); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() @@ -3155,6 +3168,7 @@ describe('v1.ReservationServiceClient', () => { responses.push(resource!); } }); + assert(stub.calledOnce); assert.deepStrictEqual( ( client.descriptors.page.searchAssignments.asyncIterate as SinonStub @@ -3170,6 +3184,322 @@ describe('v1.ReservationServiceClient', () => { }); }); + describe('searchAllAssignments', () => { + it('invokes searchAllAssignments without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.innerApiCalls.searchAllAssignments = + stubSimpleCall(expectedResponse); + const [response] = await client.searchAllAssignments(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.searchAllAssignments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes searchAllAssignments without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.innerApiCalls.searchAllAssignments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchAllAssignments( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.bigquery.reservation.v1.IAssignment[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.searchAllAssignments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes searchAllAssignments with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.searchAllAssignments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.searchAllAssignments(request), expectedError); + assert( + (client.innerApiCalls.searchAllAssignments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes searchAllAssignmentsStream without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.descriptors.page.searchAllAssignments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.searchAllAssignmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.reservation.v1.Assignment[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.reservation.v1.Assignment + ) => { + 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.searchAllAssignments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchAllAssignments, request) + ); + assert.strictEqual( + ( + client.descriptors.page.searchAllAssignments.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes searchAllAssignmentsStream with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.searchAllAssignments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.searchAllAssignmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.bigquery.reservation.v1.Assignment[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.reservation.v1.Assignment + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.searchAllAssignments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.searchAllAssignments, request) + ); + assert.strictEqual( + ( + client.descriptors.page.searchAllAssignments.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchAllAssignments without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ), + ]; + client.descriptors.page.searchAllAssignments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.bigquery.reservation.v1.IAssignment[] = + []; + const iterable = client.searchAllAssignmentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.searchAllAssignments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.searchAllAssignments.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with searchAllAssignments with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.searchAllAssignments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchAllAssignmentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.bigquery.reservation.v1.IAssignment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.searchAllAssignments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.searchAllAssignments.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + describe('Path templates', () => { describe('assignment', () => { const fakePath = '/rendered/path/assignment'; From 125de60dce645a6be28baa651760424a76fc67e7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 1 Sep 2021 19:40:19 +0000 Subject: [PATCH 060/105] chore: release 1.3.0 (#104) :robot: I have created a release \*beep\* \*boop\* --- ## [1.3.0](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.2.0...v1.3.0) (2021-09-01) ### Features * Added commitment_start_time to capacity commitments ([be13d46](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/be13d466f443af4ab88aff045eca2965eb11a968)) * Deprecated SearchAssignments in favor of SearchAllAssignments ([be13d46](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/be13d466f443af4ab88aff045eca2965eb11a968)) * Deprecated SearchAssignments in favor of SearchAllAssignments ([be13d46](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/be13d466f443af4ab88aff045eca2965eb11a968)) * Force deleting capacity commitments is allowed ... ([#103](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/103)) ([be13d46](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/be13d466f443af4ab88aff045eca2965eb11a968)) * Reservation objects now contain a creation time and an update time ([be13d46](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/be13d466f443af4ab88aff045eca2965eb11a968)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- .../google-cloud-bigquery-reservation/CHANGELOG.md | 11 +++++++++++ .../google-cloud-bigquery-reservation/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/CHANGELOG.md b/packages/google-cloud-bigquery-reservation/CHANGELOG.md index 637dfc1a6af..fca76ac9659 100644 --- a/packages/google-cloud-bigquery-reservation/CHANGELOG.md +++ b/packages/google-cloud-bigquery-reservation/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [1.3.0](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.2.0...v1.3.0) (2021-09-01) + + +### Features + +* Added commitment_start_time to capacity commitments ([be13d46](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/be13d466f443af4ab88aff045eca2965eb11a968)) +* Deprecated SearchAssignments in favor of SearchAllAssignments ([be13d46](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/be13d466f443af4ab88aff045eca2965eb11a968)) +* Deprecated SearchAssignments in favor of SearchAllAssignments ([be13d46](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/be13d466f443af4ab88aff045eca2965eb11a968)) +* Force deleting capacity commitments is allowed ... ([#103](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/103)) ([be13d46](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/be13d466f443af4ab88aff045eca2965eb11a968)) +* Reservation objects now contain a creation time and an update time ([be13d46](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/be13d466f443af4ab88aff045eca2965eb11a968)) + ## [1.2.0](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.1.6...v1.2.0) (2021-08-23) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index dc1aa0da552..1d0760b797b 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-reservation", - "version": "1.2.0", + "version": "1.3.0", "description": "BigQuery Reservation client for Node.js", "repository": "googleapis/nodejs-bigquery-reservation", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-reservation/samples/package.json b/packages/google-cloud-bigquery-reservation/samples/package.json index de2d27562ee..b7a9cc17e97 100644 --- a/packages/google-cloud-bigquery-reservation/samples/package.json +++ b/packages/google-cloud-bigquery-reservation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-reservation": "^1.2.0" + "@google-cloud/bigquery-reservation": "^1.3.0" }, "devDependencies": { "c8": "^7.1.0", From 6066cc49bc387c8cbe9d87e7824c8777abdf65aa Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 5 Oct 2021 17:30:12 +0000 Subject: [PATCH 061/105] docs(samples): add auto-generated samples for Node with api short name in region tag (#109) - [ ] 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 --- .../reservation_service.create_assignment.js | 65 +++++++++++++++++ ...tion_service.create_capacity_commitment.js | 71 ++++++++++++++++++ .../reservation_service.create_reservation.js | 63 ++++++++++++++++ .../reservation_service.delete_assignment.js | 54 ++++++++++++++ ...tion_service.delete_capacity_commitment.js | 60 +++++++++++++++ .../reservation_service.delete_reservation.js | 54 ++++++++++++++ .../reservation_service.get_bi_reservation.js | 54 ++++++++++++++ ...rvation_service.get_capacity_commitment.js | 54 ++++++++++++++ .../v1/reservation_service.get_reservation.js | 54 ++++++++++++++ .../reservation_service.list_assignments.js | 66 +++++++++++++++++ ...ation_service.list_capacity_commitments.js | 66 +++++++++++++++++ .../reservation_service.list_reservations.js | 64 ++++++++++++++++ ...tion_service.merge_capacity_commitments.js | 60 +++++++++++++++ .../v1/reservation_service.move_assignment.js | 60 +++++++++++++++ ...ervation_service.search_all_assignments.js | 73 +++++++++++++++++++ .../reservation_service.search_assignments.js | 73 +++++++++++++++++++ ...ation_service.split_capacity_commitment.js | 58 +++++++++++++++ ...servation_service.update_bi_reservation.js | 55 ++++++++++++++ ...tion_service.update_capacity_commitment.js | 55 ++++++++++++++ .../reservation_service.update_reservation.js | 55 ++++++++++++++ .../src/v1/reservation_service_client.ts | 30 +++++--- 21 files changed, 1234 insertions(+), 10 deletions(-) create mode 100644 packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js create mode 100644 packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js create mode 100644 packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js create mode 100644 packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js create mode 100644 packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js create mode 100644 packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js create mode 100644 packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js create mode 100644 packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js create mode 100644 packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js create mode 100644 packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js create mode 100644 packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js create mode 100644 packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js create mode 100644 packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js create mode 100644 packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js create mode 100644 packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js create mode 100644 packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js create mode 100644 packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js create mode 100644 packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js create mode 100644 packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js create mode 100644 packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js new file mode 100644 index 00000000000..c3eb6a86552 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js @@ -0,0 +1,65 @@ +// 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 bigqueryreservation_v1_generated_ReservationService_CreateAssignment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name of the assignment + * E.g. `projects/myproject/locations/US/reservations/team1-prod` + */ + // const parent = 'abc123' + /** + * Assignment resource to create. + */ + // const assignment = '' + /** + * The optional assignment ID. Assignment name will be generated automatically + * if this field is empty. + * This field must only contain lower case alphanumeric characters or dash. + * Max length is 64 characters. + */ + // const assignmentId = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = + require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function createAssignment() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await reservationClient.createAssignment(request); + console.log(response); + } + + createAssignment(); + // [END bigqueryreservation_v1_generated_ReservationService_CreateAssignment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js new file mode 100644 index 00000000000..32dd481bf5b --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js @@ -0,0 +1,71 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent) { + // [START bigqueryreservation_v1_generated_ReservationService_CreateCapacityCommitment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + */ + // const parent = 'abc123' + /** + * Content of the capacity commitment to create. + */ + // const capacityCommitment = '' + /** + * If true, fail the request if another project in the organization has a + * capacity commitment. + */ + // const enforceSingleAdminProjectPerOrg = true + /** + * The optional capacity commitment ID. Capacity commitment name will be + * generated automatically if this field is empty. + * This field must only contain lower case alphanumeric characters or dash. + * Max length is 64 characters. + * NOTE: this ID won't be kept if the capacity commitment is split or merged. + */ + // const capacityCommitmentId = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = + require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function createCapacityCommitment() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await reservationClient.createCapacityCommitment(request); + console.log(response); + } + + createCapacityCommitment(); + // [END bigqueryreservation_v1_generated_ReservationService_CreateCapacityCommitment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js new file mode 100644 index 00000000000..f5c53986a6f --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.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(parent) { + // [START bigqueryreservation_v1_generated_ReservationService_CreateReservation_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Project, location. E.g., + * `projects/myproject/locations/US` + */ + // const parent = 'abc123' + /** + * The reservation ID. This field must only contain lower case alphanumeric + * characters or dash. Max length is 64 characters. + */ + // const reservationId = 'abc123' + /** + * Definition of the new reservation to create. + */ + // const reservation = '' + + // Imports the Reservation library + const {ReservationServiceClient} = + require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function createReservation() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await reservationClient.createReservation(request); + console.log(response); + } + + createReservation(); + // [END bigqueryreservation_v1_generated_ReservationService_CreateReservation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js new file mode 100644 index 00000000000..75733986f36 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.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(name) { + // [START bigqueryreservation_v1_generated_ReservationService_DeleteAssignment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource, e.g. + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + */ + // const name = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = + require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function deleteAssignment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await reservationClient.deleteAssignment(request); + console.log(response); + } + + deleteAssignment(); + // [END bigqueryreservation_v1_generated_ReservationService_DeleteAssignment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js new file mode 100644 index 00000000000..5e87bc4b988 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js @@ -0,0 +1,60 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START bigqueryreservation_v1_generated_ReservationService_DeleteCapacityCommitment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the capacity commitment to delete. E.g., + * `projects/myproject/locations/US/capacityCommitments/123` + */ + // const name = 'abc123' + /** + * Can be used to force delete commitments even if assignments exist. Deleting + * commitments with assignments may cause queries to fail if they no longer + * have access to slots. + */ + // const force = true + + // Imports the Reservation library + const {ReservationServiceClient} = + require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function deleteCapacityCommitment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await reservationClient.deleteCapacityCommitment(request); + console.log(response); + } + + deleteCapacityCommitment(); + // [END bigqueryreservation_v1_generated_ReservationService_DeleteCapacityCommitment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js new file mode 100644 index 00000000000..04ceef5e546 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.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(name) { + // [START bigqueryreservation_v1_generated_ReservationService_DeleteReservation_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the reservation to retrieve. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + */ + // const name = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = + require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function deleteReservation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await reservationClient.deleteReservation(request); + console.log(response); + } + + deleteReservation(); + // [END bigqueryreservation_v1_generated_ReservationService_DeleteReservation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js new file mode 100644 index 00000000000..0b641aca56d --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.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(name) { + // [START bigqueryreservation_v1_generated_ReservationService_GetBiReservation_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the requested reservation, for example: + * `projects/{project_id}/locations/{location_id}/biReservation` + */ + // const name = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = + require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function getBiReservation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await reservationClient.getBiReservation(request); + console.log(response); + } + + getBiReservation(); + // [END bigqueryreservation_v1_generated_ReservationService_GetBiReservation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js new file mode 100644 index 00000000000..f34f1124c77 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.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(name) { + // [START bigqueryreservation_v1_generated_ReservationService_GetCapacityCommitment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the capacity commitment to retrieve. E.g., + * `projects/myproject/locations/US/capacityCommitments/123` + */ + // const name = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = + require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function getCapacityCommitment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await reservationClient.getCapacityCommitment(request); + console.log(response); + } + + getCapacityCommitment(); + // [END bigqueryreservation_v1_generated_ReservationService_GetCapacityCommitment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js new file mode 100644 index 00000000000..e9e27f06cef --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.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(name) { + // [START bigqueryreservation_v1_generated_ReservationService_GetReservation_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the reservation to retrieve. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + */ + // const name = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = + require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function getReservation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await reservationClient.getReservation(request); + console.log(response); + } + + getReservation(); + // [END bigqueryreservation_v1_generated_ReservationService_GetReservation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js new file mode 100644 index 00000000000..02e24ed8d5e --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js @@ -0,0 +1,66 @@ +// 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 bigqueryreservation_v1_generated_ReservationService_ListAssignments_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name e.g.: + * `projects/myproject/locations/US/reservations/team1-prod` + * Or: + * `projects/myproject/locations/US/reservations/-` + */ + // const parent = 'abc123' + /** + * The maximum number of items to return per page. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = + require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function listAssignments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await reservationClient.listAssignmentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listAssignments(); + // [END bigqueryreservation_v1_generated_ReservationService_ListAssignments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js new file mode 100644 index 00000000000..04a371b0861 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js @@ -0,0 +1,66 @@ +// 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 bigqueryreservation_v1_generated_ReservationService_ListCapacityCommitments_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = + require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function listCapacityCommitments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await reservationClient.listCapacityCommitmentsAsync( + request + ); + for await (const response of iterable) { + console.log(response); + } + } + + listCapacityCommitments(); + // [END bigqueryreservation_v1_generated_ReservationService_ListCapacityCommitments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js new file mode 100644 index 00000000000..1b255ad6a03 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js @@ -0,0 +1,64 @@ +// 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 bigqueryreservation_v1_generated_ReservationService_ListReservations_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name containing project and location, e.g.: + * `projects/myproject/locations/US` + */ + // const parent = 'abc123' + /** + * The maximum number of items to return per page. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = + require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function listReservations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await reservationClient.listReservationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listReservations(); + // [END bigqueryreservation_v1_generated_ReservationService_ListReservations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js new file mode 100644 index 00000000000..9d15f02230c --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js @@ -0,0 +1,60 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main() { + // [START bigqueryreservation_v1_generated_ReservationService_MergeCapacityCommitments_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Parent resource that identifies admin project and location e.g., + * `projects/myproject/locations/us` + */ + // const parent = 'abc123' + /** + * Ids of capacity commitments to merge. + * These capacity commitments must exist under admin project and location + * specified in the parent. + * ID is the last portion of capacity commitment name e.g., 'abc' for + * projects/myproject/locations/US/capacityCommitments/abc + */ + // const capacityCommitmentIds = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = + require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function mergeCapacityCommitments() { + // Construct request + const request = {}; + + // Run request + const response = await reservationClient.mergeCapacityCommitments(request); + console.log(response); + } + + mergeCapacityCommitments(); + // [END bigqueryreservation_v1_generated_ReservationService_MergeCapacityCommitments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js new file mode 100644 index 00000000000..d1db9490db7 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js @@ -0,0 +1,60 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START bigqueryreservation_v1_generated_ReservationService_MoveAssignment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the assignment, + * e.g. + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + */ + // const name = 'abc123' + /** + * The new reservation ID, e.g.: + * `projects/myotherproject/locations/US/reservations/team2-prod` + */ + // const destinationId = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = + require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function moveAssignment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await reservationClient.moveAssignment(request); + console.log(response); + } + + moveAssignment(); + // [END bigqueryreservation_v1_generated_ReservationService_MoveAssignment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js new file mode 100644 index 00000000000..3f7340b4265 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js @@ -0,0 +1,73 @@ +// 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 bigqueryreservation_v1_generated_ReservationService_SearchAllAssignments_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name with location (project name could be the wildcard '-'), + * e.g.: + * `projects/-/locations/US`. + */ + // const parent = 'abc123' + /** + * Please specify resource name as assignee in the query. + * Examples: + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + */ + // const query = 'abc123' + /** + * The maximum number of items to return per page. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = + require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function searchAllAssignments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await reservationClient.searchAllAssignmentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + searchAllAssignments(); + // [END bigqueryreservation_v1_generated_ReservationService_SearchAllAssignments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js new file mode 100644 index 00000000000..6353e6be98a --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js @@ -0,0 +1,73 @@ +// 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 bigqueryreservation_v1_generated_ReservationService_SearchAssignments_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the admin project(containing project and location), + * e.g.: + * `projects/myproject/locations/US`. + */ + // const parent = 'abc123' + /** + * Please specify resource name as assignee in the query. + * Examples: + * * `assignee=projects/myproject` + * * `assignee=folders/123` + * * `assignee=organizations/456` + */ + // const query = 'abc123' + /** + * The maximum number of items to return per page. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + + // Imports the Reservation library + const {ReservationServiceClient} = + require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function searchAssignments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await reservationClient.searchAssignmentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + searchAssignments(); + // [END bigqueryreservation_v1_generated_ReservationService_SearchAssignments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js new file mode 100644 index 00000000000..8526addd8f4 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.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(name) { + // [START bigqueryreservation_v1_generated_ReservationService_SplitCapacityCommitment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name e.g.,: + * `projects/myproject/locations/US/capacityCommitments/123` + */ + // const name = 'abc123' + /** + * Number of slots in the capacity commitment after the split. + */ + // const slotCount = 1234 + + // Imports the Reservation library + const {ReservationServiceClient} = + require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function splitCapacityCommitment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await reservationClient.splitCapacityCommitment(request); + console.log(response); + } + + splitCapacityCommitment(); + // [END bigqueryreservation_v1_generated_ReservationService_SplitCapacityCommitment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js new file mode 100644 index 00000000000..d22943ad5c1 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.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() { + // [START bigqueryreservation_v1_generated_ReservationService_UpdateBiReservation_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * A reservation to update. + */ + // const biReservation = '' + /** + * A list of fields to be updated in this request. + */ + // const updateMask = '' + + // Imports the Reservation library + const {ReservationServiceClient} = + require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function updateBiReservation() { + // Construct request + const request = {}; + + // Run request + const response = await reservationClient.updateBiReservation(request); + console.log(response); + } + + updateBiReservation(); + // [END bigqueryreservation_v1_generated_ReservationService_UpdateBiReservation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js new file mode 100644 index 00000000000..00fd5b391dc --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.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() { + // [START bigqueryreservation_v1_generated_ReservationService_UpdateCapacityCommitment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Content of the capacity commitment to update. + */ + // const capacityCommitment = '' + /** + * Standard field mask for the set of fields to be updated. + */ + // const updateMask = '' + + // Imports the Reservation library + const {ReservationServiceClient} = + require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function updateCapacityCommitment() { + // Construct request + const request = {}; + + // Run request + const response = await reservationClient.updateCapacityCommitment(request); + console.log(response); + } + + updateCapacityCommitment(); + // [END bigqueryreservation_v1_generated_ReservationService_UpdateCapacityCommitment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js new file mode 100644 index 00000000000..9847adecd50 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.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() { + // [START bigqueryreservation_v1_generated_ReservationService_UpdateReservation_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Content of the reservation to update. + */ + // const reservation = '' + /** + * Standard field mask for the set of fields to be updated. + */ + // const updateMask = '' + + // Imports the Reservation library + const {ReservationServiceClient} = + require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function updateReservation() { + // Construct request + const request = {}; + + // Run request + const response = await reservationClient.updateReservation(request); + console.log(response); + } + + updateReservation(); + // [END bigqueryreservation_v1_generated_ReservationService_UpdateReservation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index 6a6e98ff232..14cde1e22ce 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts @@ -2135,7 +2135,8 @@ export class ReservationServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listReservations']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listReservations.createStream( this.innerApiCalls.listReservations as gax.GaxCall, @@ -2186,7 +2187,8 @@ export class ReservationServiceClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listReservations']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listReservations.asyncIterate( this.innerApiCalls['listReservations'] as GaxCall, @@ -2333,7 +2335,8 @@ export class ReservationServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listCapacityCommitments']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listCapacityCommitments.createStream( this.innerApiCalls.listCapacityCommitments as gax.GaxCall, @@ -2384,7 +2387,8 @@ export class ReservationServiceClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listCapacityCommitments']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listCapacityCommitments.asyncIterate( this.innerApiCalls['listCapacityCommitments'] as GaxCall, @@ -2557,7 +2561,8 @@ export class ReservationServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listAssignments']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAssignments.createStream( this.innerApiCalls.listAssignments as gax.GaxCall, @@ -2613,7 +2618,8 @@ export class ReservationServiceClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listAssignments']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAssignments.asyncIterate( this.innerApiCalls['listAssignments'] as GaxCall, @@ -2803,7 +2809,8 @@ export class ReservationServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['searchAssignments']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); this.warn( 'DEP$ReservationService-$SearchAssignments', @@ -2869,7 +2876,8 @@ export class ReservationServiceClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['searchAssignments']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); this.warn( 'DEP$ReservationService-$SearchAssignments', @@ -3054,7 +3062,8 @@ export class ReservationServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['searchAllAssignments']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.searchAllAssignments.createStream( this.innerApiCalls.searchAllAssignments as gax.GaxCall, @@ -3114,7 +3123,8 @@ export class ReservationServiceClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['searchAllAssignments']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.searchAllAssignments.asyncIterate( this.innerApiCalls['searchAllAssignments'] as GaxCall, From 5a1da24d9b3db20a808e283ee5d4b9a96ce683d1 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:21 +0000 Subject: [PATCH 062/105] build(node): update deps used during postprocessing (#1243) (#112) --- .../protos/protos.d.ts | 3 ++- .../protos/protos.js | 7 +++++++ .../protos/protos.json | 15 ++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts b/packages/google-cloud-bigquery-reservation/protos/protos.d.ts index e303e2c5b21..bad450ab546 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-reservation/protos/protos.d.ts @@ -3853,7 +3853,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-bigquery-reservation/protos/protos.js b/packages/google-cloud-bigquery-reservation/protos/protos.js index b5e2f7c9850..1bf8fdff941 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.js +++ b/packages/google-cloud-bigquery-reservation/protos/protos.js @@ -8851,6 +8851,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); @@ -8861,6 +8862,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; })(); @@ -15029,6 +15031,7 @@ case 4: case 5: case 6: + case 7: break; } } @@ -15133,6 +15136,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-bigquery-reservation/protos/protos.json b/packages/google-cloud-bigquery-reservation/protos/protos.json index b45cdc9d9ec..16eb049b737 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.json +++ b/packages/google-cloud-bigquery-reservation/protos/protos.json @@ -1133,7 +1133,8 @@ "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, "IMMUTABLE": 5, - "UNORDERED_LIST": 6 + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 } }, "resourceReference": { @@ -1776,6 +1777,18 @@ ] ], "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], [ 8, 8 From c4abaf3698cfe2c0dffc64c1a2a72f0f1bb8b8f2 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Wed, 27 Oct 2021 13:40:15 -0400 Subject: [PATCH 063/105] chore(cloud-rad): delete api-extractor config (#113) --- .../api-extractor.json | 369 ------------------ 1 file changed, 369 deletions(-) delete mode 100644 packages/google-cloud-bigquery-reservation/api-extractor.json diff --git a/packages/google-cloud-bigquery-reservation/api-extractor.json b/packages/google-cloud-bigquery-reservation/api-extractor.json deleted file mode 100644 index de228294b23..00000000000 --- a/packages/google-cloud-bigquery-reservation/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 9ff267e99bdacc8e0ec830483e796069c8a253f1 Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Wed, 27 Oct 2021 11:36:17 -0700 Subject: [PATCH 064/105] chore: fix the wrong post processor image (#115) --- packages/google-cloud-bigquery-reservation/.github/.OwlBot.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/.github/.OwlBot.yaml b/packages/google-cloud-bigquery-reservation/.github/.OwlBot.yaml index 3486c47fa21..25f992e9050 100644 --- a/packages/google-cloud-bigquery-reservation/.github/.OwlBot.yaml +++ b/packages/google-cloud-bigquery-reservation/.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 11c819398582e21fe477815ce655ba36bba37fcc Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 27 Oct 2021 22:36:12 +0200 Subject: [PATCH 065/105] chore(deps): update dependency @types/node to v16 (#114) Co-authored-by: Takashi Matsuo --- packages/google-cloud-bigquery-reservation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 1d0760b797b..f856d7cda20 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -43,7 +43,7 @@ }, "devDependencies": { "@types/mocha": "^8.0.0", - "@types/node": "^14.0.19", + "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.2.0", "gts": "^2.0.2", From b7ff1aa6a644ed4d67c926353da41e0fcf493f67 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 4 Nov 2021 20:44:14 +0100 Subject: [PATCH 066/105] chore(deps): update dependency sinon to v12 (#116) 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-bigquery-reservation). --- packages/google-cloud-bigquery-reservation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index f856d7cda20..0bfb5db9faf 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -54,7 +54,7 @@ "mocha": "^8.0.1", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^11.0.0", + "sinon": "^12.0.0", "ts-loader": "^8.0.0", "typescript": "^3.9.6", "webpack": "^5.0.0", From f86258cb4ea2834e9c254ba156c37d45a70339df Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 11 Nov 2021 16:04:49 -0800 Subject: [PATCH 067/105] docs(samples): add example tags to generated samples (#117) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs(samples): add example tags to generated samples PiperOrigin-RevId: 408439482 Source-Link: https://github.com/googleapis/googleapis/commit/b9f61843dc80c7c285fc34fd3a40aae55082c2b9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/eb888bc214efc7bf43bf4634b470254565a659a5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../linkinator.config.json | 2 +- .../reservation_service.create_assignment.js | 6 +- ...tion_service.create_capacity_commitment.js | 6 +- .../reservation_service.create_reservation.js | 6 +- .../reservation_service.delete_assignment.js | 4 +- ...tion_service.delete_capacity_commitment.js | 4 +- .../reservation_service.delete_reservation.js | 4 +- .../reservation_service.get_bi_reservation.js | 4 +- ...rvation_service.get_capacity_commitment.js | 4 +- .../v1/reservation_service.get_reservation.js | 4 +- .../reservation_service.list_assignments.js | 4 +- ...ation_service.list_capacity_commitments.js | 4 +- .../reservation_service.list_reservations.js | 4 +- ...tion_service.merge_capacity_commitments.js | 4 +- .../v1/reservation_service.move_assignment.js | 4 +- ...ervation_service.search_all_assignments.js | 4 +- .../reservation_service.search_assignments.js | 4 +- ...ation_service.split_capacity_commitment.js | 4 +- ...servation_service.update_bi_reservation.js | 8 +- ...tion_service.update_capacity_commitment.js | 8 +- .../reservation_service.update_reservation.js | 8 +- .../src/v1/reservation_service_client.ts | 1080 ++++++++--------- 22 files changed, 580 insertions(+), 600 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/linkinator.config.json b/packages/google-cloud-bigquery-reservation/linkinator.config.json index 29a223b6db6..0121dfa684f 100644 --- a/packages/google-cloud-bigquery-reservation/linkinator.config.json +++ b/packages/google-cloud-bigquery-reservation/linkinator.config.json @@ -6,5 +6,5 @@ "img.shields.io" ], "silent": true, - "concurrency": 10 + "concurrency": 5 } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js index c3eb6a86552..2526fac4dae 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js @@ -27,7 +27,7 @@ function main(parent) { /** * Assignment resource to create. */ - // const assignment = '' + // const assignment = {} /** * The optional assignment ID. Assignment name will be generated automatically * if this field is empty. @@ -43,7 +43,7 @@ function main(parent) { // Instantiates a client const reservationClient = new ReservationServiceClient(); - async function createAssignment() { + async function callCreateAssignment() { // Construct request const request = { parent, @@ -54,7 +54,7 @@ function main(parent) { console.log(response); } - createAssignment(); + callCreateAssignment(); // [END bigqueryreservation_v1_generated_ReservationService_CreateAssignment_async] } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js index 32dd481bf5b..0b1989ace3c 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js @@ -27,7 +27,7 @@ function main(parent) { /** * Content of the capacity commitment to create. */ - // const capacityCommitment = '' + // const capacityCommitment = {} /** * If true, fail the request if another project in the organization has a * capacity commitment. @@ -49,7 +49,7 @@ function main(parent) { // Instantiates a client const reservationClient = new ReservationServiceClient(); - async function createCapacityCommitment() { + async function callCreateCapacityCommitment() { // Construct request const request = { parent, @@ -60,7 +60,7 @@ function main(parent) { console.log(response); } - createCapacityCommitment(); + callCreateCapacityCommitment(); // [END bigqueryreservation_v1_generated_ReservationService_CreateCapacityCommitment_async] } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js index f5c53986a6f..3db716a0867 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js @@ -32,7 +32,7 @@ function main(parent) { /** * Definition of the new reservation to create. */ - // const reservation = '' + // const reservation = {} // Imports the Reservation library const {ReservationServiceClient} = @@ -41,7 +41,7 @@ function main(parent) { // Instantiates a client const reservationClient = new ReservationServiceClient(); - async function createReservation() { + async function callCreateReservation() { // Construct request const request = { parent, @@ -52,7 +52,7 @@ function main(parent) { console.log(response); } - createReservation(); + callCreateReservation(); // [END bigqueryreservation_v1_generated_ReservationService_CreateReservation_async] } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js index 75733986f36..342c2f489b5 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const reservationClient = new ReservationServiceClient(); - async function deleteAssignment() { + async function callDeleteAssignment() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - deleteAssignment(); + callDeleteAssignment(); // [END bigqueryreservation_v1_generated_ReservationService_DeleteAssignment_async] } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js index 5e87bc4b988..64b988e2cd5 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js @@ -38,7 +38,7 @@ function main(name) { // Instantiates a client const reservationClient = new ReservationServiceClient(); - async function deleteCapacityCommitment() { + async function callDeleteCapacityCommitment() { // Construct request const request = { name, @@ -49,7 +49,7 @@ function main(name) { console.log(response); } - deleteCapacityCommitment(); + callDeleteCapacityCommitment(); // [END bigqueryreservation_v1_generated_ReservationService_DeleteCapacityCommitment_async] } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js index 04ceef5e546..f8a5c246a6b 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const reservationClient = new ReservationServiceClient(); - async function deleteReservation() { + async function callDeleteReservation() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - deleteReservation(); + callDeleteReservation(); // [END bigqueryreservation_v1_generated_ReservationService_DeleteReservation_async] } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js index 0b641aca56d..cb9be2f398c 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const reservationClient = new ReservationServiceClient(); - async function getBiReservation() { + async function callGetBiReservation() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getBiReservation(); + callGetBiReservation(); // [END bigqueryreservation_v1_generated_ReservationService_GetBiReservation_async] } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js index f34f1124c77..8600856255f 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const reservationClient = new ReservationServiceClient(); - async function getCapacityCommitment() { + async function callGetCapacityCommitment() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getCapacityCommitment(); + callGetCapacityCommitment(); // [END bigqueryreservation_v1_generated_ReservationService_GetCapacityCommitment_async] } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js index e9e27f06cef..61d27330c5e 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const reservationClient = new ReservationServiceClient(); - async function getReservation() { + async function callGetReservation() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getReservation(); + callGetReservation(); // [END bigqueryreservation_v1_generated_ReservationService_GetReservation_async] } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js index 02e24ed8d5e..1d1bc835124 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js @@ -42,7 +42,7 @@ function main(parent) { // Instantiates a client const reservationClient = new ReservationServiceClient(); - async function listAssignments() { + async function callListAssignments() { // Construct request const request = { parent, @@ -55,7 +55,7 @@ function main(parent) { } } - listAssignments(); + callListAssignments(); // [END bigqueryreservation_v1_generated_ReservationService_ListAssignments_async] } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js index 04a371b0861..62277721f62 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js @@ -40,7 +40,7 @@ function main(parent) { // Instantiates a client const reservationClient = new ReservationServiceClient(); - async function listCapacityCommitments() { + async function callListCapacityCommitments() { // Construct request const request = { parent, @@ -55,7 +55,7 @@ function main(parent) { } } - listCapacityCommitments(); + callListCapacityCommitments(); // [END bigqueryreservation_v1_generated_ReservationService_ListCapacityCommitments_async] } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js index 1b255ad6a03..e1517b2df85 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js @@ -40,7 +40,7 @@ function main(parent) { // Instantiates a client const reservationClient = new ReservationServiceClient(); - async function listReservations() { + async function callListReservations() { // Construct request const request = { parent, @@ -53,7 +53,7 @@ function main(parent) { } } - listReservations(); + callListReservations(); // [END bigqueryreservation_v1_generated_ReservationService_ListReservations_async] } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js index 9d15f02230c..e10eb8895f6 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js @@ -40,7 +40,7 @@ function main() { // Instantiates a client const reservationClient = new ReservationServiceClient(); - async function mergeCapacityCommitments() { + async function callMergeCapacityCommitments() { // Construct request const request = {}; @@ -49,7 +49,7 @@ function main() { console.log(response); } - mergeCapacityCommitments(); + callMergeCapacityCommitments(); // [END bigqueryreservation_v1_generated_ReservationService_MergeCapacityCommitments_async] } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js index d1db9490db7..d6b0b5bcc64 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js @@ -38,7 +38,7 @@ function main(name) { // Instantiates a client const reservationClient = new ReservationServiceClient(); - async function moveAssignment() { + async function callMoveAssignment() { // Construct request const request = { name, @@ -49,7 +49,7 @@ function main(name) { console.log(response); } - moveAssignment(); + callMoveAssignment(); // [END bigqueryreservation_v1_generated_ReservationService_MoveAssignment_async] } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js index 3f7340b4265..ae5d20bdc8e 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js @@ -49,7 +49,7 @@ function main(parent) { // Instantiates a client const reservationClient = new ReservationServiceClient(); - async function searchAllAssignments() { + async function callSearchAllAssignments() { // Construct request const request = { parent, @@ -62,7 +62,7 @@ function main(parent) { } } - searchAllAssignments(); + callSearchAllAssignments(); // [END bigqueryreservation_v1_generated_ReservationService_SearchAllAssignments_async] } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js index 6353e6be98a..a0ef03c6186 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js @@ -49,7 +49,7 @@ function main(parent) { // Instantiates a client const reservationClient = new ReservationServiceClient(); - async function searchAssignments() { + async function callSearchAssignments() { // Construct request const request = { parent, @@ -62,7 +62,7 @@ function main(parent) { } } - searchAssignments(); + callSearchAssignments(); // [END bigqueryreservation_v1_generated_ReservationService_SearchAssignments_async] } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js index 8526addd8f4..13116ef25aa 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js @@ -36,7 +36,7 @@ function main(name) { // Instantiates a client const reservationClient = new ReservationServiceClient(); - async function splitCapacityCommitment() { + async function callSplitCapacityCommitment() { // Construct request const request = { name, @@ -47,7 +47,7 @@ function main(name) { console.log(response); } - splitCapacityCommitment(); + callSplitCapacityCommitment(); // [END bigqueryreservation_v1_generated_ReservationService_SplitCapacityCommitment_async] } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js index d22943ad5c1..4f9c3820e49 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js @@ -22,11 +22,11 @@ function main() { /** * A reservation to update. */ - // const biReservation = '' + // const biReservation = {} /** * A list of fields to be updated in this request. */ - // const updateMask = '' + // const updateMask = {} // Imports the Reservation library const {ReservationServiceClient} = @@ -35,7 +35,7 @@ function main() { // Instantiates a client const reservationClient = new ReservationServiceClient(); - async function updateBiReservation() { + async function callUpdateBiReservation() { // Construct request const request = {}; @@ -44,7 +44,7 @@ function main() { console.log(response); } - updateBiReservation(); + callUpdateBiReservation(); // [END bigqueryreservation_v1_generated_ReservationService_UpdateBiReservation_async] } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js index 00fd5b391dc..25f357bc949 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js @@ -22,11 +22,11 @@ function main() { /** * Content of the capacity commitment to update. */ - // const capacityCommitment = '' + // const capacityCommitment = {} /** * Standard field mask for the set of fields to be updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Reservation library const {ReservationServiceClient} = @@ -35,7 +35,7 @@ function main() { // Instantiates a client const reservationClient = new ReservationServiceClient(); - async function updateCapacityCommitment() { + async function callUpdateCapacityCommitment() { // Construct request const request = {}; @@ -44,7 +44,7 @@ function main() { console.log(response); } - updateCapacityCommitment(); + callUpdateCapacityCommitment(); // [END bigqueryreservation_v1_generated_ReservationService_UpdateCapacityCommitment_async] } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js index 9847adecd50..851bcc013bf 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js @@ -22,11 +22,11 @@ function main() { /** * Content of the reservation to update. */ - // const reservation = '' + // const reservation = {} /** * Standard field mask for the set of fields to be updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Reservation library const {ReservationServiceClient} = @@ -35,7 +35,7 @@ function main() { // Instantiates a client const reservationClient = new ReservationServiceClient(); - async function updateReservation() { + async function callUpdateReservation() { // Construct request const request = {}; @@ -44,7 +44,7 @@ function main() { console.log(response); } - updateReservation(); + callUpdateReservation(); // [END bigqueryreservation_v1_generated_ReservationService_UpdateReservation_async] } diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index 14cde1e22ce..d6c04b05f6c 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts @@ -385,6 +385,29 @@ export class ReservationServiceClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Creates a new reservation resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Project, location. E.g., + * `projects/myproject/locations/US` + * @param {string} request.reservationId + * The reservation ID. This field must only contain lower case alphanumeric + * characters or dash. Max length is 64 characters. + * @param {google.cloud.bigquery.reservation.v1.Reservation} request.reservation + * Definition of the new reservation to create. + * @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 [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation}. + * 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/reservation_service.create_reservation.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_CreateReservation_async + */ createReservation( request?: protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest, options?: CallOptions @@ -419,29 +442,6 @@ export class ReservationServiceClient { {} | null | undefined > ): void; - /** - * Creates a new reservation resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Project, location. E.g., - * `projects/myproject/locations/US` - * @param {string} request.reservationId - * The reservation ID. This field must only contain lower case alphanumeric - * characters or dash. Max length is 64 characters. - * @param {google.cloud.bigquery.reservation.v1.Reservation} request.reservation - * Definition of the new reservation to create. - * @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 [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation}. - * 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.createReservation(request); - */ createReservation( request?: protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest, optionsOrCallback?: @@ -488,6 +488,24 @@ export class ReservationServiceClient { this.initialize(); return this.innerApiCalls.createReservation(request, options, callback); } + /** + * Returns information about the reservation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the reservation to retrieve. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + * @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 [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation}. + * 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/reservation_service.get_reservation.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_GetReservation_async + */ getReservation( request?: protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest, options?: CallOptions @@ -522,24 +540,6 @@ export class ReservationServiceClient { {} | null | undefined > ): void; - /** - * Returns information about the reservation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the reservation to retrieve. E.g., - * `projects/myproject/locations/US/reservations/team1-prod` - * @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 [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation}. - * 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.getReservation(request); - */ getReservation( request?: protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest, optionsOrCallback?: @@ -586,6 +586,26 @@ export class ReservationServiceClient { this.initialize(); return this.innerApiCalls.getReservation(request, options, callback); } + /** + * Deletes a reservation. + * Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has + * assignments. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the reservation to retrieve. E.g., + * `projects/myproject/locations/US/reservations/team1-prod` + * @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/reservation_service.delete_reservation.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_DeleteReservation_async + */ deleteReservation( request?: protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, options?: CallOptions @@ -620,26 +640,6 @@ export class ReservationServiceClient { {} | null | undefined > ): void; - /** - * Deletes a reservation. - * Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has - * assignments. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the reservation to retrieve. E.g., - * `projects/myproject/locations/US/reservations/team1-prod` - * @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.deleteReservation(request); - */ deleteReservation( request?: protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, optionsOrCallback?: @@ -686,6 +686,25 @@ export class ReservationServiceClient { this.initialize(); return this.innerApiCalls.deleteReservation(request, options, callback); } + /** + * Updates an existing reservation resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.bigquery.reservation.v1.Reservation} request.reservation + * Content of the reservation to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Standard field mask for the set of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation}. + * 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/reservation_service.update_reservation.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_UpdateReservation_async + */ updateReservation( request?: protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, options?: CallOptions @@ -720,25 +739,6 @@ export class ReservationServiceClient { {} | null | undefined > ): void; - /** - * Updates an existing reservation resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.bigquery.reservation.v1.Reservation} request.reservation - * Content of the reservation to update. - * @param {google.protobuf.FieldMask} request.updateMask - * Standard field mask for the set of fields to be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Reservation]{@link google.cloud.bigquery.reservation.v1.Reservation}. - * 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.updateReservation(request); - */ updateReservation( request?: protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, optionsOrCallback?: @@ -785,6 +785,35 @@ export class ReservationServiceClient { this.initialize(); return this.innerApiCalls.updateReservation(request, options, callback); } + /** + * Creates a new capacity commitment resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + * @param {google.cloud.bigquery.reservation.v1.CapacityCommitment} request.capacityCommitment + * Content of the capacity commitment to create. + * @param {boolean} request.enforceSingleAdminProjectPerOrg + * If true, fail the request if another project in the organization has a + * capacity commitment. + * @param {string} request.capacityCommitmentId + * The optional capacity commitment ID. Capacity commitment name will be + * generated automatically if this field is empty. + * This field must only contain lower case alphanumeric characters or dash. + * Max length is 64 characters. + * NOTE: this ID won't be kept if the capacity commitment is split or merged. + * @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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. + * 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/reservation_service.create_capacity_commitment.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_CreateCapacityCommitment_async + */ createCapacityCommitment( request?: protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, options?: CallOptions @@ -819,35 +848,6 @@ export class ReservationServiceClient { {} | null | undefined > ): void; - /** - * Creates a new capacity commitment resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the parent reservation. E.g., - * `projects/myproject/locations/US` - * @param {google.cloud.bigquery.reservation.v1.CapacityCommitment} request.capacityCommitment - * Content of the capacity commitment to create. - * @param {boolean} request.enforceSingleAdminProjectPerOrg - * If true, fail the request if another project in the organization has a - * capacity commitment. - * @param {string} request.capacityCommitmentId - * The optional capacity commitment ID. Capacity commitment name will be - * generated automatically if this field is empty. - * This field must only contain lower case alphanumeric characters or dash. - * Max length is 64 characters. - * NOTE: this ID won't be kept if the capacity commitment is split or merged. - * @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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. - * 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.createCapacityCommitment(request); - */ createCapacityCommitment( request?: protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, optionsOrCallback?: @@ -898,6 +898,24 @@ export class ReservationServiceClient { callback ); } + /** + * Returns information about the capacity commitment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the capacity commitment to retrieve. E.g., + * `projects/myproject/locations/US/capacityCommitments/123` + * @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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. + * 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/reservation_service.get_capacity_commitment.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_GetCapacityCommitment_async + */ getCapacityCommitment( request?: protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, options?: CallOptions @@ -932,24 +950,6 @@ export class ReservationServiceClient { {} | null | undefined > ): void; - /** - * Returns information about the capacity commitment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the capacity commitment to retrieve. E.g., - * `projects/myproject/locations/US/capacityCommitments/123` - * @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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. - * 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.getCapacityCommitment(request); - */ getCapacityCommitment( request?: protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, optionsOrCallback?: @@ -996,6 +996,30 @@ export class ReservationServiceClient { this.initialize(); return this.innerApiCalls.getCapacityCommitment(request, options, callback); } + /** + * Deletes a capacity commitment. Attempting to delete capacity commitment + * before its commitment_end_time will fail with the error code + * `google.rpc.Code.FAILED_PRECONDITION`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the capacity commitment to delete. E.g., + * `projects/myproject/locations/US/capacityCommitments/123` + * @param {boolean} request.force + * Can be used to force delete commitments even if assignments exist. Deleting + * commitments with assignments may cause queries to fail if they no longer + * have access to slots. + * @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/reservation_service.delete_capacity_commitment.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_DeleteCapacityCommitment_async + */ deleteCapacityCommitment( request?: protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, options?: CallOptions @@ -1030,30 +1054,6 @@ export class ReservationServiceClient { {} | null | undefined > ): void; - /** - * Deletes a capacity commitment. Attempting to delete capacity commitment - * before its commitment_end_time will fail with the error code - * `google.rpc.Code.FAILED_PRECONDITION`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource name of the capacity commitment to delete. E.g., - * `projects/myproject/locations/US/capacityCommitments/123` - * @param {boolean} request.force - * Can be used to force delete commitments even if assignments exist. Deleting - * commitments with assignments may cause queries to fail if they no longer - * have access to slots. - * @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.deleteCapacityCommitment(request); - */ deleteCapacityCommitment( request?: protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, optionsOrCallback?: @@ -1104,6 +1104,31 @@ export class ReservationServiceClient { callback ); } + /** + * Updates an existing capacity commitment. + * + * Only `plan` and `renewal_plan` fields can be updated. + * + * Plan can only be changed to a plan of a longer commitment period. + * Attempting to change to a plan with shorter commitment period will fail + * with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.bigquery.reservation.v1.CapacityCommitment} request.capacityCommitment + * Content of the capacity commitment to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Standard field mask for the set of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. + * 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/reservation_service.update_capacity_commitment.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_UpdateCapacityCommitment_async + */ updateCapacityCommitment( request?: protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, options?: CallOptions @@ -1138,31 +1163,6 @@ export class ReservationServiceClient { {} | null | undefined > ): void; - /** - * Updates an existing capacity commitment. - * - * Only `plan` and `renewal_plan` fields can be updated. - * - * Plan can only be changed to a plan of a longer commitment period. - * Attempting to change to a plan with shorter commitment period will fail - * with the error code `google.rpc.Code.FAILED_PRECONDITION`. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.bigquery.reservation.v1.CapacityCommitment} request.capacityCommitment - * Content of the capacity commitment to update. - * @param {google.protobuf.FieldMask} request.updateMask - * Standard field mask for the set of fields to be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. - * 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.updateCapacityCommitment(request); - */ updateCapacityCommitment( request?: protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, optionsOrCallback?: @@ -1213,6 +1213,33 @@ export class ReservationServiceClient { callback ); } + /** + * Splits capacity commitment to two commitments of the same plan and + * `commitment_end_time`. + * + * A common use case is to enable downgrading commitments. + * + * For example, in order to downgrade from 10000 slots to 8000, you might + * split a 10000 capacity commitment into commitments of 2000 and 8000. Then, + * you would change the plan of the first one to `FLEX` and then delete it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name e.g.,: + * `projects/myproject/locations/US/capacityCommitments/123` + * @param {number} request.slotCount + * Number of slots in the capacity commitment after the split. + * @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 [SplitCapacityCommitmentResponse]{@link google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse}. + * 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/reservation_service.split_capacity_commitment.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_SplitCapacityCommitment_async + */ splitCapacityCommitment( request?: protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, options?: CallOptions @@ -1247,33 +1274,6 @@ export class ReservationServiceClient { {} | null | undefined > ): void; - /** - * Splits capacity commitment to two commitments of the same plan and - * `commitment_end_time`. - * - * A common use case is to enable downgrading commitments. - * - * For example, in order to downgrade from 10000 slots to 8000, you might - * split a 10000 capacity commitment into commitments of 2000 and 8000. Then, - * you would change the plan of the first one to `FLEX` and then delete it. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name e.g.,: - * `projects/myproject/locations/US/capacityCommitments/123` - * @param {number} request.slotCount - * Number of slots in the capacity commitment after the split. - * @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 [SplitCapacityCommitmentResponse]{@link google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse}. - * 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.splitCapacityCommitment(request); - */ splitCapacityCommitment( request?: protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, optionsOrCallback?: @@ -1324,6 +1324,36 @@ export class ReservationServiceClient { callback ); } + /** + * Merges capacity commitments of the same plan into a single commitment. + * + * The resulting capacity commitment has the greater commitment_end_time + * out of the to-be-merged capacity commitments. + * + * Attempting to merge capacity commitments of different plan will fail + * with the error code `google.rpc.Code.FAILED_PRECONDITION`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Parent resource that identifies admin project and location e.g., + * `projects/myproject/locations/us` + * @param {string[]} request.capacityCommitmentIds + * Ids of capacity commitments to merge. + * These capacity commitments must exist under admin project and location + * specified in the parent. + * ID is the last portion of capacity commitment name e.g., 'abc' for + * projects/myproject/locations/US/capacityCommitments/abc + * @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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. + * 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/reservation_service.merge_capacity_commitments.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_MergeCapacityCommitments_async + */ mergeCapacityCommitments( request?: protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, options?: CallOptions @@ -1358,36 +1388,6 @@ export class ReservationServiceClient { {} | null | undefined > ): void; - /** - * Merges capacity commitments of the same plan into a single commitment. - * - * The resulting capacity commitment has the greater commitment_end_time - * out of the to-be-merged capacity commitments. - * - * Attempting to merge capacity commitments of different plan will fail - * with the error code `google.rpc.Code.FAILED_PRECONDITION`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Parent resource that identifies admin project and location e.g., - * `projects/myproject/locations/us` - * @param {string[]} request.capacityCommitmentIds - * Ids of capacity commitments to merge. - * These capacity commitments must exist under admin project and location - * specified in the parent. - * ID is the last portion of capacity commitment name e.g., 'abc' for - * projects/myproject/locations/US/capacityCommitments/abc - * @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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. - * 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.mergeCapacityCommitments(request); - */ mergeCapacityCommitments( request?: protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, optionsOrCallback?: @@ -1438,40 +1438,6 @@ export class ReservationServiceClient { callback ); } - createAssignment( - request?: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.bigquery.reservation.v1.IAssignment, - ( - | protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest - | undefined - ), - {} | undefined - ] - >; - createAssignment( - request: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.bigquery.reservation.v1.IAssignment, - | protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest - | null - | undefined, - {} | null | undefined - > - ): void; - createAssignment( - request: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, - callback: Callback< - protos.google.cloud.bigquery.reservation.v1.IAssignment, - | protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Creates an assignment object which allows the given project to submit jobs * of a certain type using slots from the specified reservation. @@ -1528,9 +1494,43 @@ export class ReservationServiceClient { * 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.createAssignment(request); + * @example include:samples/generated/v1/reservation_service.create_assignment.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_CreateAssignment_async */ + createAssignment( + request?: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment, + ( + | protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest + | undefined + ), + {} | undefined + ] + >; + createAssignment( + request: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createAssignment( + request: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; createAssignment( request?: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, optionsOrCallback?: @@ -1577,6 +1577,38 @@ export class ReservationServiceClient { this.initialize(); return this.innerApiCalls.createAssignment(request, options, callback); } + /** + * Deletes a assignment. No expansion will happen. + * + * Example: + * + * * Organization `organizationA` contains two projects, `project1` and + * `project2`. + * * Reservation `res1` exists and was created previously. + * * CreateAssignment was used previously to define the following + * associations between entities and reservations: `` + * and `` + * + * In this example, deletion of the `` assignment won't + * affect the other assignment ``. After said deletion, + * queries from `project1` will still use `res1` while queries from + * `project2` will switch to use on-demand mode. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource, e.g. + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + * @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/reservation_service.delete_assignment.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_DeleteAssignment_async + */ deleteAssignment( request?: protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, options?: CallOptions @@ -1611,38 +1643,6 @@ export class ReservationServiceClient { {} | null | undefined > ): void; - /** - * Deletes a assignment. No expansion will happen. - * - * Example: - * - * * Organization `organizationA` contains two projects, `project1` and - * `project2`. - * * Reservation `res1` exists and was created previously. - * * CreateAssignment was used previously to define the following - * associations between entities and reservations: `` - * and `` - * - * In this example, deletion of the `` assignment won't - * affect the other assignment ``. After said deletion, - * queries from `project1` will still use `res1` while queries from - * `project2` will switch to use on-demand mode. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the resource, e.g. - * `projects/myproject/locations/US/reservations/team1-prod/assignments/123` - * @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.deleteAssignment(request); - */ deleteAssignment( request?: protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, optionsOrCallback?: @@ -1689,6 +1689,32 @@ export class ReservationServiceClient { this.initialize(); return this.innerApiCalls.deleteAssignment(request, options, callback); } + /** + * Moves an assignment under a new reservation. + * + * This differs from removing an existing assignment and recreating a new one + * by providing a transactional change that ensures an assignee always has an + * associated reservation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the assignment, + * e.g. + * `projects/myproject/locations/US/reservations/team1-prod/assignments/123` + * @param {string} request.destinationId + * The new reservation ID, e.g.: + * `projects/myotherproject/locations/US/reservations/team2-prod` + * @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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. + * 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/reservation_service.move_assignment.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_MoveAssignment_async + */ moveAssignment( request?: protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, options?: CallOptions @@ -1723,32 +1749,6 @@ export class ReservationServiceClient { {} | null | undefined > ): void; - /** - * Moves an assignment under a new reservation. - * - * This differs from removing an existing assignment and recreating a new one - * by providing a transactional change that ensures an assignee always has an - * associated reservation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the assignment, - * e.g. - * `projects/myproject/locations/US/reservations/team1-prod/assignments/123` - * @param {string} request.destinationId - * The new reservation ID, e.g.: - * `projects/myotherproject/locations/US/reservations/team2-prod` - * @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 [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. - * 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.moveAssignment(request); - */ moveAssignment( request?: protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, optionsOrCallback?: @@ -1795,6 +1795,24 @@ export class ReservationServiceClient { this.initialize(); return this.innerApiCalls.moveAssignment(request, options, callback); } + /** + * Retrieves a BI reservation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the requested reservation, for example: + * `projects/{project_id}/locations/{location_id}/biReservation` + * @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 [BiReservation]{@link google.cloud.bigquery.reservation.v1.BiReservation}. + * 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/reservation_service.get_bi_reservation.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_GetBiReservation_async + */ getBiReservation( request?: protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, options?: CallOptions @@ -1829,24 +1847,6 @@ export class ReservationServiceClient { {} | null | undefined > ): void; - /** - * Retrieves a BI reservation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the requested reservation, for example: - * `projects/{project_id}/locations/{location_id}/biReservation` - * @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 [BiReservation]{@link google.cloud.bigquery.reservation.v1.BiReservation}. - * 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.getBiReservation(request); - */ getBiReservation( request?: protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, optionsOrCallback?: @@ -1893,6 +1893,32 @@ export class ReservationServiceClient { this.initialize(); return this.innerApiCalls.getBiReservation(request, options, callback); } + /** + * Updates a BI reservation. + * + * Only fields specified in the `field_mask` are updated. + * + * A singleton BI reservation always exists with default size 0. + * In order to reserve BI capacity it needs to be updated to an amount + * greater than 0. In order to release BI capacity reservation size + * must be set to 0. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.bigquery.reservation.v1.BiReservation} request.biReservation + * A reservation to update. + * @param {google.protobuf.FieldMask} request.updateMask + * A list of fields to be updated in this request. + * @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 [BiReservation]{@link google.cloud.bigquery.reservation.v1.BiReservation}. + * 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/reservation_service.update_bi_reservation.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_UpdateBiReservation_async + */ updateBiReservation( request?: protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, options?: CallOptions @@ -1927,32 +1953,6 @@ export class ReservationServiceClient { {} | null | undefined > ): void; - /** - * Updates a BI reservation. - * - * Only fields specified in the `field_mask` are updated. - * - * A singleton BI reservation always exists with default size 0. - * In order to reserve BI capacity it needs to be updated to an amount - * greater than 0. In order to release BI capacity reservation size - * must be set to 0. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.bigquery.reservation.v1.BiReservation} request.biReservation - * A reservation to update. - * @param {google.protobuf.FieldMask} request.updateMask - * A list of fields to be updated in this request. - * @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 [BiReservation]{@link google.cloud.bigquery.reservation.v1.BiReservation}. - * 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.updateBiReservation(request); - */ updateBiReservation( request?: protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, optionsOrCallback?: @@ -2000,37 +2000,6 @@ export class ReservationServiceClient { return this.innerApiCalls.updateBiReservation(request, options, callback); } - listReservations( - request?: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.bigquery.reservation.v1.IReservation[], - protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest | null, - protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse - ] - >; - listReservations( - request: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, - | protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse - | null - | undefined, - protos.google.cloud.bigquery.reservation.v1.IReservation - > - ): void; - listReservations( - request: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, - callback: PaginationCallback< - protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, - | protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse - | null - | undefined, - protos.google.cloud.bigquery.reservation.v1.IReservation - > - ): void; /** * Lists all the reservations for the project in the specified location. * @@ -2056,6 +2025,37 @@ export class ReservationServiceClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listReservations( + request?: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IReservation[], + protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest | null, + protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse + ] + >; + listReservations( + request: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IReservation + > + ): void; + listReservations( + request: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IReservation + > + ): void; listReservations( request?: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, optionsOrCallback?: @@ -2168,11 +2168,8 @@ export class ReservationServiceClient { * 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.listReservationsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/reservation_service.list_reservations.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_ListReservations_async */ listReservationsAsync( request?: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, @@ -2186,7 +2183,6 @@ export class ReservationServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listReservations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -2196,6 +2192,31 @@ export class ReservationServiceClient { callSettings ) as AsyncIterable; } + /** + * Lists all the capacity commitments for the admin project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource name of the parent reservation. E.g., + * `projects/myproject/locations/US` + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. + * 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 `listCapacityCommitmentsAsync()` + * 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. + */ listCapacityCommitments( request?: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, options?: CallOptions @@ -2227,31 +2248,6 @@ export class ReservationServiceClient { protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment > ): void; - /** - * Lists all the capacity commitments for the admin project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource name of the parent reservation. E.g., - * `projects/myproject/locations/US` - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @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 [CapacityCommitment]{@link google.cloud.bigquery.reservation.v1.CapacityCommitment}. - * 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 `listCapacityCommitmentsAsync()` - * 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. - */ listCapacityCommitments( request?: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, optionsOrCallback?: @@ -2368,11 +2364,8 @@ export class ReservationServiceClient { * 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.listCapacityCommitmentsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/reservation_service.list_capacity_commitments.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_ListCapacityCommitments_async */ listCapacityCommitmentsAsync( request?: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, @@ -2386,7 +2379,6 @@ export class ReservationServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listCapacityCommitments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -2396,37 +2388,6 @@ export class ReservationServiceClient { callSettings ) as AsyncIterable; } - listAssignments( - request?: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.bigquery.reservation.v1.IAssignment[], - protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest | null, - protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse - ] - >; - listAssignments( - request: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, - | protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse - | null - | undefined, - protos.google.cloud.bigquery.reservation.v1.IAssignment - > - ): void; - listAssignments( - request: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, - callback: PaginationCallback< - protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, - | protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse - | null - | undefined, - protos.google.cloud.bigquery.reservation.v1.IAssignment - > - ): void; /** * Lists assignments. * @@ -2477,6 +2438,37 @@ export class ReservationServiceClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listAssignments( + request?: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment[], + protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest | null, + protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse + ] + >; + listAssignments( + request: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): void; + listAssignments( + request: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): void; listAssignments( request?: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, optionsOrCallback?: @@ -2599,11 +2591,8 @@ export class ReservationServiceClient { * 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.listAssignmentsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/reservation_service.list_assignments.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_ListAssignments_async */ listAssignmentsAsync( request?: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, @@ -2617,7 +2606,6 @@ export class ReservationServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listAssignments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -2627,37 +2615,6 @@ export class ReservationServiceClient { callSettings ) as AsyncIterable; } - searchAssignments( - request?: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.bigquery.reservation.v1.IAssignment[], - protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest | null, - protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse - ] - >; - searchAssignments( - request: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, - | protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse - | null - | undefined, - protos.google.cloud.bigquery.reservation.v1.IAssignment - > - ): void; - searchAssignments( - request: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, - callback: PaginationCallback< - protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, - | protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse - | null - | undefined, - protos.google.cloud.bigquery.reservation.v1.IAssignment - > - ): void; /** * Deprecated: Looks up assignments for a specified resource for a particular region. * If the request is about a project: @@ -2715,6 +2672,37 @@ export class ReservationServiceClient { * for more details and examples. * @deprecated SearchAssignments is deprecated and may be removed in a future version. */ + searchAssignments( + request?: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment[], + protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest | null, + protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse + ] + >; + searchAssignments( + request: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): void; + searchAssignments( + request: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): void; searchAssignments( request?: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, optionsOrCallback?: @@ -2856,11 +2844,8 @@ export class ReservationServiceClient { * 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.searchAssignmentsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/reservation_service.search_assignments.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_SearchAssignments_async * @deprecated SearchAssignments is deprecated and may be removed in a future version. */ searchAssignmentsAsync( @@ -2875,7 +2860,6 @@ export class ReservationServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['searchAssignments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -2890,37 +2874,6 @@ export class ReservationServiceClient { callSettings ) as AsyncIterable; } - searchAllAssignments( - request?: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.bigquery.reservation.v1.IAssignment[], - protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest | null, - protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse - ] - >; - searchAllAssignments( - request: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, - | protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse - | null - | undefined, - protos.google.cloud.bigquery.reservation.v1.IAssignment - > - ): void; - searchAllAssignments( - request: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, - callback: PaginationCallback< - protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, - | protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse - | null - | undefined, - protos.google.cloud.bigquery.reservation.v1.IAssignment - > - ): void; /** * Looks up assignments for a specified resource for a particular region. * If the request is about a project: @@ -2974,6 +2927,37 @@ export class ReservationServiceClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + searchAllAssignments( + request?: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment[], + protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest | null, + protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse + ] + >; + searchAllAssignments( + request: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): void; + searchAllAssignments( + request: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + callback: PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + ): void; searchAllAssignments( request?: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, optionsOrCallback?: @@ -3104,11 +3088,8 @@ export class ReservationServiceClient { * 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.searchAllAssignmentsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/reservation_service.search_all_assignments.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_SearchAllAssignments_async */ searchAllAssignmentsAsync( request?: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, @@ -3122,7 +3103,6 @@ export class ReservationServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['searchAllAssignments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); From b2922e0eec7d1cec89d95b351ca9b593bf14a739 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 10 Dec 2021 21:14:21 +0000 Subject: [PATCH 068/105] build: add generated samples to .eslintignore (#118) --- packages/google-cloud-bigquery-reservation/.eslintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-bigquery-reservation/.eslintignore b/packages/google-cloud-bigquery-reservation/.eslintignore index 9340ad9b86d..ea5b04aebe6 100644 --- a/packages/google-cloud-bigquery-reservation/.eslintignore +++ b/packages/google-cloud-bigquery-reservation/.eslintignore @@ -4,3 +4,4 @@ test/fixtures build/ docs/ protos/ +samples/generated/ From 5723ef30a49b66cdd9559c5bab61e0a0a0af0ff4 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 29 Dec 2021 21:38:25 +0000 Subject: [PATCH 069/105] docs(node): support "stable"/"preview" release level (#1312) (#122) --- packages/google-cloud-bigquery-reservation/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-bigquery-reservation/README.md b/packages/google-cloud-bigquery-reservation/README.md index b3fd360197c..62573bc86dc 100644 --- a/packages/google-cloud-bigquery-reservation/README.md +++ b/packages/google-cloud-bigquery-reservation/README.md @@ -143,6 +143,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 f890b8077fd8ffc924d70a1a46d4c835fb2b6c2e 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 20:38:54 +0000 Subject: [PATCH 070/105] feat: increase the logical timeout (retry deadline) to 5 minutes (#120) PiperOrigin-RevId: 417448084 Source-Link: https://github.com/googleapis/googleapis/commit/489719aa33e8548612cd2ab1018b42d926afa409 Source-Link: https://github.com/googleapis/googleapis-gen/commit/97a80b4fa8a979b86c5e83d7ed8bb8d2d3eb6c40 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTdhODBiNGZhOGE5NzliODZjNWU4M2Q3ZWQ4YmI4ZDJkM2ViNmM0MCJ9 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 --- .../reservation_service.create_assignment.js | 4 ++-- ...tion_service.create_capacity_commitment.js | 4 ++-- .../reservation_service.create_reservation.js | 4 ++-- .../reservation_service.delete_assignment.js | 4 ++-- ...tion_service.delete_capacity_commitment.js | 4 ++-- .../reservation_service.delete_reservation.js | 4 ++-- .../reservation_service.get_bi_reservation.js | 4 ++-- ...rvation_service.get_capacity_commitment.js | 4 ++-- .../v1/reservation_service.get_reservation.js | 4 ++-- .../reservation_service.list_assignments.js | 6 +++--- ...ation_service.list_capacity_commitments.js | 10 ++++------ .../reservation_service.list_reservations.js | 6 +++--- ...tion_service.merge_capacity_commitments.js | 7 ++++--- .../v1/reservation_service.move_assignment.js | 4 ++-- ...ervation_service.search_all_assignments.js | 6 +++--- .../reservation_service.search_assignments.js | 6 +++--- ...ation_service.split_capacity_commitment.js | 4 ++-- ...servation_service.update_bi_reservation.js | 7 ++++--- ...tion_service.update_capacity_commitment.js | 7 ++++--- .../reservation_service.update_reservation.js | 7 ++++--- .../v1/reservation_service_client_config.json | 20 +++++++++---------- 21 files changed, 64 insertions(+), 62 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js index 2526fac4dae..cb9789ce31c 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -37,8 +38,7 @@ function main(parent) { // const assignmentId = 'abc123' // Imports the Reservation library - const {ReservationServiceClient} = - require('@google-cloud/bigquery-reservation').v1; + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; // Instantiates a client const reservationClient = new ReservationServiceClient(); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js index 0b1989ace3c..61e519f219e 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -43,8 +44,7 @@ function main(parent) { // const capacityCommitmentId = 'abc123' // Imports the Reservation library - const {ReservationServiceClient} = - require('@google-cloud/bigquery-reservation').v1; + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; // Instantiates a client const reservationClient = new ReservationServiceClient(); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js index 3db716a0867..6ae5ca53ac8 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -35,8 +36,7 @@ function main(parent) { // const reservation = {} // Imports the Reservation library - const {ReservationServiceClient} = - require('@google-cloud/bigquery-reservation').v1; + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; // Instantiates a client const reservationClient = new ReservationServiceClient(); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js index 342c2f489b5..f4086563146 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Reservation library - const {ReservationServiceClient} = - require('@google-cloud/bigquery-reservation').v1; + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; // Instantiates a client const reservationClient = new ReservationServiceClient(); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js index 64b988e2cd5..4dedd2559f9 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -32,8 +33,7 @@ function main(name) { // const force = true // Imports the Reservation library - const {ReservationServiceClient} = - require('@google-cloud/bigquery-reservation').v1; + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; // Instantiates a client const reservationClient = new ReservationServiceClient(); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js index f8a5c246a6b..16d70c9e7b4 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Reservation library - const {ReservationServiceClient} = - require('@google-cloud/bigquery-reservation').v1; + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; // Instantiates a client const reservationClient = new ReservationServiceClient(); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js index cb9be2f398c..2be851c5797 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Reservation library - const {ReservationServiceClient} = - require('@google-cloud/bigquery-reservation').v1; + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; // Instantiates a client const reservationClient = new ReservationServiceClient(); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js index 8600856255f..165d585b76a 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Reservation library - const {ReservationServiceClient} = - require('@google-cloud/bigquery-reservation').v1; + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; // Instantiates a client const reservationClient = new ReservationServiceClient(); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js index 61d27330c5e..a987bad85fe 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Reservation library - const {ReservationServiceClient} = - require('@google-cloud/bigquery-reservation').v1; + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; // Instantiates a client const reservationClient = new ReservationServiceClient(); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js index 1d1bc835124..886e2d9863a 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -36,8 +37,7 @@ function main(parent) { // const pageToken = 'abc123' // Imports the Reservation library - const {ReservationServiceClient} = - require('@google-cloud/bigquery-reservation').v1; + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; // Instantiates a client const reservationClient = new ReservationServiceClient(); @@ -51,7 +51,7 @@ function main(parent) { // Run request const iterable = await reservationClient.listAssignmentsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js index 62277721f62..a188c5f8877 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -34,8 +35,7 @@ function main(parent) { // const pageToken = 'abc123' // Imports the Reservation library - const {ReservationServiceClient} = - require('@google-cloud/bigquery-reservation').v1; + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; // Instantiates a client const reservationClient = new ReservationServiceClient(); @@ -47,11 +47,9 @@ function main(parent) { }; // Run request - const iterable = await reservationClient.listCapacityCommitmentsAsync( - request - ); + const iterable = await reservationClient.listCapacityCommitmentsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js index e1517b2df85..3293861ff5e 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -34,8 +35,7 @@ function main(parent) { // const pageToken = 'abc123' // Imports the Reservation library - const {ReservationServiceClient} = - require('@google-cloud/bigquery-reservation').v1; + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; // Instantiates a client const reservationClient = new ReservationServiceClient(); @@ -49,7 +49,7 @@ function main(parent) { // Run request const iterable = await reservationClient.listReservationsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js index e10eb8895f6..fdfbdf89a1c 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main() { @@ -34,15 +35,15 @@ function main() { // const capacityCommitmentIds = 'abc123' // Imports the Reservation library - const {ReservationServiceClient} = - require('@google-cloud/bigquery-reservation').v1; + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; // Instantiates a client const reservationClient = new ReservationServiceClient(); async function callMergeCapacityCommitments() { // Construct request - const request = {}; + const request = { + }; // Run request const response = await reservationClient.mergeCapacityCommitments(request); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js index d6b0b5bcc64..c7a1523c980 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -32,8 +33,7 @@ function main(name) { // const destinationId = 'abc123' // Imports the Reservation library - const {ReservationServiceClient} = - require('@google-cloud/bigquery-reservation').v1; + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; // Instantiates a client const reservationClient = new ReservationServiceClient(); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js index ae5d20bdc8e..f820c39bbbb 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -43,8 +44,7 @@ function main(parent) { // const pageToken = 'abc123' // Imports the Reservation library - const {ReservationServiceClient} = - require('@google-cloud/bigquery-reservation').v1; + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; // Instantiates a client const reservationClient = new ReservationServiceClient(); @@ -58,7 +58,7 @@ function main(parent) { // Run request const iterable = await reservationClient.searchAllAssignmentsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js index a0ef03c6186..57f0a052812 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -43,8 +44,7 @@ function main(parent) { // const pageToken = 'abc123' // Imports the Reservation library - const {ReservationServiceClient} = - require('@google-cloud/bigquery-reservation').v1; + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; // Instantiates a client const reservationClient = new ReservationServiceClient(); @@ -58,7 +58,7 @@ function main(parent) { // Run request const iterable = await reservationClient.searchAssignmentsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js index 13116ef25aa..b08b490be78 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -30,8 +31,7 @@ function main(name) { // const slotCount = 1234 // Imports the Reservation library - const {ReservationServiceClient} = - require('@google-cloud/bigquery-reservation').v1; + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; // Instantiates a client const reservationClient = new ReservationServiceClient(); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js index 4f9c3820e49..2dd75bf8fa3 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main() { @@ -29,15 +30,15 @@ function main() { // const updateMask = {} // Imports the Reservation library - const {ReservationServiceClient} = - require('@google-cloud/bigquery-reservation').v1; + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; // Instantiates a client const reservationClient = new ReservationServiceClient(); async function callUpdateBiReservation() { // Construct request - const request = {}; + const request = { + }; // Run request const response = await reservationClient.updateBiReservation(request); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js index 25f357bc949..868f9f3492d 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main() { @@ -29,15 +30,15 @@ function main() { // const updateMask = {} // Imports the Reservation library - const {ReservationServiceClient} = - require('@google-cloud/bigquery-reservation').v1; + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; // Instantiates a client const reservationClient = new ReservationServiceClient(); async function callUpdateCapacityCommitment() { // Construct request - const request = {}; + const request = { + }; // Run request const response = await reservationClient.updateCapacityCommitment(request); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js index 851bcc013bf..eca930ba859 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main() { @@ -29,15 +30,15 @@ function main() { // const updateMask = {} // Imports the Reservation library - const {ReservationServiceClient} = - require('@google-cloud/bigquery-reservation').v1; + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; // Instantiates a client const reservationClient = new ReservationServiceClient(); async function callUpdateReservation() { // Construct request - const request = {}; + const request = { + }; // Run request const response = await reservationClient.updateReservation(request); diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client_config.json b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client_config.json index 70059e6ed7a..760e758b8e3 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client_config.json +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client_config.json @@ -26,17 +26,17 @@ "retry_params_name": "default" }, "ListReservations": { - "timeout_millis": 60000, + "timeout_millis": 300000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetReservation": { - "timeout_millis": 60000, + "timeout_millis": 300000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "DeleteReservation": { - "timeout_millis": 60000, + "timeout_millis": 300000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, @@ -51,17 +51,17 @@ "retry_params_name": "default" }, "ListCapacityCommitments": { - "timeout_millis": 60000, + "timeout_millis": 300000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "GetCapacityCommitment": { - "timeout_millis": 60000, + "timeout_millis": 300000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "DeleteCapacityCommitment": { - "timeout_millis": 60000, + "timeout_millis": 300000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, @@ -86,17 +86,17 @@ "retry_params_name": "default" }, "ListAssignments": { - "timeout_millis": 60000, + "timeout_millis": 300000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "DeleteAssignment": { - "timeout_millis": 60000, + "timeout_millis": 300000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "SearchAssignments": { - "timeout_millis": 60000, + "timeout_millis": 300000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, @@ -110,7 +110,7 @@ "retry_params_name": "default" }, "GetBiReservation": { - "timeout_millis": 60000, + "timeout_millis": 300000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, From 3a806c0a291076d3cea76b8e5d3b9b41bfca1a18 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 30 Dec 2021 20:48:11 +0000 Subject: [PATCH 071/105] chore: release 1.4.0 (#123) :robot: I have created a release \*beep\* \*boop\* --- ## [1.4.0](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.3.0...v1.4.0) (2021-12-30) ### Features * increase the logical timeout (retry deadline) to 5 minutes ([#120](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/120)) ([5510500](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/5510500551df96a89c9481d7fe30b0cc95de5918)) --- 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-bigquery-reservation/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-reservation/package.json | 2 +- .../google-cloud-bigquery-reservation/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/CHANGELOG.md b/packages/google-cloud-bigquery-reservation/CHANGELOG.md index fca76ac9659..5eace787768 100644 --- a/packages/google-cloud-bigquery-reservation/CHANGELOG.md +++ b/packages/google-cloud-bigquery-reservation/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.4.0](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.3.0...v1.4.0) (2021-12-30) + + +### Features + +* increase the logical timeout (retry deadline) to 5 minutes ([#120](https://www.github.com/googleapis/nodejs-bigquery-reservation/issues/120)) ([5510500](https://www.github.com/googleapis/nodejs-bigquery-reservation/commit/5510500551df96a89c9481d7fe30b0cc95de5918)) + ## [1.3.0](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.2.0...v1.3.0) (2021-09-01) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 0bfb5db9faf..0a9451748b0 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-reservation", - "version": "1.3.0", + "version": "1.4.0", "description": "BigQuery Reservation client for Node.js", "repository": "googleapis/nodejs-bigquery-reservation", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-reservation/samples/package.json b/packages/google-cloud-bigquery-reservation/samples/package.json index b7a9cc17e97..0d330b29ae0 100644 --- a/packages/google-cloud-bigquery-reservation/samples/package.json +++ b/packages/google-cloud-bigquery-reservation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-reservation": "^1.3.0" + "@google-cloud/bigquery-reservation": "^1.4.0" }, "devDependencies": { "c8": "^7.1.0", From 3dc11c5283ce52a882160a95d4aa7942b7f9b7f6 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 30 Dec 2021 23:18:12 +0000 Subject: [PATCH 072/105] docs(badges): tweak badge to use new preview/stable language (#1314) (#124) --- packages/google-cloud-bigquery-reservation/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/README.md b/packages/google-cloud-bigquery-reservation/README.md index 62573bc86dc..9ba7a71a314 100644 --- a/packages/google-cloud-bigquery-reservation/README.md +++ b/packages/google-cloud-bigquery-reservation/README.md @@ -6,7 +6,6 @@ [![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/bigquery-reservation.svg)](https://www.npmjs.org/package/@google-cloud/bigquery-reservation) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-bigquery-reservation/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-bigquery-reservation) From 1381e764caf96e4e2d5129e0f9dfff1328c413f3 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 30 Dec 2021 18:54:13 -0500 Subject: [PATCH 073/105] chore: add api_shortname and library_type to repo metadata (#121) Update .repo-metadata.json as required by go/library-data-integrity --- .../.repo-metadata.json | 4 +++- packages/google-cloud-bigquery-reservation/README.md | 9 ++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/.repo-metadata.json b/packages/google-cloud-bigquery-reservation/.repo-metadata.json index 0b977217fb8..aeb5655d476 100644 --- a/packages/google-cloud-bigquery-reservation/.repo-metadata.json +++ b/packages/google-cloud-bigquery-reservation/.repo-metadata.json @@ -11,5 +11,7 @@ "codeowner_team": "@googleapis/api-bigquery", "name_pretty": "Google BigQuery Reservation", "client_documentation": "https://cloud.google.com/nodejs/docs/reference/bigquery-reservation/latest", - "release_level": "ga" + "release_level": "stable", + "api_shortname": "bigqueryreservation", + "library_type": "GAPIC_AUTO" } diff --git a/packages/google-cloud-bigquery-reservation/README.md b/packages/google-cloud-bigquery-reservation/README.md index 9ba7a71a314..0ece38f2806 100644 --- a/packages/google-cloud-bigquery-reservation/README.md +++ b/packages/google-cloud-bigquery-reservation/README.md @@ -4,7 +4,7 @@ # [Google BigQuery Reservation: Node.js Client](https://github.com/googleapis/nodejs-bigquery-reservation) -[![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) +[![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/bigquery-reservation.svg)](https://www.npmjs.org/package/@google-cloud/bigquery-reservation) @@ -132,10 +132,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. @@ -143,7 +143,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 c5b0dab379980a1076da0aa80dec54cda8fc5790 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 11 Jan 2022 17:22:17 +0000 Subject: [PATCH 074/105] test(nodejs): remove 15 add 16 (#1322) (#126) --- packages/google-cloud-bigquery-reservation/protos/protos.d.ts | 2 +- packages/google-cloud-bigquery-reservation/protos/protos.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts b/packages/google-cloud-bigquery-reservation/protos/protos.d.ts index bad450ab546..c36cfa3d304 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-reservation/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-bigquery-reservation/protos/protos.js b/packages/google-cloud-bigquery-reservation/protos/protos.js index 1bf8fdff941..64e37513708 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.js +++ b/packages/google-cloud-bigquery-reservation/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 fb695a620c4c927f3f56c0ab8c6e155488189452 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 27 Jan 2022 16:32:24 +0000 Subject: [PATCH 075/105] chore: update v2.12.0 gapic-generator-typescript (#132) - [ ] 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-bigquery-reservation/.jsdoc.js | 4 ++-- .../linkinator.config.json | 10 ++++++++-- .../google-cloud-bigquery-reservation/src/v1/index.ts | 2 +- .../src/v1/reservation_service_client.ts | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- .../system-test/install.ts | 2 +- .../test/gapic_reservation_service_v1.ts | 2 +- 8 files changed, 16 insertions(+), 10 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/.jsdoc.js b/packages/google-cloud-bigquery-reservation/.jsdoc.js index 67bf2454f61..2e387bea4d0 100644 --- a/packages/google-cloud-bigquery-reservation/.jsdoc.js +++ b/packages/google-cloud-bigquery-reservation/.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/bigquery-reservation', diff --git a/packages/google-cloud-bigquery-reservation/linkinator.config.json b/packages/google-cloud-bigquery-reservation/linkinator.config.json index 0121dfa684f..befd23c8633 100644 --- a/packages/google-cloud-bigquery-reservation/linkinator.config.json +++ b/packages/google-cloud-bigquery-reservation/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 } diff --git a/packages/google-cloud-bigquery-reservation/src/v1/index.ts b/packages/google-cloud-bigquery-reservation/src/v1/index.ts index e7e4fb286b1..6bedd9fcf4a 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/index.ts +++ b/packages/google-cloud-bigquery-reservation/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-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index d6c04b05f6c..e0fb6cdaa7a 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_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-bigquery-reservation/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.js index 253921327a1..28484c72afb 100644 --- a/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-bigquery-reservation/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-bigquery-reservation/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.ts index 3d7b72431e4..cb2774d6400 100644 --- a/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-bigquery-reservation/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-bigquery-reservation/system-test/install.ts b/packages/google-cloud-bigquery-reservation/system-test/install.ts index d2d61c0396f..6dd1eaadafa 100644 --- a/packages/google-cloud-bigquery-reservation/system-test/install.ts +++ b/packages/google-cloud-bigquery-reservation/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-bigquery-reservation/test/gapic_reservation_service_v1.ts b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts index 573757b9b3b..4440135f8ac 100644 --- a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts +++ b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_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. From 4ed6312079d27ec08b751fec39cabc911995dc9f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 2 Feb 2022 17:01:04 +0100 Subject: [PATCH 076/105] chore(deps): update dependency sinon to v13 (#134) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^12.0.0` -> `^13.0.0`](https://renovatebot.com/diffs/npm/sinon/12.0.1/13.0.1) | [![age](https://badges.renovateapi.com/packages/npm/sinon/13.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/13.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/13.0.1/compatibility-slim/12.0.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/13.0.1/confidence-slim/12.0.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v13.0.1`](https://togithub.com/sinonjs/sinon/blob/HEAD/CHANGES.md#​1301) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v13.0.0...v13.0.1) - [`ec4223f9`](https://togithub.com/sinonjs/sinon/commit/ec4223f94076d809483e3c6a7536cfc1278dd3c9) Bump nise to fix [sinonjs/nise#​193](https://togithub.com/sinonjs/nise/issues/193) (Carl-Erik Kopseng) - [`f329a010`](https://togithub.com/sinonjs/sinon/commit/f329a01040bfa5a79e039419220b21eda56935d6) Add unimported to workflow ([#​2441](https://togithub.com/sinonjs/sinon/issues/2441)) (Morgan Roderick) - [`7f16cec9`](https://togithub.com/sinonjs/sinon/commit/7f16cec968c3c8d4e580267fb00195916d6f827d) Enable updates to same major version (Carl-Erik Kopseng) - [`f784d7ad`](https://togithub.com/sinonjs/sinon/commit/f784d7ad2c86be0fc65477d69f8bdafca846ef2c) Re-introduce new version.sh script to version hook (Joel Bradshaw) > This was inadvertently removed during merge conflicts, and is required > for any of the new release process stuff to work - [`51c508ab`](https://togithub.com/sinonjs/sinon/commit/51c508ab77cf0f9fb8c5305ff626f6a2eada178f) Add dry run mode to `npm version` ([#​2436](https://togithub.com/sinonjs/sinon/issues/2436)) (Joel Bradshaw) > - Add DRY_RUN flag to skip publish/push > > - Allow overriding branch names for testing - [`05341dcf`](https://togithub.com/sinonjs/sinon/commit/05341dcf92ddca4a1d4c90966b1fcdc7039cff18) Update npm version scripts to manage new releases branch (Joel Bradshaw) - [`fe658261`](https://togithub.com/sinonjs/sinon/commit/fe65826171db69ed2986a1060db77944dbc98a6d) Remove release archives from master (Joel Bradshaw) > These archives made it difficult to find things in the GitHub interface, > and take up a lot of space in a checked-out repo for something that is > not useful to most people checking out the repository. > > The main purpose of these archives is to make old versions and > documentation available on the Sinon website that is run out of this > repo. This can be supported by using a separate branch for website > releases, and to maintain the archives. > > Following this commit, the `npm version` scripts will be updated to > automatically handle archiving the releases in the new releases branch > and keeping it up to date with master. > > Also remove the directories we removed from .prettierignore, since they > don't exist any more. *Released by [Carl-Erik Kopseng](https://togithub.com/fatso83) on 2022-02-01.* ### [`v13.0.0`](https://togithub.com/sinonjs/sinon/blob/HEAD/CHANGES.md#​1300) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v12.0.1...v13.0.0) - [`cf3d6c0c`](https://togithub.com/sinonjs/sinon/commit/cf3d6c0cd9689c0ee673b3daa8bf9abd70304392) Upgrade packages ([#​2431](https://togithub.com/sinonjs/sinon/issues/2431)) (Carl-Erik Kopseng) > - Update all @​sinonjs/ packages > > - Upgrade to fake-timers 9 > > - chore: ensure always using latest LTS release - [`41710467`](https://togithub.com/sinonjs/sinon/commit/417104670d575e96a1b645ea40ce763afa76fb1b) Adjust deploy scripts to archive old releases in a separate branch, move existing releases out of master ([#​2426](https://togithub.com/sinonjs/sinon/issues/2426)) (Joel Bradshaw) > Co-authored-by: Carl-Erik Kopseng - [`c80a7266`](https://togithub.com/sinonjs/sinon/commit/c80a72660e89d88b08275eff1028ecb9e26fd8e9) Bump node-fetch from 2.6.1 to 2.6.7 ([#​2430](https://togithub.com/sinonjs/sinon/issues/2430)) (dependabot\[bot]) > Co-authored-by: dependabot\[bot] <49699333+dependabot\[bot][@​users](https://togithub.com/users).noreply.github.com> - [`a00f14a9`](https://togithub.com/sinonjs/sinon/commit/a00f14a97dbe8c65afa89674e16ad73fc7d2fdc0) Add explicit export for `./*` ([#​2413](https://togithub.com/sinonjs/sinon/issues/2413)) (なつき) - [`b82ca7ad`](https://togithub.com/sinonjs/sinon/commit/b82ca7ad9b1add59007771f65a18ee34415de8ca) Bump cached-path-relative from 1.0.2 to 1.1.0 ([#​2428](https://togithub.com/sinonjs/sinon/issues/2428)) (dependabot\[bot]) - [`a9ea1427`](https://togithub.com/sinonjs/sinon/commit/a9ea142716c094ef3c432ecc4089f8207b8dd8b6) Add documentation for assert.calledOnceWithMatch ([#​2424](https://togithub.com/sinonjs/sinon/issues/2424)) (Mathias Schreck) - [`1d5ab86b`](https://togithub.com/sinonjs/sinon/commit/1d5ab86ba60e50dd69593ffed2bffd4b8faa0d38) Be more general in stripping off stack frames to fix Firefox tests ([#​2425](https://togithub.com/sinonjs/sinon/issues/2425)) (Joel Bradshaw) - [`56b06129`](https://togithub.com/sinonjs/sinon/commit/56b06129e223eae690265c37b1113067e2b31bdc) Check call count type ([#​2410](https://togithub.com/sinonjs/sinon/issues/2410)) (Joel Bradshaw) - [`7863e2df`](https://togithub.com/sinonjs/sinon/commit/7863e2dfdbda79e0a32e42af09e6539fc2f2b80f) Fix [#​2414](https://togithub.com/sinonjs/sinon/issues/2414): make Sinon available on homepage (Carl-Erik Kopseng) - [`fabaabdd`](https://togithub.com/sinonjs/sinon/commit/fabaabdda82f39a7f5b75b55bd56cf77b1cd4a8f) Bump nokogiri from 1.11.4 to 1.13.1 ([#​2423](https://togithub.com/sinonjs/sinon/issues/2423)) (dependabot\[bot]) - [`dbc0fbd2`](https://togithub.com/sinonjs/sinon/commit/dbc0fbd263c8419fa47f9c3b20cf47890a242d21) Bump shelljs from 0.8.4 to 0.8.5 ([#​2422](https://togithub.com/sinonjs/sinon/issues/2422)) (dependabot\[bot]) - [`fb8b3d72`](https://togithub.com/sinonjs/sinon/commit/fb8b3d72a85dc8fb0547f859baf3f03a22a039f7) Run Prettier (Carl-Erik Kopseng) - [`12a45939`](https://togithub.com/sinonjs/sinon/commit/12a45939e9b047b6d3663fe55f2eb383ec63c4e1) Fix 2377: Throw error when trying to stub non-configurable or non-writable properties ([#​2417](https://togithub.com/sinonjs/sinon/issues/2417)) (Stuart Dotson) > Fixes issue [#​2377](https://togithub.com/sinonjs/sinon/issues/2377) by throwing an error when trying to stub non-configurable or non-writable properties *Released by [Carl-Erik Kopseng](https://togithub.com/fatso83) on 2022-01-28.*
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-bigquery-reservation). --- packages/google-cloud-bigquery-reservation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 0a9451748b0..85b7d1fadf7 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -54,7 +54,7 @@ "mocha": "^8.0.1", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^12.0.0", + "sinon": "^13.0.0", "ts-loader": "^8.0.0", "typescript": "^3.9.6", "webpack": "^5.0.0", From 0374478c45efe2e722df73a4fbaf18d65cbe03df 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:14:55 +0000 Subject: [PATCH 077/105] docs(nodejs): version support policy edits (#1346) (#136) --- .../README.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/README.md b/packages/google-cloud-bigquery-reservation/README.md index 0ece38f2806..d97b2d47102 100644 --- a/packages/google-cloud-bigquery-reservation/README.md +++ b/packages/google-cloud-bigquery-reservation/README.md @@ -111,21 +111,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/bigquery-reservation@legacy-8` installs client libraries +for versions compatible with Node.js 8. ## Versioning From 16baed4353a234a4bf0df50a3b168bcd8b07ebc7 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:02:57 +0000 Subject: [PATCH 078/105] docs(samples): include metadata file, add exclusions for samples to handwritten libraries (#137) - [ ] 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 --- .../reservation_service.create_assignment.js | 9 +- ...tion_service.create_capacity_commitment.js | 9 +- .../reservation_service.create_reservation.js | 9 +- .../reservation_service.delete_assignment.js | 9 +- ...tion_service.delete_capacity_commitment.js | 9 +- .../reservation_service.delete_reservation.js | 9 +- .../reservation_service.get_bi_reservation.js | 9 +- ...rvation_service.get_capacity_commitment.js | 9 +- .../v1/reservation_service.get_reservation.js | 9 +- .../reservation_service.list_assignments.js | 9 +- ...ation_service.list_capacity_commitments.js | 9 +- .../reservation_service.list_reservations.js | 9 +- ...tion_service.merge_capacity_commitments.js | 9 +- .../v1/reservation_service.move_assignment.js | 9 +- ...ervation_service.search_all_assignments.js | 9 +- .../reservation_service.search_assignments.js | 9 +- ...ation_service.split_capacity_commitment.js | 9 +- ...servation_service.update_bi_reservation.js | 9 +- ...tion_service.update_capacity_commitment.js | 9 +- .../reservation_service.update_reservation.js | 9 +- ....google.cloud.bigquery.reservation.v1.json | 919 ++++++++++++++++++ .../src/v1/reservation_service_client.ts | 5 +- .../test/gapic_reservation_service_v1.ts | 280 +++++- 23 files changed, 1339 insertions(+), 45 deletions(-) create mode 100644 packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js index cb9789ce31c..2b5e68a2ea7 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.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-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js index 61e519f219e..cdf5e6853af 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.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-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js index 6ae5ca53ac8..6bc964f62bc 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.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-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js index f4086563146..8041b70dffd 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.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-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js index 4dedd2559f9..4f5f5ef9149 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.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-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js index 16d70c9e7b4..2b5a58ed8d6 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.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-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js index 2be851c5797..22e54a8fe68 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.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-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js index 165d585b76a..e85980e6470 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.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-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js index a987bad85fe..0c53c8e83af 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.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-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js index 886e2d9863a..3a4a8e4683a 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.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-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js index a188c5f8877..3244c692013 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.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-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js index 3293861ff5e..da742ed916a 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.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-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js index fdfbdf89a1c..79e22d60b40 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.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-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js index c7a1523c980..b336287cc25 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.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-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js index f820c39bbbb..7c82ad7420d 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.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-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js index 57f0a052812..a10d6d416ca 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.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-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js index b08b490be78..273bce062bb 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.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-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js index 2dd75bf8fa3..f43ccc9c74e 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.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-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js index 868f9f3492d..ae6d3777bae 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.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-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js index eca930ba859..939b67c84f3 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.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-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json b/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json new file mode 100644 index 00000000000..0a2f3a9bc06 --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json @@ -0,0 +1,919 @@ +{ + "clientLibrary": { + "name": "nodejs-reservation", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.bigquery.reservation.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_CreateReservation_async", + "title": "ReservationService createReservation Sample", + "origin": "API_DEFINITION", + "description": " Creates a new reservation resource.", + "canonical": true, + "file": "reservation_service.create_reservation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateReservation", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "reservation_id", + "type": "TYPE_STRING" + }, + { + "name": "reservation", + "type": ".google.cloud.bigquery.reservation.v1.Reservation" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.Reservation", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "CreateReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateReservation", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_ListReservations_async", + "title": "ReservationService listReservations Sample", + "origin": "API_DEFINITION", + "description": " Lists all the reservations for the project in the specified location.", + "canonical": true, + "file": "reservation_service.list_reservations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListReservations", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListReservations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.ListReservationsResponse", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "ListReservations", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListReservations", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_GetReservation_async", + "title": "ReservationService getReservation Sample", + "origin": "API_DEFINITION", + "description": " Returns information about the reservation.", + "canonical": true, + "file": "reservation_service.get_reservation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetReservation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.Reservation", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "GetReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetReservation", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_DeleteReservation_async", + "title": "ReservationService deleteReservation Sample", + "origin": "API_DEFINITION", + "description": " Deletes a reservation. Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has assignments.", + "canonical": true, + "file": "reservation_service.delete_reservation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "DeleteReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservation", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_UpdateReservation_async", + "title": "ReservationService updateReservation Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing reservation resource.", + "canonical": true, + "file": "reservation_service.update_reservation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservation", + "async": true, + "parameters": [ + { + "name": "reservation", + "type": ".google.cloud.bigquery.reservation.v1.Reservation" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.Reservation", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "UpdateReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservation", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_CreateCapacityCommitment_async", + "title": "ReservationService createCapacityCommitment Sample", + "origin": "API_DEFINITION", + "description": " Creates a new capacity commitment resource.", + "canonical": true, + "file": "reservation_service.create_capacity_commitment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateCapacityCommitment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "capacity_commitment", + "type": ".google.cloud.bigquery.reservation.v1.CapacityCommitment" + }, + { + "name": "enforce_single_admin_project_per_org", + "type": "TYPE_BOOL" + }, + { + "name": "capacity_commitment_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.CapacityCommitment", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "CreateCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateCapacityCommitment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_ListCapacityCommitments_async", + "title": "ReservationService listCapacityCommitments Sample", + "origin": "API_DEFINITION", + "description": " Lists all the capacity commitments for the admin project.", + "canonical": true, + "file": "reservation_service.list_capacity_commitments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCapacityCommitments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "ListCapacityCommitments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_GetCapacityCommitment_async", + "title": "ReservationService getCapacityCommitment Sample", + "origin": "API_DEFINITION", + "description": " Returns information about the capacity commitment.", + "canonical": true, + "file": "reservation_service.get_capacity_commitment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.CapacityCommitment", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "GetCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_DeleteCapacityCommitment_async", + "title": "ReservationService deleteCapacityCommitment Sample", + "origin": "API_DEFINITION", + "description": " Deletes a capacity commitment. Attempting to delete capacity commitment before its commitment_end_time will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`.", + "canonical": true, + "file": "reservation_service.delete_capacity_commitment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "DeleteCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_UpdateCapacityCommitment_async", + "title": "ReservationService updateCapacityCommitment Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing capacity commitment. Only `plan` and `renewal_plan` fields can be updated. Plan can only be changed to a plan of a longer commitment period. Attempting to change to a plan with shorter commitment period will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`.", + "canonical": true, + "file": "reservation_service.update_capacity_commitment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment", + "async": true, + "parameters": [ + { + "name": "capacity_commitment", + "type": ".google.cloud.bigquery.reservation.v1.CapacityCommitment" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.CapacityCommitment", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "UpdateCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_SplitCapacityCommitment_async", + "title": "ReservationService splitCapacityCommitment Sample", + "origin": "API_DEFINITION", + "description": " Splits capacity commitment to two commitments of the same plan and `commitment_end_time`. A common use case is to enable downgrading commitments. For example, in order to downgrade from 10000 slots to 8000, you might split a 10000 capacity commitment into commitments of 2000 and 8000. Then, you would change the plan of the first one to `FLEX` and then delete it.", + "canonical": true, + "file": "reservation_service.split_capacity_commitment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SplitCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "slot_count", + "type": "TYPE_INT64" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "SplitCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_MergeCapacityCommitments_async", + "title": "ReservationService mergeCapacityCommitments Sample", + "origin": "API_DEFINITION", + "description": " Merges capacity commitments of the same plan into a single commitment. The resulting capacity commitment has the greater commitment_end_time out of the to-be-merged capacity commitments. Attempting to merge capacity commitments of different plan will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`.", + "canonical": true, + "file": "reservation_service.merge_capacity_commitments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "MergeCapacityCommitments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "capacity_commitment_ids", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.CapacityCommitment", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "MergeCapacityCommitments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitments", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_CreateAssignment_async", + "title": "ReservationService createAssignment Sample", + "origin": "API_DEFINITION", + "description": " Creates an assignment object which allows the given project to submit jobs of a certain type using slots from the specified reservation. Currently a resource (project, folder, organization) can only have one assignment per each (job_type, location) combination, and that reservation will be used for all jobs of the matching type. Different assignments can be created on different levels of the projects, folders or organization hierarchy. During query execution, the assignment is looked up at the project, folder and organization levels in that order. The first assignment found is applied to the query. When creating assignments, it does not matter if other assignments exist at higher levels. Example: * The organization `organizationA` contains two projects, `project1` and `project2`. * Assignments for all three entities (`organizationA`, `project1`, and `project2`) could all be created and mapped to the same or different reservations. \"None\" assignments represent an absence of the assignment. Projects assigned to None use on-demand pricing. To create a \"None\" assignment, use \"none\" as a reservation_id in the parent. Example parent: `projects/myproject/locations/US/reservations/none`. Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have 'bigquery.admin' permissions on the project using the reservation and the project that owns this reservation. Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment does not match location of the reservation.", + "canonical": true, + "file": "reservation_service.create_assignment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "assignment", + "type": ".google.cloud.bigquery.reservation.v1.Assignment" + }, + { + "name": "assignment_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.Assignment", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "CreateAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_ListAssignments_async", + "title": "ReservationService listAssignments Sample", + "origin": "API_DEFINITION", + "description": " Lists assignments. Only explicitly created assignments will be returned. Example: * Organization `organizationA` contains two projects, `project1` and `project2`. * Reservation `res1` exists and was created previously. * CreateAssignment was used previously to define the following associations between entities and reservations: `` and `` In this example, ListAssignments will just return the above two assignments for reservation `res1`, and no expansion/merge will happen. The wildcard \"-\" can be used for reservations in the request. In that case all assignments belongs to the specified project and location will be listed. **Note** \"-\" cannot be used for projects nor locations.", + "canonical": true, + "file": "reservation_service.list_assignments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAssignments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.ListAssignmentsResponse", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "ListAssignments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_DeleteAssignment_async", + "title": "ReservationService deleteAssignment Sample", + "origin": "API_DEFINITION", + "description": " Deletes a assignment. No expansion will happen. Example: * Organization `organizationA` contains two projects, `project1` and `project2`. * Reservation `res1` exists and was created previously. * CreateAssignment was used previously to define the following associations between entities and reservations: `` and `` In this example, deletion of the `` assignment won't affect the other assignment ``. After said deletion, queries from `project1` will still use `res1` while queries from `project2` will switch to use on-demand mode.", + "canonical": true, + "file": "reservation_service.delete_assignment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "DeleteAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_SearchAssignments_async", + "title": "ReservationService searchAssignments Sample", + "origin": "API_DEFINITION", + "description": " Deprecated: Looks up assignments for a specified resource for a particular region. If the request is about a project: 1. Assignments created on the project will be returned if they exist. 2. Otherwise assignments created on the closest ancestor will be returned. 3. Assignments for different JobTypes will all be returned. The same logic applies if the request is about a folder. If the request is about an organization, then assignments created on the organization will be returned (organization doesn't have ancestors). Comparing to ListAssignments, there are some behavior differences: 1. permission on the assignee will be verified in this API. 2. Hierarchy lookup (project->folder->organization) happens in this API. 3. Parent here is `projects/*/locations/*`, instead of `projects/*/locations/*reservations/*`. **Note** \"-\" cannot be used for projects nor locations.", + "canonical": true, + "file": "reservation_service.search_assignments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchAssignments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "SearchAssignments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_SearchAllAssignments_async", + "title": "ReservationService searchAllAssignments Sample", + "origin": "API_DEFINITION", + "description": " Looks up assignments for a specified resource for a particular region. If the request is about a project: 1. Assignments created on the project will be returned if they exist. 2. Otherwise assignments created on the closest ancestor will be returned. 3. Assignments for different JobTypes will all be returned. The same logic applies if the request is about a folder. If the request is about an organization, then assignments created on the organization will be returned (organization doesn't have ancestors). Comparing to ListAssignments, there are some behavior differences: 1. permission on the assignee will be verified in this API. 2. Hierarchy lookup (project->folder->organization) happens in this API. 3. Parent here is `projects/*/locations/*`, instead of `projects/*/locations/*reservations/*`.", + "canonical": true, + "file": "reservation_service.search_all_assignments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchAllAssignments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "SearchAllAssignments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_MoveAssignment_async", + "title": "ReservationService moveAssignment Sample", + "origin": "API_DEFINITION", + "description": " Moves an assignment under a new reservation. This differs from removing an existing assignment and recreating a new one by providing a transactional change that ensures an assignee always has an associated reservation.", + "canonical": true, + "file": "reservation_service.move_assignment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "MoveAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "destination_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.Assignment", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "MoveAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_GetBiReservation_async", + "title": "ReservationService getBiReservation Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a BI reservation.", + "canonical": true, + "file": "reservation_service.get_bi_reservation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBiReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetBiReservation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.BiReservation", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "GetBiReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetBiReservation", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_UpdateBiReservation_async", + "title": "ReservationService updateBiReservation Sample", + "origin": "API_DEFINITION", + "description": " Updates a BI reservation. Only fields specified in the `field_mask` are updated. A singleton BI reservation always exists with default size 0. In order to reserve BI capacity it needs to be updated to an amount greater than 0. In order to release BI capacity reservation size must be set to 0.", + "canonical": true, + "file": "reservation_service.update_bi_reservation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBiReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateBiReservation", + "async": true, + "parameters": [ + { + "name": "bi_reservation", + "type": ".google.cloud.bigquery.reservation.v1.BiReservation" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.BiReservation", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "UpdateBiReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateBiReservation", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + } + ] +} diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index e0fb6cdaa7a..030194a37eb 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts @@ -3404,9 +3404,8 @@ export class ReservationServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.reservationServiceStub!.then(stub => { + if (this.reservationServiceStub && !this._terminated) { + return this.reservationServiceStub.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts index 4440135f8ac..68e260d4c5d 100644 --- a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts +++ b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts @@ -153,12 +153,27 @@ describe('v1.ReservationServiceClient', () => { assert(client.reservationServiceStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new reservationserviceModule.v1.ReservationServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.reservationServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.reservationServiceStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -304,6 +319,22 @@ describe('v1.ReservationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createReservation with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateReservationRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createReservation(request), expectedError); + }); }); describe('getReservation', () => { @@ -415,6 +446,22 @@ describe('v1.ReservationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getReservation with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetReservationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getReservation(request), expectedError); + }); }); describe('deleteReservation', () => { @@ -526,6 +573,22 @@ describe('v1.ReservationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes deleteReservation with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteReservationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteReservation(request), expectedError); + }); }); describe('updateReservation', () => { @@ -640,6 +703,23 @@ describe('v1.ReservationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateReservation with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateReservationRequest() + ); + request.reservation = {}; + request.reservation.name = ''; + const expectedHeaderRequestParams = 'reservation.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateReservation(request), expectedError); + }); }); describe('createCapacityCommitment', () => { @@ -755,6 +835,25 @@ describe('v1.ReservationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createCapacityCommitment with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.createCapacityCommitment(request), + expectedError + ); + }); }); describe('getCapacityCommitment', () => { @@ -870,6 +969,25 @@ describe('v1.ReservationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getCapacityCommitment with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getCapacityCommitment(request), + expectedError + ); + }); }); describe('deleteCapacityCommitment', () => { @@ -985,6 +1103,25 @@ describe('v1.ReservationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes deleteCapacityCommitment with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.deleteCapacityCommitment(request), + expectedError + ); + }); }); describe('updateCapacityCommitment', () => { @@ -1103,6 +1240,26 @@ describe('v1.ReservationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateCapacityCommitment with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest() + ); + request.capacityCommitment = {}; + request.capacityCommitment.name = ''; + const expectedHeaderRequestParams = 'capacity_commitment.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updateCapacityCommitment(request), + expectedError + ); + }); }); describe('splitCapacityCommitment', () => { @@ -1218,6 +1375,25 @@ describe('v1.ReservationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes splitCapacityCommitment with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.splitCapacityCommitment(request), + expectedError + ); + }); }); describe('mergeCapacityCommitments', () => { @@ -1333,6 +1509,25 @@ describe('v1.ReservationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes mergeCapacityCommitments with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.mergeCapacityCommitments(request), + expectedError + ); + }); }); describe('createAssignment', () => { @@ -1444,6 +1639,22 @@ describe('v1.ReservationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createAssignment with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createAssignment(request), expectedError); + }); }); describe('deleteAssignment', () => { @@ -1555,6 +1766,22 @@ describe('v1.ReservationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes deleteAssignment with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteAssignment(request), expectedError); + }); }); describe('moveAssignment', () => { @@ -1666,6 +1893,22 @@ describe('v1.ReservationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes moveAssignment with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.moveAssignment(request), expectedError); + }); }); describe('getBiReservation', () => { @@ -1777,6 +2020,22 @@ describe('v1.ReservationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getBiReservation with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.GetBiReservationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBiReservation(request), expectedError); + }); }); describe('updateBiReservation', () => { @@ -1892,6 +2151,23 @@ describe('v1.ReservationServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateBiReservation with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest() + ); + request.biReservation = {}; + request.biReservation.name = ''; + const expectedHeaderRequestParams = 'bi_reservation.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateBiReservation(request), expectedError); + }); }); describe('listReservations', () => { From ad8896d74cd23da467a34c542b8ec18ab25bbf29 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 7 Mar 2022 22:21:58 +0100 Subject: [PATCH 079/105] chore(deps): update dependency gts to v3 (#127) 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: Steffany Brown <30247553+steffnay@users.noreply.github.com> --- packages/google-cloud-bigquery-reservation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 85b7d1fadf7..818fdecf797 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -46,7 +46,7 @@ "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.2.0", - "gts": "^2.0.2", + "gts": "^3.0.0", "jsdoc": "^3.6.4", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", From b1a310c568997d211c454c7b9989bb7be14978be 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 18:45:20 -0700 Subject: [PATCH 080/105] chore: update v2.14.2 gapic-generator-typescript (#141) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update v2.14.2 gapic-generator-typescript Committer: @summer-ji-eng PiperOrigin-RevId: 434859890 Source-Link: https://github.com/googleapis/googleapis/commit/bc2432d50cba657e95212122e3fa112591b5bec2 Source-Link: https://github.com/googleapis/googleapis-gen/commit/930b673103e92523f8cfed38decd7d3afae8ebe7 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTMwYjY3MzEwM2U5MjUyM2Y4Y2ZlZDM4ZGVjZDdkM2FmYWU4ZWJlNyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../test/gapic_reservation_service_v1.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts index 68e260d4c5d..279b0ab2076 100644 --- a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts +++ b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts @@ -330,7 +330,6 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.CreateReservationRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createReservation(request), expectedError); @@ -457,7 +456,6 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.GetReservationRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getReservation(request), expectedError); @@ -584,7 +582,6 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.DeleteReservationRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteReservation(request), expectedError); @@ -715,7 +712,6 @@ describe('v1.ReservationServiceClient', () => { ); request.reservation = {}; request.reservation.name = ''; - const expectedHeaderRequestParams = 'reservation.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateReservation(request), expectedError); @@ -846,7 +842,6 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -980,7 +975,6 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1114,7 +1108,6 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1252,7 +1245,6 @@ describe('v1.ReservationServiceClient', () => { ); request.capacityCommitment = {}; request.capacityCommitment.name = ''; - const expectedHeaderRequestParams = 'capacity_commitment.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1386,7 +1378,6 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1520,7 +1511,6 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1650,7 +1640,6 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createAssignment(request), expectedError); @@ -1777,7 +1766,6 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteAssignment(request), expectedError); @@ -1904,7 +1892,6 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.moveAssignment(request), expectedError); @@ -2031,7 +2018,6 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.GetBiReservationRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getBiReservation(request), expectedError); @@ -2163,7 +2149,6 @@ describe('v1.ReservationServiceClient', () => { ); request.biReservation = {}; request.biReservation.name = ''; - const expectedHeaderRequestParams = 'bi_reservation.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateBiReservation(request), expectedError); From 9233e4218a8ed0100d0e162a5e7e61974817d941 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 16:05:19 -0400 Subject: [PATCH 081/105] docs: cleanup and clarifications (#147) docs: cleanup and clarifications feat: add UpdateAssignment method feat: add "concurrency" and "multi_region_auxiliary" in reservation feat: add preferred table. PiperOrigin-RevId: 440912466 Source-Link: https://github.com/googleapis/googleapis/commit/7ab53cabd3f30bf27836cd6675d6328818f3c254 Source-Link: https://github.com/googleapis/googleapis-gen/commit/116cf4d57cad5c457c070e71653a48ee2c26ade2 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTE2Y2Y0ZDU3Y2FkNWM0NTdjMDcwZTcxNjUzYTQ4ZWUyYzI2YWRlMiJ9 See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../bigquery/reservation/v1/reservation.proto | 102 ++- .../protos/protos.d.ts | 243 +++++++ .../protos/protos.js | 609 ++++++++++++++++++ .../protos/protos.json | 65 ++ .../reservation_service.create_assignment.js | 2 +- ...tion_service.create_capacity_commitment.js | 4 +- .../reservation_service.create_reservation.js | 5 +- .../reservation_service.update_assignment.js | 61 ++ ....google.cloud.bigquery.reservation.v1.json | 48 +- .../src/v1/gapic_metadata.json | 10 + .../src/v1/reservation_service_client.ts | 119 +++- .../v1/reservation_service_client_config.json | 4 + .../test/gapic_reservation_service_v1.ts | 130 ++++ 13 files changed, 1372 insertions(+), 30 deletions(-) create mode 100644 packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js diff --git a/packages/google-cloud-bigquery-reservation/protos/google/cloud/bigquery/reservation/v1/reservation.proto b/packages/google-cloud-bigquery-reservation/protos/google/cloud/bigquery/reservation/v1/reservation.proto index d631978f7ca..7276c30b572 100644 --- a/packages/google-cloud-bigquery-reservation/protos/google/cloud/bigquery/reservation/v1/reservation.proto +++ b/packages/google-cloud-bigquery-reservation/protos/google/cloud/bigquery/reservation/v1/reservation.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. @@ -154,7 +154,7 @@ service ReservationService { // // For example, in order to downgrade from 10000 slots to 8000, you might // split a 10000 capacity commitment into commitments of 2000 and 8000. Then, - // you would change the plan of the first one to `FLEX` and then delete it. + // you delete the first one after the commitment end time passes. rpc SplitCapacityCommitment(SplitCapacityCommitmentRequest) returns (SplitCapacityCommitmentResponse) { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/capacityCommitments/*}:split" @@ -271,8 +271,8 @@ service ReservationService { option (google.api.method_signature) = "name"; } - // Deprecated: Looks up assignments for a specified resource for a particular region. - // If the request is about a project: + // Deprecated: Looks up assignments for a specified resource for a particular + // region. If the request is about a project: // // 1. Assignments created on the project will be returned if they exist. // 2. Otherwise assignments created on the closest ancestor will be @@ -342,6 +342,17 @@ service ReservationService { option (google.api.method_signature) = "name,destination_id"; } + // Updates an existing assignment. + // + // Only the `priority` field can be updated. + rpc UpdateAssignment(UpdateAssignmentRequest) returns (Assignment) { + option (google.api.http) = { + patch: "/v1/{assignment.name=projects/*/locations/*/reservations/*/assignments/*}" + body: "assignment" + }; + option (google.api.method_signature) = "assignment,update_mask"; + } + // Retrieves a BI reservation. rpc GetBiReservation(GetBiReservationRequest) returns (BiReservation) { option (google.api.http) = { @@ -376,6 +387,9 @@ message Reservation { // The resource name of the reservation, e.g., // `projects/*/locations/*/reservations/team1-prod`. + // The reservation_id must only contain lower case alphanumeric characters or + // dashes. It must start with a letter and must not end with a dash. Its + // maximum length is 64 characters. string name = 1; // Minimum slots available to this reservation. A slot is a unit of @@ -384,10 +398,14 @@ message Reservation { // Queries using this reservation might use more slots during runtime if // ignore_idle_slots is set to false. // - // If the new reservation's slot capacity exceed the parent's slot capacity or - // if total slot capacity of the new reservation and its siblings exceeds the - // parent's slot capacity, the request will fail with + // If the new reservation's slot capacity exceeds the project's slot capacity + // or if total slot capacity of the new reservation and its siblings exceeds + // the project's slot capacity, the request will fail with // `google.rpc.Code.RESOURCE_EXHAUSTED`. + // + // NOTE: for reservations in US or EU multi-regions, slot capacity constraints + // are checked separately for default and auxiliary regions. See + // multi_region_auxiliary flag for more details. int64 slot_capacity = 2; // If false, any query or pipeline job using this reservation will use idle @@ -396,11 +414,26 @@ message Reservation { // capacity specified in the slot_capacity field at most. bool ignore_idle_slots = 4; + // Maximum number of queries that are allowed to run concurrently in this + // reservation. This is a soft limit due to asynchronous nature of the system + // and various optimizations for small queries. + // Default value is 0 which means that concurrency will be automatically set + // based on the reservation size. + int64 concurrency = 16; + // Output only. Creation time of the reservation. google.protobuf.Timestamp creation_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Last update time of the reservation. google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Applicable only for reservations located within one of the BigQuery + // multi-regions (US or EU). + // + // If set to true, this reservation is placed in the organization's + // secondary region which is designated for disaster recovery purposes. + // If false, this reservation is placed in the organization's default region. + bool multi_region_auxiliary = 14; } // Capacity commitment is a way to purchase compute capacity for BigQuery jobs @@ -455,11 +488,11 @@ message CapacityCommitment { STATE_UNSPECIFIED = 0; // Capacity commitment is pending provisioning. Pending capacity commitment - // does not contribute to the parent's slot_capacity. + // does not contribute to the project's slot_capacity. PENDING = 1; // Once slots are provisioned, capacity commitment becomes active. - // slot_count is added to the parent's slot_capacity. + // slot_count is added to the project's slot_capacity. ACTIVE = 2; // Capacity commitment is failed to be activated by the backend. @@ -468,6 +501,9 @@ message CapacityCommitment { // Output only. The resource name of the capacity commitment, e.g., // `projects/myproject/locations/US/capacityCommitments/123` + // The commitment_id must only contain lower case alphanumeric characters or + // dashes. It must start with a letter and must not end + // with a dash. Its maximum length is 64 characters. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // Number of slots in this commitment. @@ -494,6 +530,14 @@ message CapacityCommitment { // passes. Once the plan is changed, committed period is extended according to // commitment plan. Only applicable for ANNUAL and TRIAL commitments. CommitmentPlan renewal_plan = 8; + + // Applicable only for commitments located within one of the BigQuery + // multi-regions (US or EU). + // + // If set to true, this commitment is placed in the organization's + // secondary region which is designated for disaster recovery purposes. + // If false, this commitment is placed in the organization's default region. + bool multi_region_auxiliary = 10; } // The request for [ReservationService.CreateReservation][google.cloud.bigquery.reservation.v1.ReservationService.CreateReservation]. @@ -507,8 +551,9 @@ message CreateReservationRequest { } ]; - // The reservation ID. This field must only contain lower case alphanumeric - // characters or dash. Max length is 64 characters. + // The reservation ID. It must only contain lower case alphanumeric + // characters or dashes. It must start with a letter and must not end + // with a dash. Its maximum length is 64 characters. string reservation_id = 2; // Definition of the new reservation to create. @@ -596,8 +641,8 @@ message CreateCapacityCommitmentRequest { // The optional capacity commitment ID. Capacity commitment name will be // generated automatically if this field is empty. - // This field must only contain lower case alphanumeric characters or dash. - // Max length is 64 characters. + // This field must only contain lower case alphanumeric characters or dashes. + // The first and last character cannot be a dash. Max length is 64 characters. // NOTE: this ID won't be kept if the capacity commitment is split or merged. string capacity_commitment_id = 5; } @@ -708,7 +753,7 @@ message MergeCapacityCommitmentsRequest { repeated string capacity_commitment_ids = 2; } -// A Assignment allows a project to submit jobs +// An assignment allows a project to submit jobs // of a certain type using slots from the specified reservation. message Assignment { option (google.api.resource) = { @@ -750,6 +795,8 @@ message Assignment { // Output only. Name of the resource. E.g.: // `projects/myproject/locations/US/reservations/team1-prod/assignments/123`. + // The assignment_id must only contain lower case alphanumeric characters or + // dashes and the max length is 64 characters. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // The resource which will use the reservation. E.g. @@ -781,7 +828,7 @@ message CreateAssignmentRequest { // The optional assignment ID. Assignment name will be generated automatically // if this field is empty. - // This field must only contain lower case alphanumeric characters or dash. + // This field must only contain lower case alphanumeric characters or dashes. // Max length is 64 characters. string assignment_id = 4; } @@ -942,6 +989,28 @@ message MoveAssignmentRequest { }]; } +// The request for [ReservationService.UpdateAssignment][google.cloud.bigquery.reservation.v1.ReservationService.UpdateAssignment]. +message UpdateAssignmentRequest { + // Content of the assignment to update. + Assignment assignment = 1; + + // Standard field mask for the set of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Fully qualified reference to BigQuery table. +// Internally stored as google.cloud.bi.v1.BqTableReference. +message TableReference { + // The assigned project ID of the project. + string project_id = 1; + + // The ID of the dataset in the above project. + string dataset_id = 2; + + // The ID of the table in the above dataset. + string table_id = 3; +} + // Represents a BI Reservation. message BiReservation { option (google.api.resource) = { @@ -959,6 +1028,9 @@ message BiReservation { // Size of a reservation, in bytes. int64 size = 4; + + // Preferred tables to use BI capacity for. + repeated TableReference preferred_tables = 5; } // A request to get a singleton BI reservation. diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts b/packages/google-cloud-bigquery-reservation/protos/protos.d.ts index c36cfa3d304..ce52f2f29e4 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-reservation/protos/protos.d.ts @@ -301,6 +301,20 @@ export namespace google { */ public moveAssignment(request: google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest): Promise; + /** + * Calls UpdateAssignment. + * @param request UpdateAssignmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Assignment + */ + public updateAssignment(request: google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest, callback: google.cloud.bigquery.reservation.v1.ReservationService.UpdateAssignmentCallback): void; + + /** + * Calls UpdateAssignment. + * @param request UpdateAssignmentRequest message or plain object + * @returns Promise + */ + public updateAssignment(request: google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest): Promise; + /** * Calls GetBiReservation. * @param request GetBiReservationRequest message or plain object @@ -458,6 +472,13 @@ export namespace google { */ type MoveAssignmentCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.Assignment) => void; + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#updateAssignment}. + * @param error Error, if any + * @param [response] Assignment + */ + type UpdateAssignmentCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.Assignment) => void; + /** * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#getBiReservation}. * @param error Error, if any @@ -485,11 +506,17 @@ export namespace google { /** Reservation ignoreIdleSlots */ ignoreIdleSlots?: (boolean|null); + /** Reservation concurrency */ + concurrency?: (number|Long|string|null); + /** Reservation creationTime */ creationTime?: (google.protobuf.ITimestamp|null); /** Reservation updateTime */ updateTime?: (google.protobuf.ITimestamp|null); + + /** Reservation multiRegionAuxiliary */ + multiRegionAuxiliary?: (boolean|null); } /** Represents a Reservation. */ @@ -510,12 +537,18 @@ export namespace google { /** Reservation ignoreIdleSlots. */ public ignoreIdleSlots: boolean; + /** Reservation concurrency. */ + public concurrency: (number|Long|string); + /** Reservation creationTime. */ public creationTime?: (google.protobuf.ITimestamp|null); /** Reservation updateTime. */ public updateTime?: (google.protobuf.ITimestamp|null); + /** Reservation multiRegionAuxiliary. */ + public multiRegionAuxiliary: boolean; + /** * Creates a new Reservation instance using the specified properties. * @param [properties] Properties to set @@ -613,6 +646,9 @@ export namespace google { /** CapacityCommitment renewalPlan */ renewalPlan?: (google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan|keyof typeof google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan|null); + + /** CapacityCommitment multiRegionAuxiliary */ + multiRegionAuxiliary?: (boolean|null); } /** Represents a CapacityCommitment. */ @@ -648,6 +684,9 @@ export namespace google { /** CapacityCommitment renewalPlan. */ public renewalPlan: (google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan|keyof typeof google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan); + /** CapacityCommitment multiRegionAuxiliary. */ + public multiRegionAuxiliary: boolean; + /** * Creates a new CapacityCommitment instance using the specified properties. * @param [properties] Properties to set @@ -3211,6 +3250,204 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of an UpdateAssignmentRequest. */ + interface IUpdateAssignmentRequest { + + /** UpdateAssignmentRequest assignment */ + assignment?: (google.cloud.bigquery.reservation.v1.IAssignment|null); + + /** UpdateAssignmentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateAssignmentRequest. */ + class UpdateAssignmentRequest implements IUpdateAssignmentRequest { + + /** + * Constructs a new UpdateAssignmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest); + + /** UpdateAssignmentRequest assignment. */ + public assignment?: (google.cloud.bigquery.reservation.v1.IAssignment|null); + + /** UpdateAssignmentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateAssignmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAssignmentRequest instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest): google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest; + + /** + * Encodes the specified UpdateAssignmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest.verify|verify} messages. + * @param message UpdateAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest.verify|verify} messages. + * @param message UpdateAssignmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAssignmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest; + + /** + * Decodes an UpdateAssignmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest; + + /** + * Verifies an UpdateAssignmentRequest message. + * @param message Plain 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 UpdateAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAssignmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest; + + /** + * Creates a plain object from an UpdateAssignmentRequest message. Also converts values to other types if specified. + * @param message UpdateAssignmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAssignmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TableReference. */ + interface ITableReference { + + /** TableReference projectId */ + projectId?: (string|null); + + /** TableReference datasetId */ + datasetId?: (string|null); + + /** TableReference tableId */ + tableId?: (string|null); + } + + /** Represents a TableReference. */ + class TableReference implements ITableReference { + + /** + * Constructs a new TableReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.ITableReference); + + /** TableReference projectId. */ + public projectId: string; + + /** TableReference datasetId. */ + public datasetId: string; + + /** TableReference tableId. */ + public tableId: string; + + /** + * Creates a new TableReference instance using the specified properties. + * @param [properties] Properties to set + * @returns TableReference instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.ITableReference): google.cloud.bigquery.reservation.v1.TableReference; + + /** + * Encodes the specified TableReference message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.TableReference.verify|verify} messages. + * @param message TableReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.ITableReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.TableReference.verify|verify} messages. + * @param message TableReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.ITableReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.TableReference; + + /** + * Decodes a TableReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.TableReference; + + /** + * Verifies a TableReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.TableReference; + + /** + * Creates a plain object from a TableReference message. Also converts values to other types if specified. + * @param message TableReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.TableReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a BiReservation. */ interface IBiReservation { @@ -3222,6 +3459,9 @@ export namespace google { /** BiReservation size */ size?: (number|Long|string|null); + + /** BiReservation preferredTables */ + preferredTables?: (google.cloud.bigquery.reservation.v1.ITableReference[]|null); } /** Represents a BiReservation. */ @@ -3242,6 +3482,9 @@ export namespace google { /** BiReservation size. */ public size: (number|Long|string); + /** BiReservation preferredTables. */ + public preferredTables: google.cloud.bigquery.reservation.v1.ITableReference[]; + /** * Creates a new BiReservation instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.js b/packages/google-cloud-bigquery-reservation/protos/protos.js index 64e37513708..30fcd436fee 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.js +++ b/packages/google-cloud-bigquery-reservation/protos/protos.js @@ -701,6 +701,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#updateAssignment}. + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @typedef UpdateAssignmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.reservation.v1.Assignment} [response] Assignment + */ + + /** + * Calls UpdateAssignment. + * @function updateAssignment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest} request UpdateAssignmentRequest message or plain object + * @param {google.cloud.bigquery.reservation.v1.ReservationService.UpdateAssignmentCallback} callback Node-style callback called with the error, if any, and Assignment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReservationService.prototype.updateAssignment = function updateAssignment(request, callback) { + return this.rpcCall(updateAssignment, $root.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest, $root.google.cloud.bigquery.reservation.v1.Assignment, request, callback); + }, "name", { value: "UpdateAssignment" }); + + /** + * Calls UpdateAssignment. + * @function updateAssignment + * @memberof google.cloud.bigquery.reservation.v1.ReservationService + * @instance + * @param {google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest} request UpdateAssignmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#getBiReservation}. * @memberof google.cloud.bigquery.reservation.v1.ReservationService @@ -779,8 +812,10 @@ * @property {string|null} [name] Reservation name * @property {number|Long|null} [slotCapacity] Reservation slotCapacity * @property {boolean|null} [ignoreIdleSlots] Reservation ignoreIdleSlots + * @property {number|Long|null} [concurrency] Reservation concurrency * @property {google.protobuf.ITimestamp|null} [creationTime] Reservation creationTime * @property {google.protobuf.ITimestamp|null} [updateTime] Reservation updateTime + * @property {boolean|null} [multiRegionAuxiliary] Reservation multiRegionAuxiliary */ /** @@ -822,6 +857,14 @@ */ Reservation.prototype.ignoreIdleSlots = false; + /** + * Reservation concurrency. + * @member {number|Long} concurrency + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @instance + */ + Reservation.prototype.concurrency = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** * Reservation creationTime. * @member {google.protobuf.ITimestamp|null|undefined} creationTime @@ -838,6 +881,14 @@ */ Reservation.prototype.updateTime = null; + /** + * Reservation multiRegionAuxiliary. + * @member {boolean} multiRegionAuxiliary + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @instance + */ + Reservation.prototype.multiRegionAuxiliary = false; + /** * Creates a new Reservation instance using the specified properties. * @function create @@ -872,6 +923,10 @@ $root.google.protobuf.Timestamp.encode(message.creationTime, 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(); + if (message.multiRegionAuxiliary != null && Object.hasOwnProperty.call(message, "multiRegionAuxiliary")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.multiRegionAuxiliary); + if (message.concurrency != null && Object.hasOwnProperty.call(message, "concurrency")) + writer.uint32(/* id 16, wireType 0 =*/128).int64(message.concurrency); return writer; }; @@ -915,12 +970,18 @@ case 4: message.ignoreIdleSlots = reader.bool(); break; + case 16: + message.concurrency = reader.int64(); + break; case 8: message.creationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 9: message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; + case 14: + message.multiRegionAuxiliary = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -965,6 +1026,9 @@ if (message.ignoreIdleSlots != null && message.hasOwnProperty("ignoreIdleSlots")) if (typeof message.ignoreIdleSlots !== "boolean") return "ignoreIdleSlots: boolean expected"; + if (message.concurrency != null && message.hasOwnProperty("concurrency")) + if (!$util.isInteger(message.concurrency) && !(message.concurrency && $util.isInteger(message.concurrency.low) && $util.isInteger(message.concurrency.high))) + return "concurrency: integer|Long expected"; if (message.creationTime != null && message.hasOwnProperty("creationTime")) { var error = $root.google.protobuf.Timestamp.verify(message.creationTime); if (error) @@ -975,6 +1039,9 @@ if (error) return "updateTime." + error; } + if (message.multiRegionAuxiliary != null && message.hasOwnProperty("multiRegionAuxiliary")) + if (typeof message.multiRegionAuxiliary !== "boolean") + return "multiRegionAuxiliary: boolean expected"; return null; }; @@ -1003,6 +1070,15 @@ message.slotCapacity = new $util.LongBits(object.slotCapacity.low >>> 0, object.slotCapacity.high >>> 0).toNumber(); if (object.ignoreIdleSlots != null) message.ignoreIdleSlots = Boolean(object.ignoreIdleSlots); + if (object.concurrency != null) + if ($util.Long) + (message.concurrency = $util.Long.fromValue(object.concurrency)).unsigned = false; + else if (typeof object.concurrency === "string") + message.concurrency = parseInt(object.concurrency, 10); + else if (typeof object.concurrency === "number") + message.concurrency = object.concurrency; + else if (typeof object.concurrency === "object") + message.concurrency = new $util.LongBits(object.concurrency.low >>> 0, object.concurrency.high >>> 0).toNumber(); if (object.creationTime != null) { if (typeof object.creationTime !== "object") throw TypeError(".google.cloud.bigquery.reservation.v1.Reservation.creationTime: object expected"); @@ -1013,6 +1089,8 @@ throw TypeError(".google.cloud.bigquery.reservation.v1.Reservation.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } + if (object.multiRegionAuxiliary != null) + message.multiRegionAuxiliary = Boolean(object.multiRegionAuxiliary); return message; }; @@ -1039,6 +1117,12 @@ object.ignoreIdleSlots = false; object.creationTime = null; object.updateTime = null; + object.multiRegionAuxiliary = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.concurrency = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.concurrency = options.longs === String ? "0" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -1053,6 +1137,13 @@ object.creationTime = $root.google.protobuf.Timestamp.toObject(message.creationTime, options); if (message.updateTime != null && message.hasOwnProperty("updateTime")) object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.multiRegionAuxiliary != null && message.hasOwnProperty("multiRegionAuxiliary")) + object.multiRegionAuxiliary = message.multiRegionAuxiliary; + if (message.concurrency != null && message.hasOwnProperty("concurrency")) + if (typeof message.concurrency === "number") + object.concurrency = options.longs === String ? String(message.concurrency) : message.concurrency; + else + object.concurrency = options.longs === String ? $util.Long.prototype.toString.call(message.concurrency) : options.longs === Number ? new $util.LongBits(message.concurrency.low >>> 0, message.concurrency.high >>> 0).toNumber() : message.concurrency; return object; }; @@ -1084,6 +1175,7 @@ * @property {google.protobuf.ITimestamp|null} [commitmentEndTime] CapacityCommitment commitmentEndTime * @property {google.rpc.IStatus|null} [failureStatus] CapacityCommitment failureStatus * @property {google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan|null} [renewalPlan] CapacityCommitment renewalPlan + * @property {boolean|null} [multiRegionAuxiliary] CapacityCommitment multiRegionAuxiliary */ /** @@ -1165,6 +1257,14 @@ */ CapacityCommitment.prototype.renewalPlan = 0; + /** + * CapacityCommitment multiRegionAuxiliary. + * @member {boolean} multiRegionAuxiliary + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @instance + */ + CapacityCommitment.prototype.multiRegionAuxiliary = false; + /** * Creates a new CapacityCommitment instance using the specified properties. * @function create @@ -1205,6 +1305,8 @@ writer.uint32(/* id 8, wireType 0 =*/64).int32(message.renewalPlan); if (message.commitmentStartTime != null && Object.hasOwnProperty.call(message, "commitmentStartTime")) $root.google.protobuf.Timestamp.encode(message.commitmentStartTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.multiRegionAuxiliary != null && Object.hasOwnProperty.call(message, "multiRegionAuxiliary")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.multiRegionAuxiliary); return writer; }; @@ -1263,6 +1365,9 @@ case 8: message.renewalPlan = reader.int32(); break; + case 10: + message.multiRegionAuxiliary = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -1351,6 +1456,9 @@ case 4: break; } + if (message.multiRegionAuxiliary != null && message.hasOwnProperty("multiRegionAuxiliary")) + if (typeof message.multiRegionAuxiliary !== "boolean") + return "multiRegionAuxiliary: boolean expected"; return null; }; @@ -1454,6 +1562,8 @@ message.renewalPlan = 4; break; } + if (object.multiRegionAuxiliary != null) + message.multiRegionAuxiliary = Boolean(object.multiRegionAuxiliary); return message; }; @@ -1483,6 +1593,7 @@ object.failureStatus = null; object.renewalPlan = options.enums === String ? "COMMITMENT_PLAN_UNSPECIFIED" : 0; object.commitmentStartTime = null; + object.multiRegionAuxiliary = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -1503,6 +1614,8 @@ object.renewalPlan = options.enums === String ? $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan[message.renewalPlan] : message.renewalPlan; if (message.commitmentStartTime != null && message.hasOwnProperty("commitmentStartTime")) object.commitmentStartTime = $root.google.protobuf.Timestamp.toObject(message.commitmentStartTime, options); + if (message.multiRegionAuxiliary != null && message.hasOwnProperty("multiRegionAuxiliary")) + object.multiRegionAuxiliary = message.multiRegionAuxiliary; return object; }; @@ -7257,6 +7370,458 @@ return MoveAssignmentRequest; })(); + v1.UpdateAssignmentRequest = (function() { + + /** + * Properties of an UpdateAssignmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface IUpdateAssignmentRequest + * @property {google.cloud.bigquery.reservation.v1.IAssignment|null} [assignment] UpdateAssignmentRequest assignment + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAssignmentRequest updateMask + */ + + /** + * Constructs a new UpdateAssignmentRequest. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents an UpdateAssignmentRequest. + * @implements IUpdateAssignmentRequest + * @constructor + * @param {google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest=} [properties] Properties to set + */ + function UpdateAssignmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAssignmentRequest assignment. + * @member {google.cloud.bigquery.reservation.v1.IAssignment|null|undefined} assignment + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @instance + */ + UpdateAssignmentRequest.prototype.assignment = null; + + /** + * UpdateAssignmentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @instance + */ + UpdateAssignmentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateAssignmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest} UpdateAssignmentRequest instance + */ + UpdateAssignmentRequest.create = function create(properties) { + return new UpdateAssignmentRequest(properties); + }; + + /** + * Encodes the specified UpdateAssignmentRequest message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest} message UpdateAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAssignmentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.assignment != null && Object.hasOwnProperty.call(message, "assignment")) + $root.google.cloud.bigquery.reservation.v1.Assignment.encode(message.assignment, 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 UpdateAssignmentRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest} message UpdateAssignmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAssignmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAssignmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest} UpdateAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAssignmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.assignment = $root.google.cloud.bigquery.reservation.v1.Assignment.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 UpdateAssignmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest} UpdateAssignmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAssignmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAssignmentRequest message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAssignmentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.assignment != null && message.hasOwnProperty("assignment")) { + var error = $root.google.cloud.bigquery.reservation.v1.Assignment.verify(message.assignment); + if (error) + return "assignment." + 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 UpdateAssignmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest} UpdateAssignmentRequest + */ + UpdateAssignmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest(); + if (object.assignment != null) { + if (typeof object.assignment !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest.assignment: object expected"); + message.assignment = $root.google.cloud.bigquery.reservation.v1.Assignment.fromObject(object.assignment); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAssignmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @static + * @param {google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest} message UpdateAssignmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAssignmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.assignment = null; + object.updateMask = null; + } + if (message.assignment != null && message.hasOwnProperty("assignment")) + object.assignment = $root.google.cloud.bigquery.reservation.v1.Assignment.toObject(message.assignment, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateAssignmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAssignmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateAssignmentRequest; + })(); + + v1.TableReference = (function() { + + /** + * Properties of a TableReference. + * @memberof google.cloud.bigquery.reservation.v1 + * @interface ITableReference + * @property {string|null} [projectId] TableReference projectId + * @property {string|null} [datasetId] TableReference datasetId + * @property {string|null} [tableId] TableReference tableId + */ + + /** + * Constructs a new TableReference. + * @memberof google.cloud.bigquery.reservation.v1 + * @classdesc Represents a TableReference. + * @implements ITableReference + * @constructor + * @param {google.cloud.bigquery.reservation.v1.ITableReference=} [properties] Properties to set + */ + function TableReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableReference projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @instance + */ + TableReference.prototype.projectId = ""; + + /** + * TableReference datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @instance + */ + TableReference.prototype.datasetId = ""; + + /** + * TableReference tableId. + * @member {string} tableId + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @instance + */ + TableReference.prototype.tableId = ""; + + /** + * Creates a new TableReference instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @static + * @param {google.cloud.bigquery.reservation.v1.ITableReference=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.TableReference} TableReference instance + */ + TableReference.create = function create(properties) { + return new TableReference(properties); + }; + + /** + * Encodes the specified TableReference message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.TableReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @static + * @param {google.cloud.bigquery.reservation.v1.ITableReference} message TableReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tableId); + return writer; + }; + + /** + * Encodes the specified TableReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.TableReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @static + * @param {google.cloud.bigquery.reservation.v1.ITableReference} message TableReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.TableReference} TableReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.TableReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.string(); + break; + case 2: + message.datasetId = reader.string(); + break; + case 3: + message.tableId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.TableReference} TableReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableReference message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + if (!$util.isString(message.datasetId)) + return "datasetId: string expected"; + if (message.tableId != null && message.hasOwnProperty("tableId")) + if (!$util.isString(message.tableId)) + return "tableId: string expected"; + return null; + }; + + /** + * Creates a TableReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.TableReference} TableReference + */ + TableReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.TableReference) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.TableReference(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.datasetId != null) + message.datasetId = String(object.datasetId); + if (object.tableId != null) + message.tableId = String(object.tableId); + return message; + }; + + /** + * Creates a plain object from a TableReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @static + * @param {google.cloud.bigquery.reservation.v1.TableReference} message TableReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.datasetId = ""; + object.tableId = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + object.datasetId = message.datasetId; + if (message.tableId != null && message.hasOwnProperty("tableId")) + object.tableId = message.tableId; + return object; + }; + + /** + * Converts this TableReference to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @instance + * @returns {Object.} JSON object + */ + TableReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TableReference; + })(); + v1.BiReservation = (function() { /** @@ -7266,6 +7831,7 @@ * @property {string|null} [name] BiReservation name * @property {google.protobuf.ITimestamp|null} [updateTime] BiReservation updateTime * @property {number|Long|null} [size] BiReservation size + * @property {Array.|null} [preferredTables] BiReservation preferredTables */ /** @@ -7277,6 +7843,7 @@ * @param {google.cloud.bigquery.reservation.v1.IBiReservation=} [properties] Properties to set */ function BiReservation(properties) { + this.preferredTables = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7307,6 +7874,14 @@ */ BiReservation.prototype.size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * BiReservation preferredTables. + * @member {Array.} preferredTables + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @instance + */ + BiReservation.prototype.preferredTables = $util.emptyArray; + /** * Creates a new BiReservation instance using the specified properties. * @function create @@ -7337,6 +7912,9 @@ $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.size != null && Object.hasOwnProperty.call(message, "size")) writer.uint32(/* id 4, wireType 0 =*/32).int64(message.size); + if (message.preferredTables != null && message.preferredTables.length) + for (var i = 0; i < message.preferredTables.length; ++i) + $root.google.cloud.bigquery.reservation.v1.TableReference.encode(message.preferredTables[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -7380,6 +7958,11 @@ case 4: message.size = reader.int64(); break; + case 5: + if (!(message.preferredTables && message.preferredTables.length)) + message.preferredTables = []; + message.preferredTables.push($root.google.cloud.bigquery.reservation.v1.TableReference.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -7426,6 +8009,15 @@ if (message.size != null && message.hasOwnProperty("size")) if (!$util.isInteger(message.size) && !(message.size && $util.isInteger(message.size.low) && $util.isInteger(message.size.high))) return "size: integer|Long expected"; + if (message.preferredTables != null && message.hasOwnProperty("preferredTables")) { + if (!Array.isArray(message.preferredTables)) + return "preferredTables: array expected"; + for (var i = 0; i < message.preferredTables.length; ++i) { + var error = $root.google.cloud.bigquery.reservation.v1.TableReference.verify(message.preferredTables[i]); + if (error) + return "preferredTables." + error; + } + } return null; }; @@ -7457,6 +8049,16 @@ message.size = object.size; else if (typeof object.size === "object") message.size = new $util.LongBits(object.size.low >>> 0, object.size.high >>> 0).toNumber(); + if (object.preferredTables) { + if (!Array.isArray(object.preferredTables)) + throw TypeError(".google.cloud.bigquery.reservation.v1.BiReservation.preferredTables: array expected"); + message.preferredTables = []; + for (var i = 0; i < object.preferredTables.length; ++i) { + if (typeof object.preferredTables[i] !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.BiReservation.preferredTables: object expected"); + message.preferredTables[i] = $root.google.cloud.bigquery.reservation.v1.TableReference.fromObject(object.preferredTables[i]); + } + } return message; }; @@ -7473,6 +8075,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.preferredTables = []; if (options.defaults) { object.name = ""; object.updateTime = null; @@ -7491,6 +8095,11 @@ object.size = options.longs === String ? String(message.size) : message.size; else object.size = options.longs === String ? $util.Long.prototype.toString.call(message.size) : options.longs === Number ? new $util.LongBits(message.size.low >>> 0, message.size.high >>> 0).toNumber() : message.size; + if (message.preferredTables && message.preferredTables.length) { + object.preferredTables = []; + for (var j = 0; j < message.preferredTables.length; ++j) + object.preferredTables[j] = $root.google.cloud.bigquery.reservation.v1.TableReference.toObject(message.preferredTables[j], options); + } return object; }; diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.json b/packages/google-cloud-bigquery-reservation/protos/protos.json index 16eb049b737..dafddf1353d 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.json +++ b/packages/google-cloud-bigquery-reservation/protos/protos.json @@ -368,6 +368,26 @@ } ] }, + "UpdateAssignment": { + "requestType": "UpdateAssignmentRequest", + "responseType": "Assignment", + "options": { + "(google.api.http).patch": "/v1/{assignment.name=projects/*/locations/*/reservations/*/assignments/*}", + "(google.api.http).body": "assignment", + "(google.api.method_signature)": "assignment,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{assignment.name=projects/*/locations/*/reservations/*/assignments/*}", + "body": "assignment" + } + }, + { + "(google.api.method_signature)": "assignment,update_mask" + } + ] + }, "GetBiReservation": { "requestType": "GetBiReservationRequest", "responseType": "BiReservation", @@ -426,6 +446,10 @@ "type": "bool", "id": 4 }, + "concurrency": { + "type": "int64", + "id": 16 + }, "creationTime": { "type": "google.protobuf.Timestamp", "id": 8, @@ -439,6 +463,10 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "multiRegionAuxiliary": { + "type": "bool", + "id": 14 } } }, @@ -494,6 +522,10 @@ "renewalPlan": { "type": "CommitmentPlan", "id": 8 + }, + "multiRegionAuxiliary": { + "type": "bool", + "id": 10 } }, "nested": { @@ -951,6 +983,34 @@ } } }, + "UpdateAssignmentRequest": { + "fields": { + "assignment": { + "type": "Assignment", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "TableReference": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "datasetId": { + "type": "string", + "id": 2 + }, + "tableId": { + "type": "string", + "id": 3 + } + } + }, "BiReservation": { "options": { "(google.api.resource).type": "bigqueryreservation.googleapis.com/BiReservation", @@ -971,6 +1031,11 @@ "size": { "type": "int64", "id": 4 + }, + "preferredTables": { + "rule": "repeated", + "type": "TableReference", + "id": 5 } } }, diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js index 2b5e68a2ea7..7bff16973d0 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js @@ -37,7 +37,7 @@ function main(parent) { /** * The optional assignment ID. Assignment name will be generated automatically * if this field is empty. - * This field must only contain lower case alphanumeric characters or dash. + * This field must only contain lower case alphanumeric characters or dashes. * Max length is 64 characters. */ // const assignmentId = 'abc123' diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js index cdf5e6853af..80e138385c7 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js @@ -42,8 +42,8 @@ function main(parent) { /** * The optional capacity commitment ID. Capacity commitment name will be * generated automatically if this field is empty. - * This field must only contain lower case alphanumeric characters or dash. - * Max length is 64 characters. + * This field must only contain lower case alphanumeric characters or dashes. + * The first and last character cannot be a dash. Max length is 64 characters. * NOTE: this ID won't be kept if the capacity commitment is split or merged. */ // const capacityCommitmentId = 'abc123' diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js index 6bc964f62bc..9c3e52b1135 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js @@ -31,8 +31,9 @@ function main(parent) { */ // const parent = 'abc123' /** - * The reservation ID. This field must only contain lower case alphanumeric - * characters or dash. Max length is 64 characters. + * The reservation ID. It must only contain lower case alphanumeric + * characters or dashes. It must start with a letter and must not end + * with a dash. Its maximum length is 64 characters. */ // const reservationId = 'abc123' /** diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js new file mode 100644 index 00000000000..bf5b485586d --- /dev/null +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.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() { + // [START bigqueryreservation_v1_generated_ReservationService_UpdateAssignment_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Content of the assignment to update. + */ + // const assignment = {} + /** + * Standard field mask for the set of fields to be updated. + */ + // const updateMask = {} + + // Imports the Reservation library + const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1; + + // Instantiates a client + const reservationClient = new ReservationServiceClient(); + + async function callUpdateAssignment() { + // Construct request + const request = { + }; + + // Run request + const response = await reservationClient.updateAssignment(request); + console.log(response); + } + + callUpdateAssignment(); + // [END bigqueryreservation_v1_generated_ReservationService_UpdateAssignment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json b/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json index 0a2f3a9bc06..dde87a296ef 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 60, + "end": 61, "type": "FULL" } ], @@ -463,7 +463,7 @@ "regionTag": "bigqueryreservation_v1_generated_ReservationService_SplitCapacityCommitment_async", "title": "ReservationService splitCapacityCommitment Sample", "origin": "API_DEFINITION", - "description": " Splits capacity commitment to two commitments of the same plan and `commitment_end_time`. A common use case is to enable downgrading commitments. For example, in order to downgrade from 10000 slots to 8000, you might split a 10000 capacity commitment into commitments of 2000 and 8000. Then, you would change the plan of the first one to `FLEX` and then delete it.", + "description": " Splits capacity commitment to two commitments of the same plan and `commitment_end_time`. A common use case is to enable downgrading commitments. For example, in order to downgrade from 10000 slots to 8000, you might split a 10000 capacity commitment into commitments of 2000 and 8000. Then, you delete the first one after the commitment end time passes.", "canonical": true, "file": "reservation_service.split_capacity_commitment.js", "language": "JAVASCRIPT", @@ -831,6 +831,50 @@ } } }, + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_UpdateAssignment_async", + "title": "ReservationService updateAssignment Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing assignment. Only the `priority` field can be updated.", + "canonical": true, + "file": "reservation_service.update_assignment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateAssignment", + "async": true, + "parameters": [ + { + "name": "assignment", + "type": ".google.cloud.bigquery.reservation.v1.Assignment" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.Assignment", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "UpdateAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateAssignment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } + }, { "regionTag": "bigqueryreservation_v1_generated_ReservationService_GetBiReservation_async", "title": "ReservationService getBiReservation Sample", diff --git a/packages/google-cloud-bigquery-reservation/src/v1/gapic_metadata.json b/packages/google-cloud-bigquery-reservation/src/v1/gapic_metadata.json index 6e01d0e38af..03838a39d9b 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/gapic_metadata.json +++ b/packages/google-cloud-bigquery-reservation/src/v1/gapic_metadata.json @@ -75,6 +75,11 @@ "moveAssignment" ] }, + "UpdateAssignment": { + "methods": [ + "updateAssignment" + ] + }, "GetBiReservation": { "methods": [ "getBiReservation" @@ -190,6 +195,11 @@ "moveAssignment" ] }, + "UpdateAssignment": { + "methods": [ + "updateAssignment" + ] + }, "GetBiReservation": { "methods": [ "getBiReservation" diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index 030194a37eb..68955261380 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts @@ -298,6 +298,7 @@ export class ReservationServiceClient { 'searchAssignments', 'searchAllAssignments', 'moveAssignment', + 'updateAssignment', 'getBiReservation', 'updateBiReservation', ]; @@ -394,8 +395,9 @@ export class ReservationServiceClient { * Required. Project, location. E.g., * `projects/myproject/locations/US` * @param {string} request.reservationId - * The reservation ID. This field must only contain lower case alphanumeric - * characters or dash. Max length is 64 characters. + * The reservation ID. It must only contain lower case alphanumeric + * characters or dashes. It must start with a letter and must not end + * with a dash. Its maximum length is 64 characters. * @param {google.cloud.bigquery.reservation.v1.Reservation} request.reservation * Definition of the new reservation to create. * @param {object} [options] @@ -801,8 +803,8 @@ export class ReservationServiceClient { * @param {string} request.capacityCommitmentId * The optional capacity commitment ID. Capacity commitment name will be * generated automatically if this field is empty. - * This field must only contain lower case alphanumeric characters or dash. - * Max length is 64 characters. + * This field must only contain lower case alphanumeric characters or dashes. + * The first and last character cannot be a dash. Max length is 64 characters. * NOTE: this ID won't be kept if the capacity commitment is split or merged. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -1221,7 +1223,7 @@ export class ReservationServiceClient { * * For example, in order to downgrade from 10000 slots to 8000, you might * split a 10000 capacity commitment into commitments of 2000 and 8000. Then, - * you would change the plan of the first one to `FLEX` and then delete it. + * you delete the first one after the commitment end time passes. * * @param {Object} request * The request object that will be sent. @@ -1485,7 +1487,7 @@ export class ReservationServiceClient { * @param {string} request.assignmentId * The optional assignment ID. Assignment name will be generated automatically * if this field is empty. - * This field must only contain lower case alphanumeric characters or dash. + * This field must only contain lower case alphanumeric characters or dashes. * Max length is 64 characters. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -1795,6 +1797,107 @@ export class ReservationServiceClient { this.initialize(); return this.innerApiCalls.moveAssignment(request, options, callback); } + /** + * Updates an existing assignment. + * + * Only the `priority` field can be updated. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.bigquery.reservation.v1.Assignment} request.assignment + * Content of the assignment to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Standard field mask for the set of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Assignment]{@link google.cloud.bigquery.reservation.v1.Assignment}. + * 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/reservation_service.update_assignment.js + * region_tag:bigqueryreservation_v1_generated_ReservationService_UpdateAssignment_async + */ + updateAssignment( + request?: protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment, + ( + | protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest + | undefined + ), + {} | undefined + ] + >; + updateAssignment( + request: protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateAssignment( + request: protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest, + callback: Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateAssignment( + request?: protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.reservation.v1.IAssignment, + ( + | protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest + | 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({ + 'assignment.name': request.assignment!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateAssignment(request, options, callback); + } /** * Retrieves a BI reservation. * @@ -2616,8 +2719,8 @@ export class ReservationServiceClient { ) as AsyncIterable; } /** - * Deprecated: Looks up assignments for a specified resource for a particular region. - * If the request is about a project: + * Deprecated: Looks up assignments for a specified resource for a particular + * region. If the request is about a project: * * 1. Assignments created on the project will be returned if they exist. * 2. Otherwise assignments created on the closest ancestor will be diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client_config.json b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client_config.json index 760e758b8e3..2ac442ba027 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client_config.json +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client_config.json @@ -109,6 +109,10 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "UpdateAssignment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "GetBiReservation": { "timeout_millis": 300000, "retry_codes_name": "idempotent", diff --git a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts index 279b0ab2076..c4b66a79743 100644 --- a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts +++ b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts @@ -1898,6 +1898,136 @@ describe('v1.ReservationServiceClient', () => { }); }); + describe('updateAssignment', () => { + it('invokes updateAssignment without error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest() + ); + request.assignment = {}; + request.assignment.name = ''; + const expectedHeaderRequestParams = 'assignment.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ); + client.innerApiCalls.updateAssignment = stubSimpleCall(expectedResponse); + const [response] = await client.updateAssignment(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateAssignment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateAssignment without error using callback', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest() + ); + request.assignment = {}; + request.assignment.name = ''; + const expectedHeaderRequestParams = 'assignment.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.Assignment() + ); + client.innerApiCalls.updateAssignment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAssignment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.reservation.v1.IAssignment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateAssignment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateAssignment with error', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest() + ); + request.assignment = {}; + request.assignment.name = ''; + const expectedHeaderRequestParams = 'assignment.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAssignment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateAssignment(request), expectedError); + assert( + (client.innerApiCalls.updateAssignment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateAssignment with closed client', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest() + ); + request.assignment = {}; + request.assignment.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateAssignment(request), expectedError); + }); + }); + describe('getBiReservation', () => { it('invokes getBiReservation without error', async () => { const client = new reservationserviceModule.v1.ReservationServiceClient({ From 6ea340afd36882450284a4d084b5b1778a22fc6d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 02:32:15 +0000 Subject: [PATCH 082/105] build(node): update client library version in samples metadata (#1356) (#150) * 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 --- ....google.cloud.bigquery.reservation.v1.json | 1840 ++++++++--------- 1 file changed, 920 insertions(+), 920 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json b/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json index dde87a296ef..34519e110a9 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json @@ -1,963 +1,963 @@ { - "clientLibrary": { - "name": "nodejs-reservation", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.bigquery.reservation.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "bigqueryreservation_v1_generated_ReservationService_CreateReservation_async", - "title": "ReservationService createReservation Sample", - "origin": "API_DEFINITION", - "description": " Creates a new reservation resource.", - "canonical": true, - "file": "reservation_service.create_reservation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateReservation", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateReservation", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "reservation_id", - "type": "TYPE_STRING" - }, - { - "name": "reservation", - "type": ".google.cloud.bigquery.reservation.v1.Reservation" - } - ], - "resultType": ".google.cloud.bigquery.reservation.v1.Reservation", - "client": { - "shortName": "ReservationServiceClient", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" - }, - "method": { - "shortName": "CreateReservation", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateReservation", - "service": { - "shortName": "ReservationService", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - } + "clientLibrary": { + "name": "nodejs-reservation", + "version": "1.4.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.bigquery.reservation.v1", + "version": "v1" + } + ] }, - { - "regionTag": "bigqueryreservation_v1_generated_ReservationService_ListReservations_async", - "title": "ReservationService listReservations Sample", - "origin": "API_DEFINITION", - "description": " Lists all the reservations for the project in the specified location.", - "canonical": true, - "file": "reservation_service.list_reservations.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListReservations", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListReservations", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.bigquery.reservation.v1.ListReservationsResponse", - "client": { - "shortName": "ReservationServiceClient", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + "regionTag": "bigqueryreservation_v1_generated_ReservationService_CreateReservation_async", + "title": "ReservationService createReservation Sample", + "origin": "API_DEFINITION", + "description": " Creates a new reservation resource.", + "canonical": true, + "file": "reservation_service.create_reservation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateReservation", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "reservation_id", + "type": "TYPE_STRING" + }, + { + "name": "reservation", + "type": ".google.cloud.bigquery.reservation.v1.Reservation" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.Reservation", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "CreateReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateReservation", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } }, - "method": { - "shortName": "ListReservations", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListReservations", - "service": { - "shortName": "ReservationService", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - } - }, - { - "regionTag": "bigqueryreservation_v1_generated_ReservationService_GetReservation_async", - "title": "ReservationService getReservation Sample", - "origin": "API_DEFINITION", - "description": " Returns information about the reservation.", - "canonical": true, - "file": "reservation_service.get_reservation.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetReservation", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetReservation", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.bigquery.reservation.v1.Reservation", - "client": { - "shortName": "ReservationServiceClient", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + "regionTag": "bigqueryreservation_v1_generated_ReservationService_ListReservations_async", + "title": "ReservationService listReservations Sample", + "origin": "API_DEFINITION", + "description": " Lists all the reservations for the project in the specified location.", + "canonical": true, + "file": "reservation_service.list_reservations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListReservations", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListReservations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.ListReservationsResponse", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "ListReservations", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListReservations", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } }, - "method": { - "shortName": "GetReservation", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetReservation", - "service": { - "shortName": "ReservationService", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - } - }, - { - "regionTag": "bigqueryreservation_v1_generated_ReservationService_DeleteReservation_async", - "title": "ReservationService deleteReservation Sample", - "origin": "API_DEFINITION", - "description": " Deletes a reservation. Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has assignments.", - "canonical": true, - "file": "reservation_service.delete_reservation.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteReservation", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservation", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ReservationServiceClient", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + "regionTag": "bigqueryreservation_v1_generated_ReservationService_GetReservation_async", + "title": "ReservationService getReservation Sample", + "origin": "API_DEFINITION", + "description": " Returns information about the reservation.", + "canonical": true, + "file": "reservation_service.get_reservation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetReservation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.Reservation", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "GetReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetReservation", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } }, - "method": { - "shortName": "DeleteReservation", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservation", - "service": { - "shortName": "ReservationService", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - } - }, - { - "regionTag": "bigqueryreservation_v1_generated_ReservationService_UpdateReservation_async", - "title": "ReservationService updateReservation Sample", - "origin": "API_DEFINITION", - "description": " Updates an existing reservation resource.", - "canonical": true, - "file": "reservation_service.update_reservation.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateReservation", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservation", - "async": true, - "parameters": [ - { - "name": "reservation", - "type": ".google.cloud.bigquery.reservation.v1.Reservation" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.bigquery.reservation.v1.Reservation", - "client": { - "shortName": "ReservationServiceClient", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + "regionTag": "bigqueryreservation_v1_generated_ReservationService_DeleteReservation_async", + "title": "ReservationService deleteReservation Sample", + "origin": "API_DEFINITION", + "description": " Deletes a reservation. Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has assignments.", + "canonical": true, + "file": "reservation_service.delete_reservation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "DeleteReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservation", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } }, - "method": { - "shortName": "UpdateReservation", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservation", - "service": { - "shortName": "ReservationService", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - } - }, - { - "regionTag": "bigqueryreservation_v1_generated_ReservationService_CreateCapacityCommitment_async", - "title": "ReservationService createCapacityCommitment Sample", - "origin": "API_DEFINITION", - "description": " Creates a new capacity commitment resource.", - "canonical": true, - "file": "reservation_service.create_capacity_commitment.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCapacityCommitment", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateCapacityCommitment", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "capacity_commitment", - "type": ".google.cloud.bigquery.reservation.v1.CapacityCommitment" - }, - { - "name": "enforce_single_admin_project_per_org", - "type": "TYPE_BOOL" - }, - { - "name": "capacity_commitment_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.bigquery.reservation.v1.CapacityCommitment", - "client": { - "shortName": "ReservationServiceClient", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + "regionTag": "bigqueryreservation_v1_generated_ReservationService_UpdateReservation_async", + "title": "ReservationService updateReservation Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing reservation resource.", + "canonical": true, + "file": "reservation_service.update_reservation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservation", + "async": true, + "parameters": [ + { + "name": "reservation", + "type": ".google.cloud.bigquery.reservation.v1.Reservation" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.Reservation", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "UpdateReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservation", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } }, - "method": { - "shortName": "CreateCapacityCommitment", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateCapacityCommitment", - "service": { - "shortName": "ReservationService", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - } - }, - { - "regionTag": "bigqueryreservation_v1_generated_ReservationService_ListCapacityCommitments_async", - "title": "ReservationService listCapacityCommitments Sample", - "origin": "API_DEFINITION", - "description": " Lists all the capacity commitments for the admin project.", - "canonical": true, - "file": "reservation_service.list_capacity_commitments.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListCapacityCommitments", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse", - "client": { - "shortName": "ReservationServiceClient", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + "regionTag": "bigqueryreservation_v1_generated_ReservationService_CreateCapacityCommitment_async", + "title": "ReservationService createCapacityCommitment Sample", + "origin": "API_DEFINITION", + "description": " Creates a new capacity commitment resource.", + "canonical": true, + "file": "reservation_service.create_capacity_commitment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateCapacityCommitment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "capacity_commitment", + "type": ".google.cloud.bigquery.reservation.v1.CapacityCommitment" + }, + { + "name": "enforce_single_admin_project_per_org", + "type": "TYPE_BOOL" + }, + { + "name": "capacity_commitment_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.CapacityCommitment", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "CreateCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateCapacityCommitment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } }, - "method": { - "shortName": "ListCapacityCommitments", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments", - "service": { - "shortName": "ReservationService", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - } - }, - { - "regionTag": "bigqueryreservation_v1_generated_ReservationService_GetCapacityCommitment_async", - "title": "ReservationService getCapacityCommitment Sample", - "origin": "API_DEFINITION", - "description": " Returns information about the capacity commitment.", - "canonical": true, - "file": "reservation_service.get_capacity_commitment.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCapacityCommitment", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.bigquery.reservation.v1.CapacityCommitment", - "client": { - "shortName": "ReservationServiceClient", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + "regionTag": "bigqueryreservation_v1_generated_ReservationService_ListCapacityCommitments_async", + "title": "ReservationService listCapacityCommitments Sample", + "origin": "API_DEFINITION", + "description": " Lists all the capacity commitments for the admin project.", + "canonical": true, + "file": "reservation_service.list_capacity_commitments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCapacityCommitments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "ListCapacityCommitments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } }, - "method": { - "shortName": "GetCapacityCommitment", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitment", - "service": { - "shortName": "ReservationService", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - } - }, - { - "regionTag": "bigqueryreservation_v1_generated_ReservationService_DeleteCapacityCommitment_async", - "title": "ReservationService deleteCapacityCommitment Sample", - "origin": "API_DEFINITION", - "description": " Deletes a capacity commitment. Attempting to delete capacity commitment before its commitment_end_time will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`.", - "canonical": true, - "file": "reservation_service.delete_capacity_commitment.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteCapacityCommitment", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "force", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ReservationServiceClient", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + "regionTag": "bigqueryreservation_v1_generated_ReservationService_GetCapacityCommitment_async", + "title": "ReservationService getCapacityCommitment Sample", + "origin": "API_DEFINITION", + "description": " Returns information about the capacity commitment.", + "canonical": true, + "file": "reservation_service.get_capacity_commitment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.CapacityCommitment", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "GetCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } }, - "method": { - "shortName": "DeleteCapacityCommitment", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitment", - "service": { - "shortName": "ReservationService", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - } - }, - { - "regionTag": "bigqueryreservation_v1_generated_ReservationService_UpdateCapacityCommitment_async", - "title": "ReservationService updateCapacityCommitment Sample", - "origin": "API_DEFINITION", - "description": " Updates an existing capacity commitment. Only `plan` and `renewal_plan` fields can be updated. Plan can only be changed to a plan of a longer commitment period. Attempting to change to a plan with shorter commitment period will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`.", - "canonical": true, - "file": "reservation_service.update_capacity_commitment.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCapacityCommitment", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment", - "async": true, - "parameters": [ - { - "name": "capacity_commitment", - "type": ".google.cloud.bigquery.reservation.v1.CapacityCommitment" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.bigquery.reservation.v1.CapacityCommitment", - "client": { - "shortName": "ReservationServiceClient", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + "regionTag": "bigqueryreservation_v1_generated_ReservationService_DeleteCapacityCommitment_async", + "title": "ReservationService deleteCapacityCommitment Sample", + "origin": "API_DEFINITION", + "description": " Deletes a capacity commitment. Attempting to delete capacity commitment before its commitment_end_time will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`.", + "canonical": true, + "file": "reservation_service.delete_capacity_commitment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "DeleteCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } }, - "method": { - "shortName": "UpdateCapacityCommitment", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment", - "service": { - "shortName": "ReservationService", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - } - }, - { - "regionTag": "bigqueryreservation_v1_generated_ReservationService_SplitCapacityCommitment_async", - "title": "ReservationService splitCapacityCommitment Sample", - "origin": "API_DEFINITION", - "description": " Splits capacity commitment to two commitments of the same plan and `commitment_end_time`. A common use case is to enable downgrading commitments. For example, in order to downgrade from 10000 slots to 8000, you might split a 10000 capacity commitment into commitments of 2000 and 8000. Then, you delete the first one after the commitment end time passes.", - "canonical": true, - "file": "reservation_service.split_capacity_commitment.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SplitCapacityCommitment", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "slot_count", - "type": "TYPE_INT64" - } - ], - "resultType": ".google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse", - "client": { - "shortName": "ReservationServiceClient", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + "regionTag": "bigqueryreservation_v1_generated_ReservationService_UpdateCapacityCommitment_async", + "title": "ReservationService updateCapacityCommitment Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing capacity commitment. Only `plan` and `renewal_plan` fields can be updated. Plan can only be changed to a plan of a longer commitment period. Attempting to change to a plan with shorter commitment period will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`.", + "canonical": true, + "file": "reservation_service.update_capacity_commitment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment", + "async": true, + "parameters": [ + { + "name": "capacity_commitment", + "type": ".google.cloud.bigquery.reservation.v1.CapacityCommitment" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.CapacityCommitment", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "UpdateCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } }, - "method": { - "shortName": "SplitCapacityCommitment", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment", - "service": { - "shortName": "ReservationService", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - } - }, - { - "regionTag": "bigqueryreservation_v1_generated_ReservationService_MergeCapacityCommitments_async", - "title": "ReservationService mergeCapacityCommitments Sample", - "origin": "API_DEFINITION", - "description": " Merges capacity commitments of the same plan into a single commitment. The resulting capacity commitment has the greater commitment_end_time out of the to-be-merged capacity commitments. Attempting to merge capacity commitments of different plan will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`.", - "canonical": true, - "file": "reservation_service.merge_capacity_commitments.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "MergeCapacityCommitments", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitments", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "capacity_commitment_ids", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.cloud.bigquery.reservation.v1.CapacityCommitment", - "client": { - "shortName": "ReservationServiceClient", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + "regionTag": "bigqueryreservation_v1_generated_ReservationService_SplitCapacityCommitment_async", + "title": "ReservationService splitCapacityCommitment Sample", + "origin": "API_DEFINITION", + "description": " Splits capacity commitment to two commitments of the same plan and `commitment_end_time`. A common use case is to enable downgrading commitments. For example, in order to downgrade from 10000 slots to 8000, you might split a 10000 capacity commitment into commitments of 2000 and 8000. Then, you delete the first one after the commitment end time passes.", + "canonical": true, + "file": "reservation_service.split_capacity_commitment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SplitCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "slot_count", + "type": "TYPE_INT64" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "SplitCapacityCommitment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } }, - "method": { - "shortName": "MergeCapacityCommitments", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitments", - "service": { - "shortName": "ReservationService", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - } - }, - { - "regionTag": "bigqueryreservation_v1_generated_ReservationService_CreateAssignment_async", - "title": "ReservationService createAssignment Sample", - "origin": "API_DEFINITION", - "description": " Creates an assignment object which allows the given project to submit jobs of a certain type using slots from the specified reservation. Currently a resource (project, folder, organization) can only have one assignment per each (job_type, location) combination, and that reservation will be used for all jobs of the matching type. Different assignments can be created on different levels of the projects, folders or organization hierarchy. During query execution, the assignment is looked up at the project, folder and organization levels in that order. The first assignment found is applied to the query. When creating assignments, it does not matter if other assignments exist at higher levels. Example: * The organization `organizationA` contains two projects, `project1` and `project2`. * Assignments for all three entities (`organizationA`, `project1`, and `project2`) could all be created and mapped to the same or different reservations. \"None\" assignments represent an absence of the assignment. Projects assigned to None use on-demand pricing. To create a \"None\" assignment, use \"none\" as a reservation_id in the parent. Example parent: `projects/myproject/locations/US/reservations/none`. Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have 'bigquery.admin' permissions on the project using the reservation and the project that owns this reservation. Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment does not match location of the reservation.", - "canonical": true, - "file": "reservation_service.create_assignment.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateAssignment", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignment", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "assignment", - "type": ".google.cloud.bigquery.reservation.v1.Assignment" - }, - { - "name": "assignment_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.bigquery.reservation.v1.Assignment", - "client": { - "shortName": "ReservationServiceClient", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + "regionTag": "bigqueryreservation_v1_generated_ReservationService_MergeCapacityCommitments_async", + "title": "ReservationService mergeCapacityCommitments Sample", + "origin": "API_DEFINITION", + "description": " Merges capacity commitments of the same plan into a single commitment. The resulting capacity commitment has the greater commitment_end_time out of the to-be-merged capacity commitments. Attempting to merge capacity commitments of different plan will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`.", + "canonical": true, + "file": "reservation_service.merge_capacity_commitments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "MergeCapacityCommitments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "capacity_commitment_ids", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.CapacityCommitment", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "MergeCapacityCommitments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitments", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } }, - "method": { - "shortName": "CreateAssignment", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignment", - "service": { - "shortName": "ReservationService", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - } - }, - { - "regionTag": "bigqueryreservation_v1_generated_ReservationService_ListAssignments_async", - "title": "ReservationService listAssignments Sample", - "origin": "API_DEFINITION", - "description": " Lists assignments. Only explicitly created assignments will be returned. Example: * Organization `organizationA` contains two projects, `project1` and `project2`. * Reservation `res1` exists and was created previously. * CreateAssignment was used previously to define the following associations between entities and reservations: `` and `` In this example, ListAssignments will just return the above two assignments for reservation `res1`, and no expansion/merge will happen. The wildcard \"-\" can be used for reservations in the request. In that case all assignments belongs to the specified project and location will be listed. **Note** \"-\" cannot be used for projects nor locations.", - "canonical": true, - "file": "reservation_service.list_assignments.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAssignments", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.bigquery.reservation.v1.ListAssignmentsResponse", - "client": { - "shortName": "ReservationServiceClient", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + "regionTag": "bigqueryreservation_v1_generated_ReservationService_CreateAssignment_async", + "title": "ReservationService createAssignment Sample", + "origin": "API_DEFINITION", + "description": " Creates an assignment object which allows the given project to submit jobs of a certain type using slots from the specified reservation. Currently a resource (project, folder, organization) can only have one assignment per each (job_type, location) combination, and that reservation will be used for all jobs of the matching type. Different assignments can be created on different levels of the projects, folders or organization hierarchy. During query execution, the assignment is looked up at the project, folder and organization levels in that order. The first assignment found is applied to the query. When creating assignments, it does not matter if other assignments exist at higher levels. Example: * The organization `organizationA` contains two projects, `project1` and `project2`. * Assignments for all three entities (`organizationA`, `project1`, and `project2`) could all be created and mapped to the same or different reservations. \"None\" assignments represent an absence of the assignment. Projects assigned to None use on-demand pricing. To create a \"None\" assignment, use \"none\" as a reservation_id in the parent. Example parent: `projects/myproject/locations/US/reservations/none`. Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have 'bigquery.admin' permissions on the project using the reservation and the project that owns this reservation. Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment does not match location of the reservation.", + "canonical": true, + "file": "reservation_service.create_assignment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "assignment", + "type": ".google.cloud.bigquery.reservation.v1.Assignment" + }, + { + "name": "assignment_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.Assignment", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "CreateAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } }, - "method": { - "shortName": "ListAssignments", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments", - "service": { - "shortName": "ReservationService", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - } - }, - { - "regionTag": "bigqueryreservation_v1_generated_ReservationService_DeleteAssignment_async", - "title": "ReservationService deleteAssignment Sample", - "origin": "API_DEFINITION", - "description": " Deletes a assignment. No expansion will happen. Example: * Organization `organizationA` contains two projects, `project1` and `project2`. * Reservation `res1` exists and was created previously. * CreateAssignment was used previously to define the following associations between entities and reservations: `` and `` In this example, deletion of the `` assignment won't affect the other assignment ``. After said deletion, queries from `project1` will still use `res1` while queries from `project2` will switch to use on-demand mode.", - "canonical": true, - "file": "reservation_service.delete_assignment.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteAssignment", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "ReservationServiceClient", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + "regionTag": "bigqueryreservation_v1_generated_ReservationService_ListAssignments_async", + "title": "ReservationService listAssignments Sample", + "origin": "API_DEFINITION", + "description": " Lists assignments. Only explicitly created assignments will be returned. Example: * Organization `organizationA` contains two projects, `project1` and `project2`. * Reservation `res1` exists and was created previously. * CreateAssignment was used previously to define the following associations between entities and reservations: `` and `` In this example, ListAssignments will just return the above two assignments for reservation `res1`, and no expansion/merge will happen. The wildcard \"-\" can be used for reservations in the request. In that case all assignments belongs to the specified project and location will be listed. **Note** \"-\" cannot be used for projects nor locations.", + "canonical": true, + "file": "reservation_service.list_assignments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAssignments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.ListAssignmentsResponse", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "ListAssignments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } }, - "method": { - "shortName": "DeleteAssignment", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignment", - "service": { - "shortName": "ReservationService", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - } - }, - { - "regionTag": "bigqueryreservation_v1_generated_ReservationService_SearchAssignments_async", - "title": "ReservationService searchAssignments Sample", - "origin": "API_DEFINITION", - "description": " Deprecated: Looks up assignments for a specified resource for a particular region. If the request is about a project: 1. Assignments created on the project will be returned if they exist. 2. Otherwise assignments created on the closest ancestor will be returned. 3. Assignments for different JobTypes will all be returned. The same logic applies if the request is about a folder. If the request is about an organization, then assignments created on the organization will be returned (organization doesn't have ancestors). Comparing to ListAssignments, there are some behavior differences: 1. permission on the assignee will be verified in this API. 2. Hierarchy lookup (project->folder->organization) happens in this API. 3. Parent here is `projects/*/locations/*`, instead of `projects/*/locations/*reservations/*`. **Note** \"-\" cannot be used for projects nor locations.", - "canonical": true, - "file": "reservation_service.search_assignments.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SearchAssignments", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "query", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse", - "client": { - "shortName": "ReservationServiceClient", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + "regionTag": "bigqueryreservation_v1_generated_ReservationService_DeleteAssignment_async", + "title": "ReservationService deleteAssignment Sample", + "origin": "API_DEFINITION", + "description": " Deletes a assignment. No expansion will happen. Example: * Organization `organizationA` contains two projects, `project1` and `project2`. * Reservation `res1` exists and was created previously. * CreateAssignment was used previously to define the following associations between entities and reservations: `` and `` In this example, deletion of the `` assignment won't affect the other assignment ``. After said deletion, queries from `project1` will still use `res1` while queries from `project2` will switch to use on-demand mode.", + "canonical": true, + "file": "reservation_service.delete_assignment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "DeleteAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } }, - "method": { - "shortName": "SearchAssignments", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments", - "service": { - "shortName": "ReservationService", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - } - }, - { - "regionTag": "bigqueryreservation_v1_generated_ReservationService_SearchAllAssignments_async", - "title": "ReservationService searchAllAssignments Sample", - "origin": "API_DEFINITION", - "description": " Looks up assignments for a specified resource for a particular region. If the request is about a project: 1. Assignments created on the project will be returned if they exist. 2. Otherwise assignments created on the closest ancestor will be returned. 3. Assignments for different JobTypes will all be returned. The same logic applies if the request is about a folder. If the request is about an organization, then assignments created on the organization will be returned (organization doesn't have ancestors). Comparing to ListAssignments, there are some behavior differences: 1. permission on the assignee will be verified in this API. 2. Hierarchy lookup (project->folder->organization) happens in this API. 3. Parent here is `projects/*/locations/*`, instead of `projects/*/locations/*reservations/*`.", - "canonical": true, - "file": "reservation_service.search_all_assignments.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SearchAllAssignments", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "query", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse", - "client": { - "shortName": "ReservationServiceClient", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + "regionTag": "bigqueryreservation_v1_generated_ReservationService_SearchAssignments_async", + "title": "ReservationService searchAssignments Sample", + "origin": "API_DEFINITION", + "description": " Deprecated: Looks up assignments for a specified resource for a particular region. If the request is about a project: 1. Assignments created on the project will be returned if they exist. 2. Otherwise assignments created on the closest ancestor will be returned. 3. Assignments for different JobTypes will all be returned. The same logic applies if the request is about a folder. If the request is about an organization, then assignments created on the organization will be returned (organization doesn't have ancestors). Comparing to ListAssignments, there are some behavior differences: 1. permission on the assignee will be verified in this API. 2. Hierarchy lookup (project->folder->organization) happens in this API. 3. Parent here is `projects/*/locations/*`, instead of `projects/*/locations/*reservations/*`. **Note** \"-\" cannot be used for projects nor locations.", + "canonical": true, + "file": "reservation_service.search_assignments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchAssignments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "SearchAssignments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } }, - "method": { - "shortName": "SearchAllAssignments", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments", - "service": { - "shortName": "ReservationService", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - } - }, - { - "regionTag": "bigqueryreservation_v1_generated_ReservationService_MoveAssignment_async", - "title": "ReservationService moveAssignment Sample", - "origin": "API_DEFINITION", - "description": " Moves an assignment under a new reservation. This differs from removing an existing assignment and recreating a new one by providing a transactional change that ensures an assignee always has an associated reservation.", - "canonical": true, - "file": "reservation_service.move_assignment.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "MoveAssignment", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "destination_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.bigquery.reservation.v1.Assignment", - "client": { - "shortName": "ReservationServiceClient", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + "regionTag": "bigqueryreservation_v1_generated_ReservationService_SearchAllAssignments_async", + "title": "ReservationService searchAllAssignments Sample", + "origin": "API_DEFINITION", + "description": " Looks up assignments for a specified resource for a particular region. If the request is about a project: 1. Assignments created on the project will be returned if they exist. 2. Otherwise assignments created on the closest ancestor will be returned. 3. Assignments for different JobTypes will all be returned. The same logic applies if the request is about a folder. If the request is about an organization, then assignments created on the organization will be returned (organization doesn't have ancestors). Comparing to ListAssignments, there are some behavior differences: 1. permission on the assignee will be verified in this API. 2. Hierarchy lookup (project->folder->organization) happens in this API. 3. Parent here is `projects/*/locations/*`, instead of `projects/*/locations/*reservations/*`.", + "canonical": true, + "file": "reservation_service.search_all_assignments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchAllAssignments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "SearchAllAssignments", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } }, - "method": { - "shortName": "MoveAssignment", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignment", - "service": { - "shortName": "ReservationService", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - } - }, - { - "regionTag": "bigqueryreservation_v1_generated_ReservationService_UpdateAssignment_async", - "title": "ReservationService updateAssignment Sample", - "origin": "API_DEFINITION", - "description": " Updates an existing assignment. Only the `priority` field can be updated.", - "canonical": true, - "file": "reservation_service.update_assignment.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateAssignment", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateAssignment", - "async": true, - "parameters": [ - { - "name": "assignment", - "type": ".google.cloud.bigquery.reservation.v1.Assignment" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.bigquery.reservation.v1.Assignment", - "client": { - "shortName": "ReservationServiceClient", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + "regionTag": "bigqueryreservation_v1_generated_ReservationService_MoveAssignment_async", + "title": "ReservationService moveAssignment Sample", + "origin": "API_DEFINITION", + "description": " Moves an assignment under a new reservation. This differs from removing an existing assignment and recreating a new one by providing a transactional change that ensures an assignee always has an associated reservation.", + "canonical": true, + "file": "reservation_service.move_assignment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "MoveAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "destination_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.Assignment", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "MoveAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } }, - "method": { - "shortName": "UpdateAssignment", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateAssignment", - "service": { - "shortName": "ReservationService", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - } - }, - { - "regionTag": "bigqueryreservation_v1_generated_ReservationService_GetBiReservation_async", - "title": "ReservationService getBiReservation Sample", - "origin": "API_DEFINITION", - "description": " Retrieves a BI reservation.", - "canonical": true, - "file": "reservation_service.get_bi_reservation.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetBiReservation", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetBiReservation", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.bigquery.reservation.v1.BiReservation", - "client": { - "shortName": "ReservationServiceClient", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + "regionTag": "bigqueryreservation_v1_generated_ReservationService_UpdateAssignment_async", + "title": "ReservationService updateAssignment Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing assignment. Only the `priority` field can be updated.", + "canonical": true, + "file": "reservation_service.update_assignment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateAssignment", + "async": true, + "parameters": [ + { + "name": "assignment", + "type": ".google.cloud.bigquery.reservation.v1.Assignment" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.Assignment", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "UpdateAssignment", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateAssignment", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } }, - "method": { - "shortName": "GetBiReservation", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetBiReservation", - "service": { - "shortName": "ReservationService", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" - } - } - } - }, - { - "regionTag": "bigqueryreservation_v1_generated_ReservationService_UpdateBiReservation_async", - "title": "ReservationService updateBiReservation Sample", - "origin": "API_DEFINITION", - "description": " Updates a BI reservation. Only fields specified in the `field_mask` are updated. A singleton BI reservation always exists with default size 0. In order to reserve BI capacity it needs to be updated to an amount greater than 0. In order to release BI capacity reservation size must be set to 0.", - "canonical": true, - "file": "reservation_service.update_bi_reservation.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateBiReservation", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateBiReservation", - "async": true, - "parameters": [ - { - "name": "bi_reservation", - "type": ".google.cloud.bigquery.reservation.v1.BiReservation" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.bigquery.reservation.v1.BiReservation", - "client": { - "shortName": "ReservationServiceClient", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + "regionTag": "bigqueryreservation_v1_generated_ReservationService_GetBiReservation_async", + "title": "ReservationService getBiReservation Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a BI reservation.", + "canonical": true, + "file": "reservation_service.get_bi_reservation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBiReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetBiReservation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.BiReservation", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "GetBiReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.GetBiReservation", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } }, - "method": { - "shortName": "UpdateBiReservation", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateBiReservation", - "service": { - "shortName": "ReservationService", - "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" - } + { + "regionTag": "bigqueryreservation_v1_generated_ReservationService_UpdateBiReservation_async", + "title": "ReservationService updateBiReservation Sample", + "origin": "API_DEFINITION", + "description": " Updates a BI reservation. Only fields specified in the `field_mask` are updated. A singleton BI reservation always exists with default size 0. In order to reserve BI capacity it needs to be updated to an amount greater than 0. In order to release BI capacity reservation size must be set to 0.", + "canonical": true, + "file": "reservation_service.update_bi_reservation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBiReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateBiReservation", + "async": true, + "parameters": [ + { + "name": "bi_reservation", + "type": ".google.cloud.bigquery.reservation.v1.BiReservation" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.bigquery.reservation.v1.BiReservation", + "client": { + "shortName": "ReservationServiceClient", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationServiceClient" + }, + "method": { + "shortName": "UpdateBiReservation", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService.UpdateBiReservation", + "service": { + "shortName": "ReservationService", + "fullName": "google.cloud.bigquery.reservation.v1.ReservationService" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file From 3e729ebee77251de2547524795d5a7ede192ba7b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 3 May 2022 03:22:24 +0200 Subject: [PATCH 083/105] chore(deps): update dependency @types/mocha to v9 (#151) 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-bigquery-reservation). --- packages/google-cloud-bigquery-reservation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 818fdecf797..558616284c2 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -42,7 +42,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.2.0", From fb4856882aa30795ccbd52e376d6f485254ad560 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 9 May 2022 17:38:27 +0200 Subject: [PATCH 084/105] chore(deps): update dependency sinon to v14 (#154) 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-bigquery-reservation). --- packages/google-cloud-bigquery-reservation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 558616284c2..07d11cc3544 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -54,7 +54,7 @@ "mocha": "^8.0.1", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^13.0.0", + "sinon": "^14.0.0", "ts-loader": "^8.0.0", "typescript": "^3.9.6", "webpack": "^5.0.0", From 4180214dd070f77fc0c284bfe7dc852509fca012 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Fri, 20 May 2022 11:35:17 -0700 Subject: [PATCH 085/105] build!: update library to use Node 12 (#155) *build!: Update library to use Node 12 --- .../google-cloud-bigquery-reservation/package.json | 10 +++++----- .../samples/package.json | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 07d11cc3544..884530bbb4c 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -39,28 +39,28 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.24.1" + "google-gax": "^3.0.1" }, "devDependencies": { "@types/mocha": "^9.0.0", "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.2.0", - "gts": "^3.0.0", + "gts": "^3.1.0", "jsdoc": "^3.6.4", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", "linkinator": "^2.1.1", - "mocha": "^8.0.1", + "mocha": "^9.2.2", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^14.0.0", "ts-loader": "^8.0.0", - "typescript": "^3.9.6", + "typescript": "^4.6.4", "webpack": "^5.0.0", "webpack-cli": "^4.0.0" }, "engines": { - "node": ">=10.0.0" + "node": ">=12.0.0" } } diff --git a/packages/google-cloud-bigquery-reservation/samples/package.json b/packages/google-cloud-bigquery-reservation/samples/package.json index 0d330b29ae0..4e650bc81a6 100644 --- a/packages/google-cloud-bigquery-reservation/samples/package.json +++ b/packages/google-cloud-bigquery-reservation/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=10" + "node": ">=12.0.0" }, "files": [ "*.js" @@ -20,4 +20,4 @@ "chai": "^4.2.0", "mocha": "^8.0.0" } -} +} \ No newline at end of file From 8f79eb42fda5bad791af6c5e83f17cc97dbacf35 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 9 Jun 2022 11:38:56 -0700 Subject: [PATCH 086/105] chore(main): release 2.0.0 (#157) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 2.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 --- .../CHANGELOG.md | 17 +++++++++++++++++ .../package.json | 2 +- ...ta.google.cloud.bigquery.reservation.v1.json | 2 +- .../samples/package.json | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/CHANGELOG.md b/packages/google-cloud-bigquery-reservation/CHANGELOG.md index 5eace787768..0c7eab855a8 100644 --- a/packages/google-cloud-bigquery-reservation/CHANGELOG.md +++ b/packages/google-cloud-bigquery-reservation/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [2.0.0](https://github.com/googleapis/nodejs-bigquery-reservation/compare/v1.4.0...v2.0.0) (2022-06-07) + + +### ⚠ BREAKING CHANGES + +* Update library to use Node 12 +* update library to use Node 12 (#155) + +### Build System + +* update library to use Node 12 ([#155](https://github.com/googleapis/nodejs-bigquery-reservation/issues/155)) ([408fedd](https://github.com/googleapis/nodejs-bigquery-reservation/commit/408feddc7218687fcb8c4f0ee332b5231fb705eb)) + + +### *build + +* Update library to use Node 12 ([408fedd](https://github.com/googleapis/nodejs-bigquery-reservation/commit/408feddc7218687fcb8c4f0ee332b5231fb705eb)) + ## [1.4.0](https://www.github.com/googleapis/nodejs-bigquery-reservation/compare/v1.3.0...v1.4.0) (2021-12-30) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 884530bbb4c..1c155e23e41 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-reservation", - "version": "1.4.0", + "version": "2.0.0", "description": "BigQuery Reservation client for Node.js", "repository": "googleapis/nodejs-bigquery-reservation", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json b/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json index 34519e110a9..f81ff764423 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-reservation", - "version": "1.4.0", + "version": "2.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-bigquery-reservation/samples/package.json b/packages/google-cloud-bigquery-reservation/samples/package.json index 4e650bc81a6..76737c7f823 100644 --- a/packages/google-cloud-bigquery-reservation/samples/package.json +++ b/packages/google-cloud-bigquery-reservation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-reservation": "^1.4.0" + "@google-cloud/bigquery-reservation": "^2.0.0" }, "devDependencies": { "c8": "^7.1.0", From 6cd35c4751e46c4174ccb0e930030a60e9743f92 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jun 2022 16:58:24 +0200 Subject: [PATCH 087/105] chore(deps): update dependency jsdoc-region-tag to v2 (#160) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [jsdoc-region-tag](https://togithub.com/googleapis/jsdoc-region-tag) | [`^1.0.4` -> `^2.0.0`](https://renovatebot.com/diffs/npm/jsdoc-region-tag/1.3.1/2.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/compatibility-slim/1.3.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/confidence-slim/1.3.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/jsdoc-region-tag ### [`v2.0.0`](https://togithub.com/googleapis/jsdoc-region-tag/blob/HEAD/CHANGELOG.md#​200-httpsgithubcomgoogleapisjsdoc-region-tagcomparev131v200-2022-05-20) [Compare Source](https://togithub.com/googleapis/jsdoc-region-tag/compare/v1.3.1...v2.0.0) ##### ⚠ BREAKING CHANGES - update library to use Node 12 ([#​107](https://togithub.com/googleapis/jsdoc-region-tag/issues/107)) ##### Build System - update library to use Node 12 ([#​107](https://togithub.com/googleapis/jsdoc-region-tag/issues/107)) ([5b51796](https://togithub.com/googleapis/jsdoc-region-tag/commit/5b51796771984cf8b978990025f14faa03c19923)) ##### [1.3.1](https://www.github.com/googleapis/jsdoc-region-tag/compare/v1.3.0...v1.3.1) (2021-08-11) ##### Bug Fixes - **build:** migrate to using main branch ([#​79](https://www.togithub.com/googleapis/jsdoc-region-tag/issues/79)) ([5050615](https://www.github.com/googleapis/jsdoc-region-tag/commit/50506150b7758592df5e389c6a5c3d82b3b20881))
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-bigquery-reservation). --- packages/google-cloud-bigquery-reservation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 1c155e23e41..bae90374095 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -49,7 +49,7 @@ "gts": "^3.1.0", "jsdoc": "^3.6.4", "jsdoc-fresh": "^1.0.2", - "jsdoc-region-tag": "^1.0.4", + "jsdoc-region-tag": "^2.0.0", "linkinator": "^2.1.1", "mocha": "^9.2.2", "null-loader": "^4.0.0", From b6eca071bf621c967bb1f989b560838e46a2e629 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jun 2022 17:26:26 +0200 Subject: [PATCH 088/105] chore(deps): update dependency jsdoc-fresh to v2 (#159) 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-bigquery-reservation). --- packages/google-cloud-bigquery-reservation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index bae90374095..2d2f1c9575f 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -48,7 +48,7 @@ "c8": "^7.2.0", "gts": "^3.1.0", "jsdoc": "^3.6.4", - "jsdoc-fresh": "^1.0.2", + "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "linkinator": "^2.1.1", "mocha": "^9.2.2", From 4bff3019dfc88820240ce900576357e37f8d97be Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 30 Jun 2022 14:54:05 -0700 Subject: [PATCH 089/105] fix(docs): document fallback rest option (#161) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: support regapic LRO Use gapic-generator-typescript v2.15.1. 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 * 🦉 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/reservation_service_client.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index 68955261380..67cbaf314c9 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts @@ -84,7 +84,7 @@ export class ReservationServiceClient { * * @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] @@ -107,11 +107,10 @@ export class ReservationServiceClient { * 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 9dba21896369ede47fb86beddfac248ad75a2fc8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 9 Jul 2022 00:46:57 +0200 Subject: [PATCH 090/105] chore(deps): update dependency linkinator to v4 (#164) --- packages/google-cloud-bigquery-reservation/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 2d2f1c9575f..7ee1676c1a6 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -50,7 +50,7 @@ "jsdoc": "^3.6.4", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^2.1.1", + "linkinator": "^4.0.0", "mocha": "^9.2.2", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", From 18b0ff9c85f9a93de834f696f517e5e3691b4197 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:14:28 +0000 Subject: [PATCH 091/105] fix: better support for fallback mode (#165) - [ ] 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 --- .../reservation_service.create_assignment.js | 3 + ...tion_service.create_capacity_commitment.js | 3 + .../reservation_service.create_reservation.js | 3 + .../reservation_service.delete_assignment.js | 3 + ...tion_service.delete_capacity_commitment.js | 3 + .../reservation_service.delete_reservation.js | 3 + .../reservation_service.get_bi_reservation.js | 3 + ...rvation_service.get_capacity_commitment.js | 3 + .../v1/reservation_service.get_reservation.js | 3 + .../reservation_service.list_assignments.js | 3 + ...ation_service.list_capacity_commitments.js | 3 + .../reservation_service.list_reservations.js | 3 + ...tion_service.merge_capacity_commitments.js | 3 + .../v1/reservation_service.move_assignment.js | 3 + ...ervation_service.search_all_assignments.js | 3 + .../reservation_service.search_assignments.js | 3 + ...ation_service.split_capacity_commitment.js | 3 + .../reservation_service.update_assignment.js | 3 + ...servation_service.update_bi_reservation.js | 3 + ...tion_service.update_capacity_commitment.js | 3 + .../reservation_service.update_reservation.js | 3 + ....google.cloud.bigquery.reservation.v1.json | 42 ++--- .../src/v1/reservation_service_client.ts | 24 +-- .../test/gapic_reservation_service_v1.ts | 160 +++++++++--------- 24 files changed, 177 insertions(+), 112 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js index 7bff16973d0..2b732b3dbba 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js @@ -23,6 +23,9 @@ function main(parent) { // [START bigqueryreservation_v1_generated_ReservationService_CreateAssignment_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-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js index 80e138385c7..64c0a140024 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js @@ -23,6 +23,9 @@ function main(parent) { // [START bigqueryreservation_v1_generated_ReservationService_CreateCapacityCommitment_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-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js index 9c3e52b1135..c549cf1ff90 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js @@ -23,6 +23,9 @@ function main(parent) { // [START bigqueryreservation_v1_generated_ReservationService_CreateReservation_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-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js index 8041b70dffd..7cc025dca1f 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js @@ -23,6 +23,9 @@ function main(name) { // [START bigqueryreservation_v1_generated_ReservationService_DeleteAssignment_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-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js index 4f5f5ef9149..e4cff5a4d7b 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js @@ -23,6 +23,9 @@ function main(name) { // [START bigqueryreservation_v1_generated_ReservationService_DeleteCapacityCommitment_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-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js index 2b5a58ed8d6..abd52b3b07f 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js @@ -23,6 +23,9 @@ function main(name) { // [START bigqueryreservation_v1_generated_ReservationService_DeleteReservation_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-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js index 22e54a8fe68..8544ae823cd 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js @@ -23,6 +23,9 @@ function main(name) { // [START bigqueryreservation_v1_generated_ReservationService_GetBiReservation_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-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js index e85980e6470..8d06a67bfe0 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js @@ -23,6 +23,9 @@ function main(name) { // [START bigqueryreservation_v1_generated_ReservationService_GetCapacityCommitment_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-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js index 0c53c8e83af..e97f8a2ec7d 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js @@ -23,6 +23,9 @@ function main(name) { // [START bigqueryreservation_v1_generated_ReservationService_GetReservation_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-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js index 3a4a8e4683a..d90a7238eba 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js @@ -23,6 +23,9 @@ function main(parent) { // [START bigqueryreservation_v1_generated_ReservationService_ListAssignments_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-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js index 3244c692013..27757e405ef 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js @@ -23,6 +23,9 @@ function main(parent) { // [START bigqueryreservation_v1_generated_ReservationService_ListCapacityCommitments_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-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js index da742ed916a..135ca136f1b 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js @@ -23,6 +23,9 @@ function main(parent) { // [START bigqueryreservation_v1_generated_ReservationService_ListReservations_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-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js index 79e22d60b40..1f6d5f84696 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js @@ -23,6 +23,9 @@ function main() { // [START bigqueryreservation_v1_generated_ReservationService_MergeCapacityCommitments_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-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js index b336287cc25..4955768ebb4 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js @@ -23,6 +23,9 @@ function main(name) { // [START bigqueryreservation_v1_generated_ReservationService_MoveAssignment_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-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js index 7c82ad7420d..64dbdbfb045 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js @@ -23,6 +23,9 @@ function main(parent) { // [START bigqueryreservation_v1_generated_ReservationService_SearchAllAssignments_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-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js index a10d6d416ca..6ff7affa339 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js @@ -23,6 +23,9 @@ function main(parent) { // [START bigqueryreservation_v1_generated_ReservationService_SearchAssignments_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-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js index 273bce062bb..be3934c919b 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js @@ -23,6 +23,9 @@ function main(name) { // [START bigqueryreservation_v1_generated_ReservationService_SplitCapacityCommitment_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-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js index bf5b485586d..2eb24b71228 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js @@ -23,6 +23,9 @@ function main() { // [START bigqueryreservation_v1_generated_ReservationService_UpdateAssignment_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-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js index f43ccc9c74e..57eef5697cd 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js @@ -23,6 +23,9 @@ function main() { // [START bigqueryreservation_v1_generated_ReservationService_UpdateBiReservation_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-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js index ae6d3777bae..e14a513cf26 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js @@ -23,6 +23,9 @@ function main() { // [START bigqueryreservation_v1_generated_ReservationService_UpdateCapacityCommitment_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-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js index 939b67c84f3..292640e8f09 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js @@ -23,6 +23,9 @@ function main() { // [START bigqueryreservation_v1_generated_ReservationService_UpdateReservation_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-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json b/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json index f81ff764423..d6a719244a9 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], @@ -70,7 +70,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], @@ -118,7 +118,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -158,7 +158,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -198,7 +198,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], @@ -242,7 +242,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 71, "type": "FULL" } ], @@ -294,7 +294,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], @@ -342,7 +342,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -382,7 +382,7 @@ "segments": [ { "start": 25, - "end": 57, + "end": 60, "type": "FULL" } ], @@ -426,7 +426,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], @@ -470,7 +470,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -514,7 +514,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 61, "type": "FULL" } ], @@ -558,7 +558,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -606,7 +606,7 @@ "segments": [ { "start": 25, - "end": 63, + "end": 66, "type": "FULL" } ], @@ -654,7 +654,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -694,7 +694,7 @@ "segments": [ { "start": 25, - "end": 70, + "end": 73, "type": "FULL" } ], @@ -746,7 +746,7 @@ "segments": [ { "start": 25, - "end": 70, + "end": 73, "type": "FULL" } ], @@ -798,7 +798,7 @@ "segments": [ { "start": 25, - "end": 57, + "end": 60, "type": "FULL" } ], @@ -842,7 +842,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], @@ -886,7 +886,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -926,7 +926,7 @@ "segments": [ { "start": 25, - "end": 53, + "end": 56, "type": "FULL" } ], diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index 67cbaf314c9..ed1b80d8cbb 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_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'); /** @@ -320,7 +319,8 @@ export class ReservationServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -2241,7 +2241,7 @@ export class ReservationServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listReservations.createStream( - this.innerApiCalls.listReservations as gax.GaxCall, + this.innerApiCalls.listReservations as GaxCall, request, callSettings ); @@ -2290,7 +2290,7 @@ export class ReservationServiceClient { this.initialize(); return this.descriptors.page.listReservations.asyncIterate( this.innerApiCalls['listReservations'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -2437,7 +2437,7 @@ export class ReservationServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listCapacityCommitments.createStream( - this.innerApiCalls.listCapacityCommitments as gax.GaxCall, + this.innerApiCalls.listCapacityCommitments as GaxCall, request, callSettings ); @@ -2486,7 +2486,7 @@ export class ReservationServiceClient { this.initialize(); return this.descriptors.page.listCapacityCommitments.asyncIterate( this.innerApiCalls['listCapacityCommitments'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -2659,7 +2659,7 @@ export class ReservationServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAssignments.createStream( - this.innerApiCalls.listAssignments as gax.GaxCall, + this.innerApiCalls.listAssignments as GaxCall, request, callSettings ); @@ -2713,7 +2713,7 @@ export class ReservationServiceClient { this.initialize(); return this.descriptors.page.listAssignments.asyncIterate( this.innerApiCalls['listAssignments'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -2908,7 +2908,7 @@ export class ReservationServiceClient { 'DeprecationWarning' ); return this.descriptors.page.searchAssignments.createStream( - this.innerApiCalls.searchAssignments as gax.GaxCall, + this.innerApiCalls.searchAssignments as GaxCall, request, callSettings ); @@ -2972,7 +2972,7 @@ export class ReservationServiceClient { ); return this.descriptors.page.searchAssignments.asyncIterate( this.innerApiCalls['searchAssignments'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -3152,7 +3152,7 @@ export class ReservationServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.searchAllAssignments.createStream( - this.innerApiCalls.searchAllAssignments as gax.GaxCall, + this.innerApiCalls.searchAllAssignments as GaxCall, request, callSettings ); @@ -3210,7 +3210,7 @@ export class ReservationServiceClient { this.initialize(); return this.descriptors.page.searchAllAssignments.asyncIterate( this.innerApiCalls['searchAllAssignments'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts index c4b66a79743..f2ab622b0e5 100644 --- a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts +++ b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts @@ -113,101 +113,103 @@ function stubAsyncIterationCall( } describe('v1.ReservationServiceClient', () => { - it('has servicePath', () => { - const servicePath = - reservationserviceModule.v1.ReservationServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - reservationserviceModule.v1.ReservationServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = reservationserviceModule.v1.ReservationServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new reservationserviceModule.v1.ReservationServiceClient(); - assert(client); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + reservationserviceModule.v1.ReservationServiceClient.servicePath; + assert(servicePath); + }); - it('should create a client with gRPC fallback', () => { - const client = new reservationserviceModule.v1.ReservationServiceClient({ - fallback: true, + it('has apiEndpoint', () => { + const apiEndpoint = + reservationserviceModule.v1.ReservationServiceClient.apiEndpoint; + assert(apiEndpoint); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new reservationserviceModule.v1.ReservationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has port', () => { + const port = reservationserviceModule.v1.ReservationServiceClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert.strictEqual(client.reservationServiceStub, undefined); - await client.initialize(); - assert(client.reservationServiceStub); - }); - it('has close method for the initialized client', done => { - const client = new reservationserviceModule.v1.ReservationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new reservationserviceModule.v1.ReservationServiceClient(); + assert(client); }); - client.initialize(); - assert(client.reservationServiceStub); - client.close().then(() => { - done(); + + it('should create a client with gRPC fallback', () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + fallback: true, + }); + assert(client); }); - }); - it('has close method for the non-initialized client', done => { - const client = new reservationserviceModule.v1.ReservationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has initialize method and supports deferred initialization', async () => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.reservationServiceStub, undefined); + await client.initialize(); + assert(client.reservationServiceStub); }); - assert.strictEqual(client.reservationServiceStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the initialized client', done => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.reservationServiceStub); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new reservationserviceModule.v1.ReservationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = new reservationserviceModule.v1.ReservationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.reservationServiceStub, 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 reservationserviceModule.v1.ReservationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new reservationserviceModule.v1.ReservationServiceClient({ + 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 reservationserviceModule.v1.ReservationServiceClient({ + 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('createReservation', () => { From 0063894dd627cd81a28ea10a1176a161a263fff2 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 07:36:25 +0000 Subject: [PATCH 092/105] fix: change import long to require (#166) Source-Link: https://github.com/googleapis/synthtool/commit/d229a1258999f599a90a9b674a1c5541e00db588 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:74ab2b3c71ef27e6d8b69b1d0a0c9d31447777b79ac3cd4be82c265b45f37e5e --- .../protos/protos.d.ts | 555 ++- .../protos/protos.js | 3235 ++++++++++++----- .../protos/protos.json | 24 + 3 files changed, 2869 insertions(+), 945 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts b/packages/google-cloud-bigquery-reservation/protos/protos.d.ts index ce52f2f29e4..212fa3c0432 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-reservation/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 { @@ -347,147 +347,147 @@ export namespace google { namespace ReservationService { /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#createReservation}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|createReservation}. * @param error Error, if any * @param [response] Reservation */ type CreateReservationCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.Reservation) => void; /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#listReservations}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|listReservations}. * @param error Error, if any * @param [response] ListReservationsResponse */ type ListReservationsCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.ListReservationsResponse) => void; /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#getReservation}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|getReservation}. * @param error Error, if any * @param [response] Reservation */ type GetReservationCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.Reservation) => void; /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#deleteReservation}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|deleteReservation}. * @param error Error, if any * @param [response] Empty */ type DeleteReservationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#updateReservation}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|updateReservation}. * @param error Error, if any * @param [response] Reservation */ type UpdateReservationCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.Reservation) => void; /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#createCapacityCommitment}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|createCapacityCommitment}. * @param error Error, if any * @param [response] CapacityCommitment */ type CreateCapacityCommitmentCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.CapacityCommitment) => void; /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#listCapacityCommitments}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|listCapacityCommitments}. * @param error Error, if any * @param [response] ListCapacityCommitmentsResponse */ type ListCapacityCommitmentsCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse) => void; /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#getCapacityCommitment}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|getCapacityCommitment}. * @param error Error, if any * @param [response] CapacityCommitment */ type GetCapacityCommitmentCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.CapacityCommitment) => void; /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#deleteCapacityCommitment}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|deleteCapacityCommitment}. * @param error Error, if any * @param [response] Empty */ type DeleteCapacityCommitmentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#updateCapacityCommitment}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|updateCapacityCommitment}. * @param error Error, if any * @param [response] CapacityCommitment */ type UpdateCapacityCommitmentCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.CapacityCommitment) => void; /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#splitCapacityCommitment}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|splitCapacityCommitment}. * @param error Error, if any * @param [response] SplitCapacityCommitmentResponse */ type SplitCapacityCommitmentCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse) => void; /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#mergeCapacityCommitments}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|mergeCapacityCommitments}. * @param error Error, if any * @param [response] CapacityCommitment */ type MergeCapacityCommitmentsCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.CapacityCommitment) => void; /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#createAssignment}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|createAssignment}. * @param error Error, if any * @param [response] Assignment */ type CreateAssignmentCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.Assignment) => void; /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#listAssignments}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|listAssignments}. * @param error Error, if any * @param [response] ListAssignmentsResponse */ type ListAssignmentsCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.ListAssignmentsResponse) => void; /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#deleteAssignment}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|deleteAssignment}. * @param error Error, if any * @param [response] Empty */ type DeleteAssignmentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#searchAssignments}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|searchAssignments}. * @param error Error, if any * @param [response] SearchAssignmentsResponse */ type SearchAssignmentsCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse) => void; /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#searchAllAssignments}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|searchAllAssignments}. * @param error Error, if any * @param [response] SearchAllAssignmentsResponse */ type SearchAllAssignmentsCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse) => void; /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#moveAssignment}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|moveAssignment}. * @param error Error, if any * @param [response] Assignment */ type MoveAssignmentCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.Assignment) => void; /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#updateAssignment}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|updateAssignment}. * @param error Error, if any * @param [response] Assignment */ type UpdateAssignmentCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.Assignment) => void; /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#getBiReservation}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|getBiReservation}. * @param error Error, if any * @param [response] BiReservation */ type GetBiReservationCallback = (error: (Error|null), response?: google.cloud.bigquery.reservation.v1.BiReservation) => void; /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#updateBiReservation}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|updateBiReservation}. * @param error Error, if any * @param [response] BiReservation */ @@ -618,6 +618,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Reservation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CapacityCommitment. */ @@ -756,6 +763,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CapacityCommitment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace CapacityCommitment { @@ -878,6 +892,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateReservationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListReservationsRequest. */ @@ -980,6 +1001,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListReservationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListReservationsResponse. */ @@ -1076,6 +1104,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListReservationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetReservationRequest. */ @@ -1166,6 +1201,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetReservationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteReservationRequest. */ @@ -1256,6 +1298,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteReservationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateReservationRequest. */ @@ -1352,6 +1401,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateReservationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CreateCapacityCommitmentRequest. */ @@ -1460,6 +1516,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCapacityCommitmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListCapacityCommitmentsRequest. */ @@ -1562,6 +1625,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCapacityCommitmentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListCapacityCommitmentsResponse. */ @@ -1658,6 +1728,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCapacityCommitmentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetCapacityCommitmentRequest. */ @@ -1748,6 +1825,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCapacityCommitmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteCapacityCommitmentRequest. */ @@ -1844,6 +1928,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteCapacityCommitmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateCapacityCommitmentRequest. */ @@ -1940,6 +2031,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCapacityCommitmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SplitCapacityCommitmentRequest. */ @@ -2036,6 +2134,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SplitCapacityCommitmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SplitCapacityCommitmentResponse. */ @@ -2132,6 +2237,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SplitCapacityCommitmentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a MergeCapacityCommitmentsRequest. */ @@ -2228,6 +2340,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MergeCapacityCommitmentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Assignment. */ @@ -2336,6 +2455,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Assignment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Assignment { @@ -2456,6 +2582,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAssignmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListAssignmentsRequest. */ @@ -2558,6 +2691,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssignmentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListAssignmentsResponse. */ @@ -2654,6 +2794,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssignmentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteAssignmentRequest. */ @@ -2744,6 +2891,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAssignmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SearchAssignmentsRequest. */ @@ -2852,6 +3006,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAssignmentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SearchAllAssignmentsRequest. */ @@ -2960,6 +3121,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAllAssignmentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SearchAssignmentsResponse. */ @@ -3056,6 +3224,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAssignmentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SearchAllAssignmentsResponse. */ @@ -3152,6 +3327,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAllAssignmentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a MoveAssignmentRequest. */ @@ -3248,6 +3430,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MoveAssignmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateAssignmentRequest. */ @@ -3344,6 +3533,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAssignmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a TableReference. */ @@ -3446,6 +3642,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BiReservation. */ @@ -3554,6 +3757,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BiReservation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetBiReservationRequest. */ @@ -3644,6 +3854,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBiReservationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateBiReservationRequest. */ @@ -3740,6 +3957,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBiReservationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } @@ -3843,6 +4067,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. */ @@ -3990,6 +4221,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. */ @@ -4086,6 +4324,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. */ @@ -4224,6 +4469,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 { @@ -4336,6 +4588,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; } } @@ -4430,6 +4689,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. */ @@ -4470,6 +4736,9 @@ export namespace google { /** FileDescriptorProto syntax */ syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); } /** Represents a FileDescriptorProto. */ @@ -4517,6 +4786,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 @@ -4586,6 +4858,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. */ @@ -4730,6 +5009,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 { @@ -4834,6 +5120,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. */ @@ -4930,6 +5223,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; } } @@ -5021,6 +5321,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. */ @@ -5171,6 +5478,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 { @@ -5299,6 +5613,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. */ @@ -5413,6 +5734,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 { @@ -5511,6 +5839,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; } } @@ -5614,6 +5949,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. */ @@ -5716,6 +6058,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a MethodDescriptorProto. */ @@ -5836,6 +6185,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. */ @@ -6049,6 +6405,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 { @@ -6176,6 +6539,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. */ @@ -6193,6 +6563,9 @@ export namespace google { /** FieldOptions lazy */ lazy?: (boolean|null); + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + /** FieldOptions deprecated */ deprecated?: (boolean|null); @@ -6230,6 +6603,9 @@ export namespace google { /** FieldOptions lazy. */ public lazy: boolean; + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + /** FieldOptions deprecated. */ public deprecated: boolean; @@ -6308,6 +6684,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 { @@ -6415,6 +6798,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. */ @@ -6517,6 +6907,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. */ @@ -6613,6 +7010,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. */ @@ -6715,6 +7119,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. */ @@ -6823,6 +7234,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 { @@ -6959,6 +7377,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 { @@ -7057,6 +7482,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; } } @@ -7148,6 +7580,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 { @@ -7264,6 +7703,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; } } @@ -7355,6 +7801,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 { @@ -7373,6 +7826,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. */ @@ -7396,6 +7852,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 @@ -7465,6 +7924,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 + } } } @@ -7550,6 +8026,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a FieldMask. */ @@ -7640,6 +8123,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Timestamp. */ @@ -7736,6 +8226,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Any. */ @@ -7832,6 +8329,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; } } @@ -7938,6 +8442,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.js b/packages/google-cloud-bigquery-reservation/protos/protos.js index 30fcd436fee..662c5557121 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.js +++ b/packages/google-cloud-bigquery-reservation/protos/protos.js @@ -108,7 +108,7 @@ }; /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#createReservation}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|createReservation}. * @memberof google.cloud.bigquery.reservation.v1.ReservationService * @typedef CreateReservationCallback * @type {function} @@ -141,7 +141,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#listReservations}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|listReservations}. * @memberof google.cloud.bigquery.reservation.v1.ReservationService * @typedef ListReservationsCallback * @type {function} @@ -174,7 +174,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#getReservation}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|getReservation}. * @memberof google.cloud.bigquery.reservation.v1.ReservationService * @typedef GetReservationCallback * @type {function} @@ -207,7 +207,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#deleteReservation}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|deleteReservation}. * @memberof google.cloud.bigquery.reservation.v1.ReservationService * @typedef DeleteReservationCallback * @type {function} @@ -240,7 +240,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#updateReservation}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|updateReservation}. * @memberof google.cloud.bigquery.reservation.v1.ReservationService * @typedef UpdateReservationCallback * @type {function} @@ -273,7 +273,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#createCapacityCommitment}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|createCapacityCommitment}. * @memberof google.cloud.bigquery.reservation.v1.ReservationService * @typedef CreateCapacityCommitmentCallback * @type {function} @@ -306,7 +306,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#listCapacityCommitments}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|listCapacityCommitments}. * @memberof google.cloud.bigquery.reservation.v1.ReservationService * @typedef ListCapacityCommitmentsCallback * @type {function} @@ -339,7 +339,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#getCapacityCommitment}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|getCapacityCommitment}. * @memberof google.cloud.bigquery.reservation.v1.ReservationService * @typedef GetCapacityCommitmentCallback * @type {function} @@ -372,7 +372,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#deleteCapacityCommitment}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|deleteCapacityCommitment}. * @memberof google.cloud.bigquery.reservation.v1.ReservationService * @typedef DeleteCapacityCommitmentCallback * @type {function} @@ -405,7 +405,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#updateCapacityCommitment}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|updateCapacityCommitment}. * @memberof google.cloud.bigquery.reservation.v1.ReservationService * @typedef UpdateCapacityCommitmentCallback * @type {function} @@ -438,7 +438,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#splitCapacityCommitment}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|splitCapacityCommitment}. * @memberof google.cloud.bigquery.reservation.v1.ReservationService * @typedef SplitCapacityCommitmentCallback * @type {function} @@ -471,7 +471,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#mergeCapacityCommitments}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|mergeCapacityCommitments}. * @memberof google.cloud.bigquery.reservation.v1.ReservationService * @typedef MergeCapacityCommitmentsCallback * @type {function} @@ -504,7 +504,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#createAssignment}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|createAssignment}. * @memberof google.cloud.bigquery.reservation.v1.ReservationService * @typedef CreateAssignmentCallback * @type {function} @@ -537,7 +537,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#listAssignments}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|listAssignments}. * @memberof google.cloud.bigquery.reservation.v1.ReservationService * @typedef ListAssignmentsCallback * @type {function} @@ -570,7 +570,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#deleteAssignment}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|deleteAssignment}. * @memberof google.cloud.bigquery.reservation.v1.ReservationService * @typedef DeleteAssignmentCallback * @type {function} @@ -603,7 +603,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#searchAssignments}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|searchAssignments}. * @memberof google.cloud.bigquery.reservation.v1.ReservationService * @typedef SearchAssignmentsCallback * @type {function} @@ -636,7 +636,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#searchAllAssignments}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|searchAllAssignments}. * @memberof google.cloud.bigquery.reservation.v1.ReservationService * @typedef SearchAllAssignmentsCallback * @type {function} @@ -669,7 +669,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#moveAssignment}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|moveAssignment}. * @memberof google.cloud.bigquery.reservation.v1.ReservationService * @typedef MoveAssignmentCallback * @type {function} @@ -702,7 +702,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#updateAssignment}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|updateAssignment}. * @memberof google.cloud.bigquery.reservation.v1.ReservationService * @typedef UpdateAssignmentCallback * @type {function} @@ -735,7 +735,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#getBiReservation}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|getBiReservation}. * @memberof google.cloud.bigquery.reservation.v1.ReservationService * @typedef GetBiReservationCallback * @type {function} @@ -768,7 +768,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService#updateBiReservation}. + * Callback as used by {@link google.cloud.bigquery.reservation.v1.ReservationService|updateBiReservation}. * @memberof google.cloud.bigquery.reservation.v1.ReservationService * @typedef UpdateBiReservationCallback * @type {function} @@ -961,27 +961,34 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.slotCapacity = reader.int64(); - break; - case 4: - message.ignoreIdleSlots = reader.bool(); - break; - case 16: - message.concurrency = reader.int64(); - break; - case 8: - message.creationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 9: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 14: - message.multiRegionAuxiliary = reader.bool(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.slotCapacity = reader.int64(); + break; + } + case 4: { + message.ignoreIdleSlots = reader.bool(); + break; + } + case 16: { + message.concurrency = reader.int64(); + break; + } + case 8: { + message.creationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + message.multiRegionAuxiliary = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -1158,6 +1165,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Reservation + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Reservation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.Reservation"; + }; + return Reservation; })(); @@ -1341,33 +1363,42 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.slotCount = reader.int64(); - break; - case 3: - message.plan = reader.int32(); - break; - case 4: - message.state = reader.int32(); - break; - case 9: - message.commitmentStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.commitmentEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 7: - message.failureStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - case 8: - message.renewalPlan = reader.int32(); - break; - case 10: - message.multiRegionAuxiliary = reader.bool(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.slotCount = reader.int64(); + break; + } + case 3: { + message.plan = reader.int32(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 9: { + message.commitmentStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.commitmentEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.failureStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 8: { + message.renewalPlan = reader.int32(); + break; + } + case 10: { + message.multiRegionAuxiliary = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -1630,6 +1661,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CapacityCommitment + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.CapacityCommitment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CapacityCommitment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.CapacityCommitment"; + }; + /** * CommitmentPlan enum. * @name google.cloud.bigquery.reservation.v1.CapacityCommitment.CommitmentPlan @@ -1785,15 +1831,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.reservationId = reader.string(); - break; - case 3: - message.reservation = $root.google.cloud.bigquery.reservation.v1.Reservation.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.reservationId = reader.string(); + break; + } + case 3: { + message.reservation = $root.google.cloud.bigquery.reservation.v1.Reservation.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -1905,6 +1954,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateReservationRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.CreateReservationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateReservationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.CreateReservationRequest"; + }; + return CreateReservationRequest; })(); @@ -2022,15 +2086,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -2137,6 +2204,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListReservationsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListReservationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.ListReservationsRequest"; + }; + return ListReservationsRequest; })(); @@ -2245,14 +2327,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.reservations && message.reservations.length)) - message.reservations = []; - message.reservations.push($root.google.cloud.bigquery.reservation.v1.Reservation.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.reservations && message.reservations.length)) + message.reservations = []; + message.reservations.push($root.google.cloud.bigquery.reservation.v1.Reservation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -2368,6 +2452,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListReservationsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.ListReservationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListReservationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.ListReservationsResponse"; + }; + return ListReservationsResponse; })(); @@ -2463,9 +2562,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; @@ -2555,6 +2655,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetReservationRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.GetReservationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetReservationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.GetReservationRequest"; + }; + return GetReservationRequest; })(); @@ -2650,9 +2765,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; @@ -2742,6 +2858,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteReservationRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.DeleteReservationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteReservationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.DeleteReservationRequest"; + }; + return DeleteReservationRequest; })(); @@ -2848,12 +2979,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.reservation = $root.google.cloud.bigquery.reservation.v1.Reservation.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.reservation = $root.google.cloud.bigquery.reservation.v1.Reservation.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -2962,6 +3095,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateReservationRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.UpdateReservationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateReservationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.UpdateReservationRequest"; + }; + return UpdateReservationRequest; })(); @@ -3090,18 +3238,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.capacityCommitment = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.decode(reader, reader.uint32()); - break; - case 4: - message.enforceSingleAdminProjectPerOrg = reader.bool(); - break; - case 5: - message.capacityCommitmentId = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.capacityCommitment = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.decode(reader, reader.uint32()); + break; + } + case 4: { + message.enforceSingleAdminProjectPerOrg = reader.bool(); + break; + } + case 5: { + message.capacityCommitmentId = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -3221,6 +3373,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateCapacityCommitmentRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCapacityCommitmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest"; + }; + return CreateCapacityCommitmentRequest; })(); @@ -3338,15 +3505,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -3453,6 +3623,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListCapacityCommitmentsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCapacityCommitmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest"; + }; + return ListCapacityCommitmentsRequest; })(); @@ -3561,14 +3746,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.capacityCommitments && message.capacityCommitments.length)) - message.capacityCommitments = []; - message.capacityCommitments.push($root.google.cloud.bigquery.reservation.v1.CapacityCommitment.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.capacityCommitments && message.capacityCommitments.length)) + message.capacityCommitments = []; + message.capacityCommitments.push($root.google.cloud.bigquery.reservation.v1.CapacityCommitment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -3684,6 +3871,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListCapacityCommitmentsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCapacityCommitmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsResponse"; + }; + return ListCapacityCommitmentsResponse; })(); @@ -3779,9 +3981,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; @@ -3871,6 +4074,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetCapacityCommitmentRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCapacityCommitmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest"; + }; + return GetCapacityCommitmentRequest; })(); @@ -3977,12 +4195,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 3: - message.force = reader.bool(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.force = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -4081,6 +4301,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteCapacityCommitmentRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCapacityCommitmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest"; + }; + return DeleteCapacityCommitmentRequest; })(); @@ -4187,12 +4422,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.capacityCommitment = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.capacityCommitment = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -4301,6 +4538,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateCapacityCommitmentRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCapacityCommitmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest"; + }; + return UpdateCapacityCommitmentRequest; })(); @@ -4407,12 +4659,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.slotCount = reader.int64(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.slotCount = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -4525,6 +4779,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SplitCapacityCommitmentRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SplitCapacityCommitmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest"; + }; + return SplitCapacityCommitmentRequest; })(); @@ -4631,12 +4900,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.first = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.decode(reader, reader.uint32()); - break; - case 2: - message.second = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.decode(reader, reader.uint32()); - break; + case 1: { + message.first = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.second = $root.google.cloud.bigquery.reservation.v1.CapacityCommitment.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -4745,6 +5016,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SplitCapacityCommitmentResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SplitCapacityCommitmentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse"; + }; + return SplitCapacityCommitmentResponse; })(); @@ -4853,14 +5139,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - if (!(message.capacityCommitmentIds && message.capacityCommitmentIds.length)) - message.capacityCommitmentIds = []; - message.capacityCommitmentIds.push(reader.string()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.capacityCommitmentIds && message.capacityCommitmentIds.length)) + message.capacityCommitmentIds = []; + message.capacityCommitmentIds.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -4971,6 +5259,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for MergeCapacityCommitmentsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MergeCapacityCommitmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest"; + }; + return MergeCapacityCommitmentsRequest; })(); @@ -5099,18 +5402,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 4: - message.assignee = reader.string(); - break; - case 3: - message.jobType = reader.int32(); - break; - case 6: - message.state = reader.int32(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 4: { + message.assignee = reader.string(); + break; + } + case 3: { + message.jobType = reader.int32(); + break; + } + case 6: { + message.state = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -5266,6 +5573,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Assignment + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Assignment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.Assignment"; + }; + /** * JobType enum. * @name google.cloud.bigquery.reservation.v1.Assignment.JobType @@ -5417,15 +5739,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.assignment = $root.google.cloud.bigquery.reservation.v1.Assignment.decode(reader, reader.uint32()); - break; - case 4: - message.assignmentId = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.assignment = $root.google.cloud.bigquery.reservation.v1.Assignment.decode(reader, reader.uint32()); + break; + } + case 4: { + message.assignmentId = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -5537,6 +5862,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateAssignmentRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.CreateAssignmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAssignmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.CreateAssignmentRequest"; + }; + return CreateAssignmentRequest; })(); @@ -5654,15 +5994,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -5769,6 +6112,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListAssignmentsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssignmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.ListAssignmentsRequest"; + }; + return ListAssignmentsRequest; })(); @@ -5877,14 +6235,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.assignments && message.assignments.length)) - message.assignments = []; - message.assignments.push($root.google.cloud.bigquery.reservation.v1.Assignment.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.assignments && message.assignments.length)) + message.assignments = []; + message.assignments.push($root.google.cloud.bigquery.reservation.v1.Assignment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -6000,11 +6360,26 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListAssignmentsResponse; - })(); - - v1.DeleteAssignmentRequest = (function() { - + /** + * Gets the default type url for ListAssignmentsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.ListAssignmentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssignmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.ListAssignmentsResponse"; + }; + + return ListAssignmentsResponse; + })(); + + v1.DeleteAssignmentRequest = (function() { + /** * Properties of a DeleteAssignmentRequest. * @memberof google.cloud.bigquery.reservation.v1 @@ -6095,9 +6470,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; @@ -6187,6 +6563,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteAssignmentRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAssignmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest"; + }; + return DeleteAssignmentRequest; })(); @@ -6315,18 +6706,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = 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.parent = 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; @@ -6441,6 +6836,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SearchAssignmentsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAssignmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest"; + }; + return SearchAssignmentsRequest; })(); @@ -6569,18 +6979,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = 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.parent = 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; @@ -6695,6 +7109,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SearchAllAssignmentsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAllAssignmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest"; + }; + return SearchAllAssignmentsRequest; })(); @@ -6803,14 +7232,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.assignments && message.assignments.length)) - message.assignments = []; - message.assignments.push($root.google.cloud.bigquery.reservation.v1.Assignment.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.assignments && message.assignments.length)) + message.assignments = []; + message.assignments.push($root.google.cloud.bigquery.reservation.v1.Assignment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -6926,6 +7357,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SearchAssignmentsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAssignmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse"; + }; + return SearchAssignmentsResponse; })(); @@ -7034,14 +7480,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.assignments && message.assignments.length)) - message.assignments = []; - message.assignments.push($root.google.cloud.bigquery.reservation.v1.Assignment.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.assignments && message.assignments.length)) + message.assignments = []; + message.assignments.push($root.google.cloud.bigquery.reservation.v1.Assignment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -7157,6 +7605,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SearchAllAssignmentsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAllAssignmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.SearchAllAssignmentsResponse"; + }; + return SearchAllAssignmentsResponse; })(); @@ -7263,12 +7726,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 3: - message.destinationId = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.destinationId = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -7367,6 +7832,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for MoveAssignmentRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.MoveAssignmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MoveAssignmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.MoveAssignmentRequest"; + }; + return MoveAssignmentRequest; })(); @@ -7473,12 +7953,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.assignment = $root.google.cloud.bigquery.reservation.v1.Assignment.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.assignment = $root.google.cloud.bigquery.reservation.v1.Assignment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -7587,6 +8069,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateAssignmentRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAssignmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest"; + }; + return UpdateAssignmentRequest; })(); @@ -7704,15 +8201,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.projectId = reader.string(); - break; - case 2: - message.datasetId = reader.string(); - break; - case 3: - message.tableId = reader.string(); - break; + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.datasetId = reader.string(); + break; + } + case 3: { + message.tableId = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -7819,6 +8319,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TableReference + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.TableReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.TableReference"; + }; + return TableReference; })(); @@ -7949,20 +8464,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 3: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 4: - message.size = reader.int64(); - break; - case 5: - if (!(message.preferredTables && message.preferredTables.length)) - message.preferredTables = []; - message.preferredTables.push($root.google.cloud.bigquery.reservation.v1.TableReference.decode(reader, reader.uint32())); - break; + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.size = reader.int64(); + break; + } + case 5: { + if (!(message.preferredTables && message.preferredTables.length)) + message.preferredTables = []; + message.preferredTables.push($root.google.cloud.bigquery.reservation.v1.TableReference.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -8114,6 +8633,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BiReservation + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.BiReservation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BiReservation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.BiReservation"; + }; + return BiReservation; })(); @@ -8209,9 +8743,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; @@ -8301,6 +8836,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetBiReservationRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.GetBiReservationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBiReservationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.GetBiReservationRequest"; + }; + return GetBiReservationRequest; })(); @@ -8407,12 +8957,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.biReservation = $root.google.cloud.bigquery.reservation.v1.BiReservation.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.biReservation = $root.google.cloud.bigquery.reservation.v1.BiReservation.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -8521,6 +9073,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateBiReservationRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBiReservationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest"; + }; + return UpdateBiReservationRequest; })(); @@ -8650,14 +9217,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; @@ -8773,6 +9342,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; })(); @@ -8983,38 +9567,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; @@ -9236,6 +9830,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; })(); @@ -9342,12 +9951,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; @@ -9446,6 +10057,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; })(); @@ -9640,36 +10266,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; @@ -9868,10 +10501,25 @@ }; /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {number} - * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * 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 + * @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 */ @@ -10003,12 +10651,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; @@ -10107,6 +10757,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; })(); @@ -10216,11 +10881,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; @@ -10327,6 +10993,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; })(); @@ -10348,6 +11029,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 */ /** @@ -10468,6 +11150,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 @@ -10523,6 +11213,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; }; @@ -10557,66 +11249,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; @@ -10728,6 +11436,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; }; @@ -10820,6 +11531,8 @@ } if (object.syntax != null) message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); return message; }; @@ -10851,6 +11564,7 @@ object.options = null; object.sourceCodeInfo = null; object.syntax = ""; + object.edition = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -10897,6 +11611,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; }; @@ -10911,6 +11627,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; })(); @@ -11121,52 +11852,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; @@ -11467,6 +12208,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() { /** @@ -11581,15 +12337,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; @@ -11701,6 +12460,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; })(); @@ -11807,12 +12581,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; @@ -11911,6 +12687,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; })(); @@ -12011,11 +12802,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; @@ -12122,6 +12914,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; })(); @@ -12327,39 +13134,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; @@ -12646,6 +13464,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 @@ -12814,14 +13647,16 @@ 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); + 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; } } @@ -12923,6 +13758,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; })(); @@ -13068,27 +13918,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; @@ -13264,6 +14119,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() { /** @@ -13367,12 +14237,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; @@ -13471,6 +14343,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; })(); @@ -13591,15 +14478,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; @@ -13711,6 +14601,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; })(); @@ -13830,17 +14735,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; @@ -13970,6 +14878,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; })(); @@ -14120,24 +15043,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; @@ -14273,6 +15202,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; })(); @@ -14603,76 +15547,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; @@ -14985,6 +15951,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 @@ -15153,26 +16134,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; @@ -15326,6 +16313,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; })(); @@ -15339,6 +16341,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 @@ -15395,6 +16398,14 @@ */ FieldOptions.prototype.lazy = false; + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + /** * FieldOptions deprecated. * @member {boolean} deprecated @@ -15471,6 +16482,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(); @@ -15516,42 +16529,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; @@ -15611,6 +16637,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"; @@ -15696,6 +16725,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) @@ -15783,6 +16814,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")) @@ -15797,6 +16829,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) @@ -15823,6 +16857,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 @@ -15952,11 +17001,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; @@ -16063,6 +17113,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; })(); @@ -16182,17 +17247,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; @@ -16317,6 +17385,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; })(); @@ -16425,14 +17508,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; @@ -16548,6 +17633,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; })(); @@ -16678,20 +17778,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; @@ -16817,11 +17921,26 @@ * Converts this ServiceOptions to JSON. * @function toJSON * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + 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.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; }; return ServiceOptions; @@ -16967,25 +18086,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotencyLevel = reader.int32(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 72295728: - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - case 1051: - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -17162,6 +18286,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 @@ -17341,29 +18480,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; @@ -17476,7 +18622,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); @@ -17557,6 +18703,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() { /** @@ -17658,12 +18819,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; @@ -17764,6 +18927,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; })(); @@ -17864,11 +19042,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; @@ -17975,6 +19154,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() { /** @@ -18123,37 +19317,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; @@ -18314,6 +19513,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; })(); @@ -18414,11 +19628,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; @@ -18525,6 +19740,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() { /** @@ -18535,6 +19765,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 */ /** @@ -18585,6 +19816,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 @@ -18621,6 +19860,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; }; @@ -18655,25 +19896,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; @@ -18725,6 +19974,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; }; @@ -18753,6 +20011,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; }; @@ -18775,6 +20047,7 @@ object.sourceFile = ""; object.begin = 0; object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; } if (message.path && message.path.length) { object.path = []; @@ -18787,6 +20060,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; }; @@ -18801,6 +20076,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; })(); @@ -18964,6 +20270,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; })(); @@ -19061,11 +20382,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; @@ -19167,6 +20489,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; })(); @@ -19273,12 +20610,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; @@ -19391,6 +20730,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; })(); @@ -19497,12 +20851,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; @@ -19564,7 +20920,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; }; @@ -19610,6 +20966,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; })(); @@ -19741,17 +21112,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; @@ -19876,6 +21250,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + return Status; })(); diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.json b/packages/google-cloud-bigquery-reservation/protos/protos.json index dafddf1353d..f2d4d04d142 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.json +++ b/packages/google-cloud-bigquery-reservation/protos/protos.json @@ -1363,6 +1363,10 @@ "syntax": { "type": "string", "id": 12 + }, + "edition": { + "type": "string", + "id": 13 } } }, @@ -1891,6 +1895,13 @@ "default": false } }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, "deprecated": { "type": "bool", "id": 3, @@ -2183,6 +2194,19 @@ "end": { "type": "int32", "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } } } } From 81565d54c764ffd48d6bc2c415dfc54eabd1e138 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 27 Aug 2022 04:56:16 +0000 Subject: [PATCH 093/105] fix: do not import the whole google-gax from proto JS (#1553) (#168) 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-bigquery-reservation/package.json | 2 +- packages/google-cloud-bigquery-reservation/protos/protos.d.ts | 2 +- packages/google-cloud-bigquery-reservation/protos/protos.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 7ee1676c1a6..61ef68ef636 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -39,7 +39,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^3.0.1" + "google-gax": "^3.3.0" }, "devDependencies": { "@types/mocha": "^9.0.0", diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts b/packages/google-cloud-bigquery-reservation/protos/protos.d.ts index 212fa3c0432..ddc95a1df0c 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-reservation/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-bigquery-reservation/protos/protos.js b/packages/google-cloud-bigquery-reservation/protos/protos.js index 662c5557121..8f49b952d83 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.js +++ b/packages/google-cloud-bigquery-reservation/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 32cd93988854c008e8705cfffcd040e4a67dd9fd Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 1 Sep 2022 20:50:13 +0000 Subject: [PATCH 094/105] fix: allow passing gax instance to client constructor (#169) - [ ] 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/reservation_service_client.ts | 89 +++++++++++-------- 1 file changed, 51 insertions(+), 38 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index ed1b80d8cbb..c94458df043 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_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 './reservation_service_client_config.json'; - const version = require('../../../package.json').version; /** @@ -110,8 +108,18 @@ export class ReservationServiceClient { * 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 ReservationServiceClient({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 ReservationServiceClient; const servicePath = @@ -131,8 +139,13 @@ export class ReservationServiceClient { opts['scopes'] = staticMembers.scopes; } + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); @@ -241,7 +254,7 @@ export class ReservationServiceClient { 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; } /** @@ -483,7 +496,7 @@ export class ReservationServiceClient { 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(); @@ -581,7 +594,7 @@ export class ReservationServiceClient { 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(); @@ -681,7 +694,7 @@ export class ReservationServiceClient { 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(); @@ -780,7 +793,7 @@ export class ReservationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'reservation.name': request.reservation!.name || '', }); this.initialize(); @@ -889,7 +902,7 @@ export class ReservationServiceClient { 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(); @@ -991,7 +1004,7 @@ export class ReservationServiceClient { 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(); @@ -1095,7 +1108,7 @@ export class ReservationServiceClient { 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(); @@ -1204,7 +1217,7 @@ export class ReservationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'capacity_commitment.name': request.capacityCommitment!.name || '', }); this.initialize(); @@ -1315,7 +1328,7 @@ export class ReservationServiceClient { 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(); @@ -1429,7 +1442,7 @@ export class ReservationServiceClient { 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(); @@ -1572,7 +1585,7 @@ export class ReservationServiceClient { 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(); @@ -1684,7 +1697,7 @@ export class ReservationServiceClient { 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(); @@ -1790,7 +1803,7 @@ export class ReservationServiceClient { 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(); @@ -1891,7 +1904,7 @@ export class ReservationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'assignment.name': request.assignment!.name || '', }); this.initialize(); @@ -1989,7 +2002,7 @@ export class ReservationServiceClient { 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(); @@ -2095,7 +2108,7 @@ export class ReservationServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'bi_reservation.name': request.biReservation!.name || '', }); this.initialize(); @@ -2195,7 +2208,7 @@ export class ReservationServiceClient { 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(); @@ -2234,7 +2247,7 @@ export class ReservationServiceClient { 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['listReservations']; @@ -2282,7 +2295,7 @@ export class ReservationServiceClient { 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['listReservations']; @@ -2387,7 +2400,7 @@ export class ReservationServiceClient { 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(); @@ -2430,7 +2443,7 @@ export class ReservationServiceClient { 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['listCapacityCommitments']; @@ -2478,7 +2491,7 @@ export class ReservationServiceClient { 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['listCapacityCommitments']; @@ -2608,7 +2621,7 @@ export class ReservationServiceClient { 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(); @@ -2652,7 +2665,7 @@ export class ReservationServiceClient { 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['listAssignments']; @@ -2705,7 +2718,7 @@ export class ReservationServiceClient { 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['listAssignments']; @@ -2842,7 +2855,7 @@ export class ReservationServiceClient { 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(); @@ -2896,7 +2909,7 @@ export class ReservationServiceClient { 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['searchAssignments']; @@ -2959,7 +2972,7 @@ export class ReservationServiceClient { 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['searchAssignments']; @@ -3097,7 +3110,7 @@ export class ReservationServiceClient { 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(); @@ -3145,7 +3158,7 @@ export class ReservationServiceClient { 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['searchAllAssignments']; @@ -3202,7 +3215,7 @@ export class ReservationServiceClient { 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['searchAllAssignments']; From d68b6883be994d1e35b1ec308213fa344e35cd35 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 7 Sep 2022 17:50:58 -0400 Subject: [PATCH 095/105] chore(main): release 2.0.1 (#162) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 2.0.1 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- .../google-cloud-bigquery-reservation/CHANGELOG.md | 12 ++++++++++++ .../google-cloud-bigquery-reservation/package.json | 2 +- ...etadata.google.cloud.bigquery.reservation.v1.json | 2 +- .../samples/package.json | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/CHANGELOG.md b/packages/google-cloud-bigquery-reservation/CHANGELOG.md index 0c7eab855a8..b5f13a82ad7 100644 --- a/packages/google-cloud-bigquery-reservation/CHANGELOG.md +++ b/packages/google-cloud-bigquery-reservation/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.0.1](https://github.com/googleapis/nodejs-bigquery-reservation/compare/v2.0.0...v2.0.1) (2022-09-01) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#169](https://github.com/googleapis/nodejs-bigquery-reservation/issues/169)) ([3532064](https://github.com/googleapis/nodejs-bigquery-reservation/commit/3532064ee2c7d07efe437875aaf18065ca7c036e)) +* Better support for fallback mode ([#165](https://github.com/googleapis/nodejs-bigquery-reservation/issues/165)) ([90fbf83](https://github.com/googleapis/nodejs-bigquery-reservation/commit/90fbf831bb4dbb4b5b03d782deeb5c8dc854e8dc)) +* Change import long to require ([#166](https://github.com/googleapis/nodejs-bigquery-reservation/issues/166)) ([c41ce5a](https://github.com/googleapis/nodejs-bigquery-reservation/commit/c41ce5a29572372d8e6ec8b0d2ca2901e10dfb71)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-bigquery-reservation/issues/1553)) ([#168](https://github.com/googleapis/nodejs-bigquery-reservation/issues/168)) ([56f9393](https://github.com/googleapis/nodejs-bigquery-reservation/commit/56f939367a5e3e8367c3d907638acefbcb945e8d)) +* **docs:** Document fallback rest option ([#161](https://github.com/googleapis/nodejs-bigquery-reservation/issues/161)) ([9db1472](https://github.com/googleapis/nodejs-bigquery-reservation/commit/9db14722d4bd6c74e47a4145691b3920bb82ebe0)) +* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-bigquery-reservation/issues/1546)) ([#167](https://github.com/googleapis/nodejs-bigquery-reservation/issues/167)) ([fd418d7](https://github.com/googleapis/nodejs-bigquery-reservation/commit/fd418d758721e21e86ecfab0f5e4c82fc8f40726)) + ## [2.0.0](https://github.com/googleapis/nodejs-bigquery-reservation/compare/v1.4.0...v2.0.0) (2022-06-07) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 61ef68ef636..00c3f10727e 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-reservation", - "version": "2.0.0", + "version": "2.0.1", "description": "BigQuery Reservation client for Node.js", "repository": "googleapis/nodejs-bigquery-reservation", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json b/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json index d6a719244a9..c21f9835be2 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-reservation", - "version": "2.0.0", + "version": "2.0.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-bigquery-reservation/samples/package.json b/packages/google-cloud-bigquery-reservation/samples/package.json index 76737c7f823..e5fe240d306 100644 --- a/packages/google-cloud-bigquery-reservation/samples/package.json +++ b/packages/google-cloud-bigquery-reservation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-reservation": "^2.0.0" + "@google-cloud/bigquery-reservation": "^2.0.1" }, "devDependencies": { "c8": "^7.1.0", From 9790641b445b12197b34f3042537f3653fd1421e 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:38:23 +0000 Subject: [PATCH 096/105] fix: preserve default values in x-goog-request-params header (#170) - [ ] 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/reservation_service_client.ts | 62 +- .../test/gapic_reservation_service_v1.ts | 2223 +++++++++-------- 2 files changed, 1208 insertions(+), 1077 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index c94458df043..dfd5926fa26 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts @@ -497,7 +497,7 @@ export class ReservationServiceClient { 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.createReservation(request, options, callback); @@ -595,7 +595,7 @@ export class ReservationServiceClient { 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.getReservation(request, options, callback); @@ -695,7 +695,7 @@ export class ReservationServiceClient { 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.deleteReservation(request, options, callback); @@ -794,7 +794,7 @@ export class ReservationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'reservation.name': request.reservation!.name || '', + 'reservation.name': request.reservation!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateReservation(request, options, callback); @@ -903,7 +903,7 @@ export class ReservationServiceClient { 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.createCapacityCommitment( @@ -1005,7 +1005,7 @@ export class ReservationServiceClient { 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.getCapacityCommitment(request, options, callback); @@ -1109,7 +1109,7 @@ export class ReservationServiceClient { 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.deleteCapacityCommitment( @@ -1218,7 +1218,7 @@ export class ReservationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'capacity_commitment.name': request.capacityCommitment!.name || '', + 'capacity_commitment.name': request.capacityCommitment!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateCapacityCommitment( @@ -1329,7 +1329,7 @@ export class ReservationServiceClient { 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.splitCapacityCommitment( @@ -1443,7 +1443,7 @@ export class ReservationServiceClient { 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.mergeCapacityCommitments( @@ -1586,7 +1586,7 @@ export class ReservationServiceClient { 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.createAssignment(request, options, callback); @@ -1698,7 +1698,7 @@ export class ReservationServiceClient { 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.deleteAssignment(request, options, callback); @@ -1804,7 +1804,7 @@ export class ReservationServiceClient { 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.moveAssignment(request, options, callback); @@ -1905,7 +1905,7 @@ export class ReservationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'assignment.name': request.assignment!.name || '', + 'assignment.name': request.assignment!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateAssignment(request, options, callback); @@ -2003,7 +2003,7 @@ export class ReservationServiceClient { 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.getBiReservation(request, options, callback); @@ -2109,7 +2109,7 @@ export class ReservationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'bi_reservation.name': request.biReservation!.name || '', + 'bi_reservation.name': request.biReservation!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateBiReservation(request, options, callback); @@ -2209,7 +2209,7 @@ export class ReservationServiceClient { 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.listReservations(request, options, callback); @@ -2248,7 +2248,7 @@ export class ReservationServiceClient { 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['listReservations']; const callSettings = defaultCallSettings.merge(options); @@ -2296,7 +2296,7 @@ export class ReservationServiceClient { 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['listReservations']; const callSettings = defaultCallSettings.merge(options); @@ -2401,7 +2401,7 @@ export class ReservationServiceClient { 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.listCapacityCommitments( @@ -2444,7 +2444,7 @@ export class ReservationServiceClient { 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['listCapacityCommitments']; const callSettings = defaultCallSettings.merge(options); @@ -2492,7 +2492,7 @@ export class ReservationServiceClient { 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['listCapacityCommitments']; const callSettings = defaultCallSettings.merge(options); @@ -2622,7 +2622,7 @@ export class ReservationServiceClient { 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.listAssignments(request, options, callback); @@ -2666,7 +2666,7 @@ export class ReservationServiceClient { 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['listAssignments']; const callSettings = defaultCallSettings.merge(options); @@ -2719,7 +2719,7 @@ export class ReservationServiceClient { 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['listAssignments']; const callSettings = defaultCallSettings.merge(options); @@ -2856,7 +2856,7 @@ export class ReservationServiceClient { 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(); this.warn( @@ -2910,7 +2910,7 @@ export class ReservationServiceClient { 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['searchAssignments']; const callSettings = defaultCallSettings.merge(options); @@ -2973,7 +2973,7 @@ export class ReservationServiceClient { 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['searchAssignments']; const callSettings = defaultCallSettings.merge(options); @@ -3111,7 +3111,7 @@ export class ReservationServiceClient { 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.searchAllAssignments(request, options, callback); @@ -3159,7 +3159,7 @@ export class ReservationServiceClient { 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['searchAllAssignments']; const callSettings = defaultCallSettings.merge(options); @@ -3216,7 +3216,7 @@ export class ReservationServiceClient { 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['searchAllAssignments']; const callSettings = defaultCallSettings.merge(options); diff --git a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts index f2ab622b0e5..c7dd3fa4d31 100644 --- a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts +++ b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts @@ -27,6 +27,21 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -222,26 +237,25 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CreateReservationRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateReservationRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() ); client.innerApiCalls.createReservation = stubSimpleCall(expectedResponse); const [response] = await client.createReservation(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createReservation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createReservation without error using callback', async () => { @@ -253,15 +267,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CreateReservationRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateReservationRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() ); @@ -284,11 +294,14 @@ describe('v1.ReservationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createReservation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createReservation with error', async () => { @@ -300,26 +313,25 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CreateReservationRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateReservationRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createReservation = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.createReservation(request), expectedError); - assert( - (client.innerApiCalls.createReservation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createReservation with closed client', async () => { @@ -331,7 +343,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CreateReservationRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateReservationRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createReservation(request), expectedError); @@ -348,26 +363,25 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.GetReservationRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetReservationRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() ); client.innerApiCalls.getReservation = stubSimpleCall(expectedResponse); const [response] = await client.getReservation(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getReservation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getReservation without error using callback', async () => { @@ -379,15 +393,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.GetReservationRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetReservationRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() ); @@ -410,11 +420,14 @@ describe('v1.ReservationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getReservation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getReservation with error', async () => { @@ -426,26 +439,25 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.GetReservationRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetReservationRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getReservation = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.getReservation(request), expectedError); - assert( - (client.innerApiCalls.getReservation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getReservation with closed client', async () => { @@ -457,7 +469,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.GetReservationRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetReservationRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getReservation(request), expectedError); @@ -474,26 +489,25 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.DeleteReservationRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteReservationRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); client.innerApiCalls.deleteReservation = stubSimpleCall(expectedResponse); const [response] = await client.deleteReservation(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteReservation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteReservation without error using callback', async () => { @@ -505,15 +519,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.DeleteReservationRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteReservationRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -536,11 +546,14 @@ describe('v1.ReservationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteReservation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteReservation with error', async () => { @@ -552,26 +565,25 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.DeleteReservationRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteReservationRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteReservation = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.deleteReservation(request), expectedError); - assert( - (client.innerApiCalls.deleteReservation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteReservation with closed client', async () => { @@ -583,7 +595,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.DeleteReservationRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('DeleteReservationRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteReservation(request), expectedError); @@ -600,27 +615,27 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.UpdateReservationRequest() ); - request.reservation = {}; - request.reservation.name = ''; - const expectedHeaderRequestParams = 'reservation.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.reservation ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateReservationRequest', [ + 'reservation', + 'name', + ]); + request.reservation.name = defaultValue1; + const expectedHeaderRequestParams = `reservation.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() ); client.innerApiCalls.updateReservation = stubSimpleCall(expectedResponse); const [response] = await client.updateReservation(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateReservation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateReservation without error using callback', async () => { @@ -632,16 +647,13 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.UpdateReservationRequest() ); - request.reservation = {}; - request.reservation.name = ''; - const expectedHeaderRequestParams = 'reservation.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.reservation ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateReservationRequest', [ + 'reservation', + 'name', + ]); + request.reservation.name = defaultValue1; + const expectedHeaderRequestParams = `reservation.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() ); @@ -664,11 +676,14 @@ describe('v1.ReservationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateReservation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateReservation with error', async () => { @@ -680,27 +695,27 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.UpdateReservationRequest() ); - request.reservation = {}; - request.reservation.name = ''; - const expectedHeaderRequestParams = 'reservation.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.reservation ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateReservationRequest', [ + 'reservation', + 'name', + ]); + request.reservation.name = defaultValue1; + const expectedHeaderRequestParams = `reservation.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateReservation = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateReservation(request), expectedError); - assert( - (client.innerApiCalls.updateReservation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateReservation with closed client', async () => { @@ -712,8 +727,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.UpdateReservationRequest() ); - request.reservation = {}; - request.reservation.name = ''; + request.reservation ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateReservationRequest', [ + 'reservation', + 'name', + ]); + request.reservation.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateReservation(request), expectedError); @@ -730,15 +749,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateCapacityCommitmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); @@ -746,11 +762,14 @@ describe('v1.ReservationServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.createCapacityCommitment(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createCapacityCommitment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createCapacityCommitment without error using callback', async () => { @@ -762,15 +781,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateCapacityCommitmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); @@ -793,11 +809,14 @@ describe('v1.ReservationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createCapacityCommitment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createCapacityCommitment with error', async () => { @@ -809,15 +828,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateCapacityCommitmentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createCapacityCommitment = stubSimpleCall( undefined, @@ -827,11 +843,14 @@ describe('v1.ReservationServiceClient', () => { client.createCapacityCommitment(request), expectedError ); - assert( - (client.innerApiCalls.createCapacityCommitment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createCapacityCommitment with closed client', async () => { @@ -843,7 +862,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'CreateCapacityCommitmentRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -863,15 +886,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); @@ -879,11 +899,14 @@ describe('v1.ReservationServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getCapacityCommitment(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getCapacityCommitment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getCapacityCommitment without error using callback', async () => { @@ -895,15 +918,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); @@ -926,11 +946,14 @@ describe('v1.ReservationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getCapacityCommitment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getCapacityCommitment with error', async () => { @@ -942,15 +965,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getCapacityCommitment = stubSimpleCall( undefined, @@ -960,11 +980,14 @@ describe('v1.ReservationServiceClient', () => { client.getCapacityCommitment(request), expectedError ); - assert( - (client.innerApiCalls.getCapacityCommitment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getCapacityCommitment with closed client', async () => { @@ -976,7 +999,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'GetCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -996,15 +1023,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1012,11 +1036,14 @@ describe('v1.ReservationServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.deleteCapacityCommitment(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteCapacityCommitment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteCapacityCommitment without error using callback', async () => { @@ -1028,15 +1055,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1059,11 +1083,14 @@ describe('v1.ReservationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteCapacityCommitment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteCapacityCommitment with error', async () => { @@ -1075,15 +1102,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCapacityCommitment = stubSimpleCall( undefined, @@ -1093,11 +1117,14 @@ describe('v1.ReservationServiceClient', () => { client.deleteCapacityCommitment(request), expectedError ); - assert( - (client.innerApiCalls.deleteCapacityCommitment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteCapacityCommitment with closed client', async () => { @@ -1109,7 +1136,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'DeleteCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1129,16 +1160,13 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest() ); - request.capacityCommitment = {}; - request.capacityCommitment.name = ''; - const expectedHeaderRequestParams = 'capacity_commitment.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.capacityCommitment ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateCapacityCommitmentRequest', + ['capacityCommitment', 'name'] + ); + request.capacityCommitment.name = defaultValue1; + const expectedHeaderRequestParams = `capacity_commitment.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); @@ -1146,11 +1174,14 @@ describe('v1.ReservationServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.updateCapacityCommitment(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateCapacityCommitment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateCapacityCommitment without error using callback', async () => { @@ -1162,16 +1193,13 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest() ); - request.capacityCommitment = {}; - request.capacityCommitment.name = ''; - const expectedHeaderRequestParams = 'capacity_commitment.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.capacityCommitment ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateCapacityCommitmentRequest', + ['capacityCommitment', 'name'] + ); + request.capacityCommitment.name = defaultValue1; + const expectedHeaderRequestParams = `capacity_commitment.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); @@ -1194,11 +1222,14 @@ describe('v1.ReservationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateCapacityCommitment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateCapacityCommitment with error', async () => { @@ -1210,16 +1241,13 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest() ); - request.capacityCommitment = {}; - request.capacityCommitment.name = ''; - const expectedHeaderRequestParams = 'capacity_commitment.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.capacityCommitment ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateCapacityCommitmentRequest', + ['capacityCommitment', 'name'] + ); + request.capacityCommitment.name = defaultValue1; + const expectedHeaderRequestParams = `capacity_commitment.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateCapacityCommitment = stubSimpleCall( undefined, @@ -1229,11 +1257,14 @@ describe('v1.ReservationServiceClient', () => { client.updateCapacityCommitment(request), expectedError ); - assert( - (client.innerApiCalls.updateCapacityCommitment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateCapacityCommitment with closed client', async () => { @@ -1245,8 +1276,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest() ); - request.capacityCommitment = {}; - request.capacityCommitment.name = ''; + request.capacityCommitment ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateCapacityCommitmentRequest', + ['capacityCommitment', 'name'] + ); + request.capacityCommitment.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1266,15 +1301,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'SplitCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse() ); @@ -1282,11 +1314,14 @@ describe('v1.ReservationServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.splitCapacityCommitment(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.splitCapacityCommitment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.splitCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.splitCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes splitCapacityCommitment without error using callback', async () => { @@ -1298,15 +1333,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'SplitCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse() ); @@ -1329,11 +1361,14 @@ describe('v1.ReservationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.splitCapacityCommitment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.splitCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.splitCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes splitCapacityCommitment with error', async () => { @@ -1345,15 +1380,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'SplitCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.splitCapacityCommitment = stubSimpleCall( undefined, @@ -1363,11 +1395,14 @@ describe('v1.ReservationServiceClient', () => { client.splitCapacityCommitment(request), expectedError ); - assert( - (client.innerApiCalls.splitCapacityCommitment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.splitCapacityCommitment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.splitCapacityCommitment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes splitCapacityCommitment with closed client', async () => { @@ -1379,7 +1414,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'SplitCapacityCommitmentRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1399,15 +1438,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'MergeCapacityCommitmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); @@ -1415,11 +1451,14 @@ describe('v1.ReservationServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.mergeCapacityCommitments(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.mergeCapacityCommitments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.mergeCapacityCommitments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mergeCapacityCommitments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes mergeCapacityCommitments without error using callback', async () => { @@ -1431,15 +1470,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'MergeCapacityCommitmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); @@ -1462,11 +1498,14 @@ describe('v1.ReservationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.mergeCapacityCommitments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.mergeCapacityCommitments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mergeCapacityCommitments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes mergeCapacityCommitments with error', async () => { @@ -1478,15 +1517,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'MergeCapacityCommitmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.mergeCapacityCommitments = stubSimpleCall( undefined, @@ -1496,11 +1532,14 @@ describe('v1.ReservationServiceClient', () => { client.mergeCapacityCommitments(request), expectedError ); - assert( - (client.innerApiCalls.mergeCapacityCommitments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.mergeCapacityCommitments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mergeCapacityCommitments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes mergeCapacityCommitments with closed client', async () => { @@ -1512,7 +1551,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'MergeCapacityCommitmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1532,26 +1575,25 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateAssignmentRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() ); client.innerApiCalls.createAssignment = stubSimpleCall(expectedResponse); const [response] = await client.createAssignment(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createAssignment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createAssignment without error using callback', async () => { @@ -1563,15 +1605,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateAssignmentRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() ); @@ -1594,11 +1632,14 @@ describe('v1.ReservationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createAssignment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createAssignment with error', async () => { @@ -1610,26 +1651,25 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateAssignmentRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createAssignment = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.createAssignment(request), expectedError); - assert( - (client.innerApiCalls.createAssignment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createAssignment with closed client', async () => { @@ -1641,7 +1681,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateAssignmentRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createAssignment(request), expectedError); @@ -1658,26 +1701,25 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteAssignmentRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); client.innerApiCalls.deleteAssignment = stubSimpleCall(expectedResponse); const [response] = await client.deleteAssignment(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteAssignment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteAssignment without error using callback', async () => { @@ -1689,15 +1731,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteAssignmentRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1720,11 +1758,14 @@ describe('v1.ReservationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteAssignment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteAssignment with error', async () => { @@ -1736,26 +1777,25 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteAssignmentRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteAssignment = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.deleteAssignment(request), expectedError); - assert( - (client.innerApiCalls.deleteAssignment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteAssignment with closed client', async () => { @@ -1767,7 +1807,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('DeleteAssignmentRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteAssignment(request), expectedError); @@ -1784,26 +1827,25 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('MoveAssignmentRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() ); client.innerApiCalls.moveAssignment = stubSimpleCall(expectedResponse); const [response] = await client.moveAssignment(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.moveAssignment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.moveAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.moveAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes moveAssignment without error using callback', async () => { @@ -1815,15 +1857,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('MoveAssignmentRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() ); @@ -1846,11 +1884,14 @@ describe('v1.ReservationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.moveAssignment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.moveAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.moveAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes moveAssignment with error', async () => { @@ -1862,26 +1903,25 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('MoveAssignmentRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.moveAssignment = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.moveAssignment(request), expectedError); - assert( - (client.innerApiCalls.moveAssignment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.moveAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.moveAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes moveAssignment with closed client', async () => { @@ -1893,7 +1933,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('MoveAssignmentRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.moveAssignment(request), expectedError); @@ -1910,27 +1953,27 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest() ); - request.assignment = {}; - request.assignment.name = ''; - const expectedHeaderRequestParams = 'assignment.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.assignment ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateAssignmentRequest', [ + 'assignment', + 'name', + ]); + request.assignment.name = defaultValue1; + const expectedHeaderRequestParams = `assignment.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() ); client.innerApiCalls.updateAssignment = stubSimpleCall(expectedResponse); const [response] = await client.updateAssignment(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateAssignment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateAssignment without error using callback', async () => { @@ -1942,16 +1985,13 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest() ); - request.assignment = {}; - request.assignment.name = ''; - const expectedHeaderRequestParams = 'assignment.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.assignment ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateAssignmentRequest', [ + 'assignment', + 'name', + ]); + request.assignment.name = defaultValue1; + const expectedHeaderRequestParams = `assignment.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() ); @@ -1974,11 +2014,14 @@ describe('v1.ReservationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateAssignment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateAssignment with error', async () => { @@ -1990,27 +2033,27 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest() ); - request.assignment = {}; - request.assignment.name = ''; - const expectedHeaderRequestParams = 'assignment.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.assignment ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateAssignmentRequest', [ + 'assignment', + 'name', + ]); + request.assignment.name = defaultValue1; + const expectedHeaderRequestParams = `assignment.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateAssignment = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateAssignment(request), expectedError); - assert( - (client.innerApiCalls.updateAssignment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateAssignment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAssignment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateAssignment with closed client', async () => { @@ -2022,8 +2065,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest() ); - request.assignment = {}; - request.assignment.name = ''; + request.assignment ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateAssignmentRequest', [ + 'assignment', + 'name', + ]); + request.assignment.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateAssignment(request), expectedError); @@ -2040,26 +2087,25 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.GetBiReservationRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetBiReservationRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.BiReservation() ); client.innerApiCalls.getBiReservation = stubSimpleCall(expectedResponse); const [response] = await client.getBiReservation(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getBiReservation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getBiReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBiReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getBiReservation without error using callback', async () => { @@ -2071,15 +2117,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.GetBiReservationRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetBiReservationRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.BiReservation() ); @@ -2102,11 +2144,14 @@ describe('v1.ReservationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getBiReservation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getBiReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBiReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getBiReservation with error', async () => { @@ -2118,26 +2163,25 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.GetBiReservationRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetBiReservationRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getBiReservation = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.getBiReservation(request), expectedError); - assert( - (client.innerApiCalls.getBiReservation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getBiReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBiReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getBiReservation with closed client', async () => { @@ -2149,7 +2193,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.GetBiReservationRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetBiReservationRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getBiReservation(request), expectedError); @@ -2166,16 +2213,13 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest() ); - request.biReservation = {}; - request.biReservation.name = ''; - const expectedHeaderRequestParams = 'bi_reservation.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.biReservation ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateBiReservationRequest', [ + 'biReservation', + 'name', + ]); + request.biReservation.name = defaultValue1; + const expectedHeaderRequestParams = `bi_reservation.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.BiReservation() ); @@ -2183,11 +2227,14 @@ describe('v1.ReservationServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.updateBiReservation(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateBiReservation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateBiReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBiReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateBiReservation without error using callback', async () => { @@ -2199,16 +2246,13 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest() ); - request.biReservation = {}; - request.biReservation.name = ''; - const expectedHeaderRequestParams = 'bi_reservation.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.biReservation ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateBiReservationRequest', [ + 'biReservation', + 'name', + ]); + request.biReservation.name = defaultValue1; + const expectedHeaderRequestParams = `bi_reservation.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.BiReservation() ); @@ -2231,11 +2275,14 @@ describe('v1.ReservationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateBiReservation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateBiReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBiReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateBiReservation with error', async () => { @@ -2247,27 +2294,27 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest() ); - request.biReservation = {}; - request.biReservation.name = ''; - const expectedHeaderRequestParams = 'bi_reservation.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.biReservation ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateBiReservationRequest', [ + 'biReservation', + 'name', + ]); + request.biReservation.name = defaultValue1; + const expectedHeaderRequestParams = `bi_reservation.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateBiReservation = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateBiReservation(request), expectedError); - assert( - (client.innerApiCalls.updateBiReservation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateBiReservation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBiReservation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateBiReservation with closed client', async () => { @@ -2279,8 +2326,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest() ); - request.biReservation = {}; - request.biReservation.name = ''; + request.biReservation ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateBiReservationRequest', [ + 'biReservation', + 'name', + ]); + request.biReservation.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateBiReservation(request), expectedError); @@ -2297,15 +2348,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListReservationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() @@ -2320,11 +2367,14 @@ describe('v1.ReservationServiceClient', () => { client.innerApiCalls.listReservations = stubSimpleCall(expectedResponse); const [response] = await client.listReservations(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listReservations as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listReservations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReservations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listReservations without error using callback', async () => { @@ -2336,15 +2386,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListReservationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() @@ -2377,11 +2423,14 @@ describe('v1.ReservationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listReservations as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listReservations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReservations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listReservations with error', async () => { @@ -2393,26 +2442,25 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListReservationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listReservations = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listReservations(request), expectedError); - assert( - (client.innerApiCalls.listReservations as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listReservations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReservations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listReservationsStream without error', async () => { @@ -2424,8 +2472,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListReservationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() @@ -2465,11 +2516,12 @@ describe('v1.ReservationServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listReservations, request) ); - assert.strictEqual( - ( - client.descriptors.page.listReservations.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listReservations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2482,8 +2534,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListReservationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listReservations.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2512,11 +2567,12 @@ describe('v1.ReservationServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listReservations, request) ); - assert.strictEqual( - ( - client.descriptors.page.listReservations.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listReservations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2529,8 +2585,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListReservationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() @@ -2557,11 +2616,12 @@ describe('v1.ReservationServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listReservations.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listReservations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2574,8 +2634,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListReservationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listReservations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2593,11 +2656,12 @@ describe('v1.ReservationServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listReservations.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listReservations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2612,15 +2676,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListCapacityCommitmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() @@ -2636,11 +2697,14 @@ describe('v1.ReservationServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listCapacityCommitments(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listCapacityCommitments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listCapacityCommitments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCapacityCommitments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listCapacityCommitments without error using callback', async () => { @@ -2652,15 +2716,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListCapacityCommitmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() @@ -2693,11 +2754,14 @@ describe('v1.ReservationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listCapacityCommitments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listCapacityCommitments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCapacityCommitments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listCapacityCommitments with error', async () => { @@ -2709,15 +2773,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListCapacityCommitmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listCapacityCommitments = stubSimpleCall( undefined, @@ -2727,11 +2788,14 @@ describe('v1.ReservationServiceClient', () => { client.listCapacityCommitments(request), expectedError ); - assert( - (client.innerApiCalls.listCapacityCommitments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listCapacityCommitments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCapacityCommitments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listCapacityCommitmentsStream without error', async () => { @@ -2743,8 +2807,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListCapacityCommitmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() @@ -2787,12 +2855,15 @@ describe('v1.ReservationServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listCapacityCommitments, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listCapacityCommitments .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2805,8 +2876,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListCapacityCommitmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listCapacityCommitments.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2838,12 +2913,15 @@ describe('v1.ReservationServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listCapacityCommitments, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listCapacityCommitments .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2856,8 +2934,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListCapacityCommitmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() @@ -2885,12 +2967,15 @@ describe('v1.ReservationServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listCapacityCommitments .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2903,8 +2988,12 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListCapacityCommitmentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listCapacityCommitments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2923,12 +3012,15 @@ describe('v1.ReservationServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listCapacityCommitments .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2943,15 +3035,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAssignmentsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -2966,11 +3054,14 @@ describe('v1.ReservationServiceClient', () => { client.innerApiCalls.listAssignments = stubSimpleCall(expectedResponse); const [response] = await client.listAssignments(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listAssignments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAssignments without error using callback', async () => { @@ -2982,15 +3073,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAssignmentsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -3023,11 +3110,14 @@ describe('v1.ReservationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listAssignments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAssignments with error', async () => { @@ -3039,26 +3129,25 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAssignmentsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listAssignments = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listAssignments(request), expectedError); - assert( - (client.innerApiCalls.listAssignments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAssignmentsStream without error', async () => { @@ -3070,8 +3159,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssignmentsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -3111,11 +3203,12 @@ describe('v1.ReservationServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listAssignments, request) ); - assert.strictEqual( - ( - client.descriptors.page.listAssignments.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssignments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3128,8 +3221,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssignmentsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAssignments.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3158,11 +3254,12 @@ describe('v1.ReservationServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listAssignments, request) ); - assert.strictEqual( - ( - client.descriptors.page.listAssignments.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssignments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3175,8 +3272,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssignmentsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -3203,11 +3303,12 @@ describe('v1.ReservationServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listAssignments.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssignments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3220,8 +3321,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAssignmentsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAssignments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3239,11 +3343,12 @@ describe('v1.ReservationServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listAssignments.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAssignments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -3259,15 +3364,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SearchAssignmentsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -3283,11 +3384,14 @@ describe('v1.ReservationServiceClient', () => { const [response] = await client.searchAssignments(request); assert(stub.calledOnce); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.searchAssignments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.searchAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchAssignments without error using callback', async () => { @@ -3300,15 +3404,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SearchAssignmentsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -3342,11 +3442,14 @@ describe('v1.ReservationServiceClient', () => { const response = await promise; assert(stub.calledOnce); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.searchAssignments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.searchAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchAssignments with error', async () => { @@ -3359,15 +3462,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SearchAssignmentsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.searchAssignments = stubSimpleCall( undefined, @@ -3375,11 +3474,14 @@ describe('v1.ReservationServiceClient', () => { ); await assert.rejects(client.searchAssignments(request), expectedError); assert(stub.calledOnce); - assert( - (client.innerApiCalls.searchAssignments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.searchAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchAssignmentsStream without error', async () => { @@ -3392,8 +3494,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('SearchAssignmentsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -3434,11 +3539,12 @@ describe('v1.ReservationServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.searchAssignments, request) ); - assert.strictEqual( - ( - client.descriptors.page.searchAssignments.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAssignments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3452,8 +3558,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('SearchAssignmentsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchAssignments.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3483,11 +3592,12 @@ describe('v1.ReservationServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.searchAssignments, request) ); - assert.strictEqual( - ( - client.descriptors.page.searchAssignments.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAssignments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3501,8 +3611,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('SearchAssignmentsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -3530,11 +3643,12 @@ describe('v1.ReservationServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.searchAssignments.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAssignments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3548,8 +3662,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('SearchAssignmentsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchAssignments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3568,11 +3685,12 @@ describe('v1.ReservationServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.searchAssignments.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAssignments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -3587,15 +3705,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SearchAllAssignmentsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -3611,11 +3725,14 @@ describe('v1.ReservationServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.searchAllAssignments(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.searchAllAssignments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.searchAllAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAllAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchAllAssignments without error using callback', async () => { @@ -3627,15 +3744,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SearchAllAssignmentsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -3668,11 +3781,14 @@ describe('v1.ReservationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.searchAllAssignments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.searchAllAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAllAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchAllAssignments with error', async () => { @@ -3684,26 +3800,25 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('SearchAllAssignmentsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.searchAllAssignments = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.searchAllAssignments(request), expectedError); - assert( - (client.innerApiCalls.searchAllAssignments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.searchAllAssignments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchAllAssignments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchAllAssignmentsStream without error', async () => { @@ -3715,8 +3830,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('SearchAllAssignmentsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -3756,11 +3874,12 @@ describe('v1.ReservationServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.searchAllAssignments, request) ); - assert.strictEqual( - ( - client.descriptors.page.searchAllAssignments.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAllAssignments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3773,8 +3892,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('SearchAllAssignmentsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchAllAssignments.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3803,11 +3925,12 @@ describe('v1.ReservationServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.searchAllAssignments, request) ); - assert.strictEqual( - ( - client.descriptors.page.searchAllAssignments.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAllAssignments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3820,8 +3943,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('SearchAllAssignmentsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -3848,11 +3974,12 @@ describe('v1.ReservationServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.searchAllAssignments.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAllAssignments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3865,8 +3992,11 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('SearchAllAssignmentsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchAllAssignments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3884,11 +4014,12 @@ describe('v1.ReservationServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.searchAllAssignments.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.searchAllAssignments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); From d47d6d17989619ba56662aa6f247b2ff4e93d004 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 14:57:52 -0700 Subject: [PATCH 097/105] build: use fully qualified request type name in tests (#173) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test: use fully qualified request type name in tests PiperOrigin-RevId: 475685359 Source-Link: https://github.com/googleapis/googleapis/commit/7a129736313ceb1f277c3b7f7e16d2e04cc901dd Source-Link: https://github.com/googleapis/googleapis-gen/commit/370c729e2ba062a167449c27882ba5f379c5c34d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzcwYzcyOWUyYmEwNjJhMTY3NDQ5YzI3ODgyYmE1ZjM3OWM1YzM0ZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../test/gapic_reservation_service_v1.ts | 550 ++++++++++-------- 1 file changed, 303 insertions(+), 247 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts index c7dd3fa4d31..1237a39a172 100644 --- a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts +++ b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts @@ -237,9 +237,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CreateReservationRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateReservationRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.CreateReservationRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -267,9 +268,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CreateReservationRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateReservationRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.CreateReservationRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -313,9 +315,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CreateReservationRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateReservationRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.CreateReservationRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -343,9 +346,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CreateReservationRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateReservationRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.CreateReservationRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -363,9 +367,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.GetReservationRequest() ); - const defaultValue1 = getTypeDefaultValue('GetReservationRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.GetReservationRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -393,9 +398,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.GetReservationRequest() ); - const defaultValue1 = getTypeDefaultValue('GetReservationRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.GetReservationRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -439,9 +445,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.GetReservationRequest() ); - const defaultValue1 = getTypeDefaultValue('GetReservationRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.GetReservationRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -469,9 +476,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.GetReservationRequest() ); - const defaultValue1 = getTypeDefaultValue('GetReservationRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.GetReservationRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -489,9 +497,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.DeleteReservationRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteReservationRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.DeleteReservationRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -519,9 +528,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.DeleteReservationRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteReservationRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.DeleteReservationRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -565,9 +575,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.DeleteReservationRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteReservationRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.DeleteReservationRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -595,9 +606,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.DeleteReservationRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteReservationRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.DeleteReservationRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -616,10 +628,10 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.UpdateReservationRequest() ); request.reservation ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateReservationRequest', [ - 'reservation', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateReservationRequest', + ['reservation', 'name'] + ); request.reservation.name = defaultValue1; const expectedHeaderRequestParams = `reservation.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -648,10 +660,10 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.UpdateReservationRequest() ); request.reservation ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateReservationRequest', [ - 'reservation', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateReservationRequest', + ['reservation', 'name'] + ); request.reservation.name = defaultValue1; const expectedHeaderRequestParams = `reservation.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -696,10 +708,10 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.UpdateReservationRequest() ); request.reservation ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateReservationRequest', [ - 'reservation', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateReservationRequest', + ['reservation', 'name'] + ); request.reservation.name = defaultValue1; const expectedHeaderRequestParams = `reservation.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -728,10 +740,10 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.UpdateReservationRequest() ); request.reservation ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateReservationRequest', [ - 'reservation', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateReservationRequest', + ['reservation', 'name'] + ); request.reservation.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -750,7 +762,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateCapacityCommitmentRequest', + '.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest', ['parent'] ); request.parent = defaultValue1; @@ -782,7 +794,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateCapacityCommitmentRequest', + '.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest', ['parent'] ); request.parent = defaultValue1; @@ -829,7 +841,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateCapacityCommitmentRequest', + '.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest', ['parent'] ); request.parent = defaultValue1; @@ -863,7 +875,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateCapacityCommitmentRequest', + '.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest', ['parent'] ); request.parent = defaultValue1; @@ -887,7 +899,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetCapacityCommitmentRequest', + '.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest', ['name'] ); request.name = defaultValue1; @@ -919,7 +931,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetCapacityCommitmentRequest', + '.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest', ['name'] ); request.name = defaultValue1; @@ -966,7 +978,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetCapacityCommitmentRequest', + '.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest', ['name'] ); request.name = defaultValue1; @@ -1000,7 +1012,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetCapacityCommitmentRequest', + '.google.cloud.bigquery.reservation.v1.GetCapacityCommitmentRequest', ['name'] ); request.name = defaultValue1; @@ -1024,7 +1036,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteCapacityCommitmentRequest', + '.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest', ['name'] ); request.name = defaultValue1; @@ -1056,7 +1068,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteCapacityCommitmentRequest', + '.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest', ['name'] ); request.name = defaultValue1; @@ -1103,7 +1115,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteCapacityCommitmentRequest', + '.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest', ['name'] ); request.name = defaultValue1; @@ -1137,7 +1149,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteCapacityCommitmentRequest', + '.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest', ['name'] ); request.name = defaultValue1; @@ -1162,7 +1174,7 @@ describe('v1.ReservationServiceClient', () => { ); request.capacityCommitment ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateCapacityCommitmentRequest', + '.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest', ['capacityCommitment', 'name'] ); request.capacityCommitment.name = defaultValue1; @@ -1195,7 +1207,7 @@ describe('v1.ReservationServiceClient', () => { ); request.capacityCommitment ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateCapacityCommitmentRequest', + '.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest', ['capacityCommitment', 'name'] ); request.capacityCommitment.name = defaultValue1; @@ -1243,7 +1255,7 @@ describe('v1.ReservationServiceClient', () => { ); request.capacityCommitment ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateCapacityCommitmentRequest', + '.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest', ['capacityCommitment', 'name'] ); request.capacityCommitment.name = defaultValue1; @@ -1278,7 +1290,7 @@ describe('v1.ReservationServiceClient', () => { ); request.capacityCommitment ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateCapacityCommitmentRequest', + '.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest', ['capacityCommitment', 'name'] ); request.capacityCommitment.name = defaultValue1; @@ -1302,7 +1314,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'SplitCapacityCommitmentRequest', + '.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest', ['name'] ); request.name = defaultValue1; @@ -1334,7 +1346,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'SplitCapacityCommitmentRequest', + '.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest', ['name'] ); request.name = defaultValue1; @@ -1381,7 +1393,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'SplitCapacityCommitmentRequest', + '.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest', ['name'] ); request.name = defaultValue1; @@ -1415,7 +1427,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'SplitCapacityCommitmentRequest', + '.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest', ['name'] ); request.name = defaultValue1; @@ -1439,7 +1451,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'MergeCapacityCommitmentsRequest', + '.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1471,7 +1483,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'MergeCapacityCommitmentsRequest', + '.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1518,7 +1530,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'MergeCapacityCommitmentsRequest', + '.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1552,7 +1564,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'MergeCapacityCommitmentsRequest', + '.google.cloud.bigquery.reservation.v1.MergeCapacityCommitmentsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1575,9 +1587,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateAssignmentRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1605,9 +1618,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateAssignmentRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1651,9 +1665,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateAssignmentRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1681,9 +1696,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateAssignmentRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1701,9 +1717,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteAssignmentRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1731,9 +1748,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteAssignmentRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1777,9 +1795,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteAssignmentRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1807,9 +1826,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteAssignmentRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1827,9 +1847,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest() ); - const defaultValue1 = getTypeDefaultValue('MoveAssignmentRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1857,9 +1878,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest() ); - const defaultValue1 = getTypeDefaultValue('MoveAssignmentRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1903,9 +1925,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest() ); - const defaultValue1 = getTypeDefaultValue('MoveAssignmentRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1933,9 +1956,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest() ); - const defaultValue1 = getTypeDefaultValue('MoveAssignmentRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.MoveAssignmentRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1954,10 +1978,10 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest() ); request.assignment ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateAssignmentRequest', [ - 'assignment', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest', + ['assignment', 'name'] + ); request.assignment.name = defaultValue1; const expectedHeaderRequestParams = `assignment.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1986,10 +2010,10 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest() ); request.assignment ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateAssignmentRequest', [ - 'assignment', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest', + ['assignment', 'name'] + ); request.assignment.name = defaultValue1; const expectedHeaderRequestParams = `assignment.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2034,10 +2058,10 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest() ); request.assignment ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateAssignmentRequest', [ - 'assignment', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest', + ['assignment', 'name'] + ); request.assignment.name = defaultValue1; const expectedHeaderRequestParams = `assignment.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2066,10 +2090,10 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest() ); request.assignment ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateAssignmentRequest', [ - 'assignment', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest', + ['assignment', 'name'] + ); request.assignment.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -2087,9 +2111,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.GetBiReservationRequest() ); - const defaultValue1 = getTypeDefaultValue('GetBiReservationRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.GetBiReservationRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2117,9 +2142,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.GetBiReservationRequest() ); - const defaultValue1 = getTypeDefaultValue('GetBiReservationRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.GetBiReservationRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2163,9 +2189,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.GetBiReservationRequest() ); - const defaultValue1 = getTypeDefaultValue('GetBiReservationRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.GetBiReservationRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2193,9 +2220,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.GetBiReservationRequest() ); - const defaultValue1 = getTypeDefaultValue('GetBiReservationRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.GetBiReservationRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -2214,10 +2242,10 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest() ); request.biReservation ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateBiReservationRequest', [ - 'biReservation', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest', + ['biReservation', 'name'] + ); request.biReservation.name = defaultValue1; const expectedHeaderRequestParams = `bi_reservation.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2247,10 +2275,10 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest() ); request.biReservation ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateBiReservationRequest', [ - 'biReservation', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest', + ['biReservation', 'name'] + ); request.biReservation.name = defaultValue1; const expectedHeaderRequestParams = `bi_reservation.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -2295,10 +2323,10 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest() ); request.biReservation ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateBiReservationRequest', [ - 'biReservation', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest', + ['biReservation', 'name'] + ); request.biReservation.name = defaultValue1; const expectedHeaderRequestParams = `bi_reservation.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2327,10 +2355,10 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest() ); request.biReservation ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateBiReservationRequest', [ - 'biReservation', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest', + ['biReservation', 'name'] + ); request.biReservation.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -2348,9 +2376,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListReservationsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListReservationsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2386,9 +2415,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListReservationsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListReservationsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2442,9 +2472,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListReservationsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListReservationsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2472,9 +2503,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListReservationsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListReservationsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2534,9 +2566,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListReservationsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListReservationsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2585,9 +2618,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListReservationsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListReservationsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2634,9 +2668,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListReservationsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListReservationsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListReservationsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2677,7 +2712,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListCapacityCommitmentsRequest', + '.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest', ['parent'] ); request.parent = defaultValue1; @@ -2717,7 +2752,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListCapacityCommitmentsRequest', + '.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest', ['parent'] ); request.parent = defaultValue1; @@ -2774,7 +2809,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListCapacityCommitmentsRequest', + '.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest', ['parent'] ); request.parent = defaultValue1; @@ -2808,7 +2843,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListCapacityCommitmentsRequest', + '.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest', ['parent'] ); request.parent = defaultValue1; @@ -2877,7 +2912,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListCapacityCommitmentsRequest', + '.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest', ['parent'] ); request.parent = defaultValue1; @@ -2935,7 +2970,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListCapacityCommitmentsRequest', + '.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest', ['parent'] ); request.parent = defaultValue1; @@ -2989,7 +3024,7 @@ describe('v1.ReservationServiceClient', () => { new protos.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListCapacityCommitmentsRequest', + '.google.cloud.bigquery.reservation.v1.ListCapacityCommitmentsRequest', ['parent'] ); request.parent = defaultValue1; @@ -3035,9 +3070,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssignmentsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3073,9 +3109,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssignmentsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3129,9 +3166,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssignmentsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3159,9 +3197,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssignmentsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3221,9 +3260,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssignmentsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3272,9 +3312,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssignmentsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3321,9 +3362,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAssignmentsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.ListAssignmentsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3364,9 +3406,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAssignmentsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3404,9 +3447,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAssignmentsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3462,9 +3506,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAssignmentsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3494,9 +3539,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAssignmentsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3558,9 +3604,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAssignmentsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3611,9 +3658,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAssignmentsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3662,9 +3710,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAssignmentsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAssignmentsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3705,9 +3754,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllAssignmentsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3744,9 +3794,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllAssignmentsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3800,9 +3851,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllAssignmentsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3830,9 +3882,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllAssignmentsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3892,9 +3945,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllAssignmentsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -3943,9 +3997,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllAssignmentsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -3992,9 +4047,10 @@ describe('v1.ReservationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest() ); - const defaultValue1 = getTypeDefaultValue('SearchAllAssignmentsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.reservation.v1.SearchAllAssignmentsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); From 652f3ac691733d22eebb5ad7b59dd0f2219f009d 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:26:18 +0000 Subject: [PATCH 098/105] chore(main): release 2.0.2 (#171) :robot: I have created a release *beep* *boop* --- ## [2.0.2](https://github.com/googleapis/nodejs-bigquery-reservation/compare/v2.0.1...v2.0.2) (2022-09-22) ### Bug Fixes * Preserve default values in x-goog-request-params header ([#170](https://github.com/googleapis/nodejs-bigquery-reservation/issues/170)) ([a2bdb93](https://github.com/googleapis/nodejs-bigquery-reservation/commit/a2bdb9342de046fec22897343b3a1c1e696928fc)) --- 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-bigquery-reservation/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-reservation/package.json | 2 +- ...ppet_metadata.google.cloud.bigquery.reservation.v1.json | 2 +- .../google-cloud-bigquery-reservation/samples/package.json | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/CHANGELOG.md b/packages/google-cloud-bigquery-reservation/CHANGELOG.md index b5f13a82ad7..186cf78d566 100644 --- a/packages/google-cloud-bigquery-reservation/CHANGELOG.md +++ b/packages/google-cloud-bigquery-reservation/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.0.2](https://github.com/googleapis/nodejs-bigquery-reservation/compare/v2.0.1...v2.0.2) (2022-09-22) + + +### Bug Fixes + +* Preserve default values in x-goog-request-params header ([#170](https://github.com/googleapis/nodejs-bigquery-reservation/issues/170)) ([a2bdb93](https://github.com/googleapis/nodejs-bigquery-reservation/commit/a2bdb9342de046fec22897343b3a1c1e696928fc)) + ## [2.0.1](https://github.com/googleapis/nodejs-bigquery-reservation/compare/v2.0.0...v2.0.1) (2022-09-01) diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 00c3f10727e..137bb85e7ad 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-reservation", - "version": "2.0.1", + "version": "2.0.2", "description": "BigQuery Reservation client for Node.js", "repository": "googleapis/nodejs-bigquery-reservation", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json b/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json index c21f9835be2..62fa4322f2d 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-reservation", - "version": "2.0.1", + "version": "2.0.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-bigquery-reservation/samples/package.json b/packages/google-cloud-bigquery-reservation/samples/package.json index e5fe240d306..7cebb11c566 100644 --- a/packages/google-cloud-bigquery-reservation/samples/package.json +++ b/packages/google-cloud-bigquery-reservation/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-reservation": "^2.0.1" + "@google-cloud/bigquery-reservation": "^2.0.2" }, "devDependencies": { "c8": "^7.1.0", From 3d4fd5c4d57e1a6376d0d81bf62fff2d688ed3a1 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Wed, 12 Oct 2022 21:34:10 -0700 Subject: [PATCH 099/105] build: add release-please config, fix owlbot-config --- .release-please-manifest.json | 1 + .../{.github => }/.OwlBot.yaml | 6 +- .../.mocharc.js | 2 +- .../.prettierrc.js | 2 +- .../.repo-metadata.json | 2 +- .../README.md | 36 +- .../package.json | 4 +- .../samples/README.md | 408 +++++++++++++++++- .../src/index.ts | 2 +- release-please-config.json | 1 + 10 files changed, 441 insertions(+), 23 deletions(-) rename packages/google-cloud-bigquery-reservation/{.github => }/.OwlBot.yaml (81%) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a4aac6fae6f..63eaebdbf37 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -10,6 +10,7 @@ "packages/google-cloud-bigquery-analyticshub": "0.1.0", "packages/google-cloud-bigquery-datapolicies": "0.1.0", "packages/google-cloud-bigquery-datatransfer": "3.1.3", + "packages/google-cloud-bigquery-reservation": "2.0.2", "packages/google-cloud-gkemulticloud": "0.1.2", "packages/google-cloud-language": "5.1.0", "packages/google-cloud-oslogin": "4.0.2", diff --git a/packages/google-cloud-bigquery-reservation/.github/.OwlBot.yaml b/packages/google-cloud-bigquery-reservation/.OwlBot.yaml similarity index 81% rename from packages/google-cloud-bigquery-reservation/.github/.OwlBot.yaml rename to packages/google-cloud-bigquery-reservation/.OwlBot.yaml index 25f992e9050..3e852a624ab 100644 --- a/packages/google-cloud-bigquery-reservation/.github/.OwlBot.yaml +++ b/packages/google-cloud-bigquery-reservation/.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,8 +19,8 @@ deep-preserve-regex: - /owl-bot-staging/v1beta1 deep-copy-regex: - - source: /google/cloud/bigquery/reservation/(.*)/.*-nodejs/(.*) - dest: /owl-bot-staging/$1/$2 + - source: /google/cloud/bigquery/reservation/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-bigquery-reservation/$1 begin-after-commit-hash: fb91803ccef5d7c695139b22788b309e2197856b diff --git a/packages/google-cloud-bigquery-reservation/.mocharc.js b/packages/google-cloud-bigquery-reservation/.mocharc.js index 0b600509bed..cdb7b752160 100644 --- a/packages/google-cloud-bigquery-reservation/.mocharc.js +++ b/packages/google-cloud-bigquery-reservation/.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-bigquery-reservation/.prettierrc.js b/packages/google-cloud-bigquery-reservation/.prettierrc.js index d1b95106f4c..d546a4ad546 100644 --- a/packages/google-cloud-bigquery-reservation/.prettierrc.js +++ b/packages/google-cloud-bigquery-reservation/.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-bigquery-reservation/.repo-metadata.json b/packages/google-cloud-bigquery-reservation/.repo-metadata.json index aeb5655d476..aa23e9b238b 100644 --- a/packages/google-cloud-bigquery-reservation/.repo-metadata.json +++ b/packages/google-cloud-bigquery-reservation/.repo-metadata.json @@ -1,6 +1,6 @@ { "language": "nodejs", - "repo": "googleapis/nodejs-bigquery-reservation", + "repo": "googleapis/google-cloud-node", "name": "bigqueryreservation", "issue_tracker": "https://b.corp.google.com/savedsearches/559654", "default_version": "v1", diff --git a/packages/google-cloud-bigquery-reservation/README.md b/packages/google-cloud-bigquery-reservation/README.md index d97b2d47102..070419bfd54 100644 --- a/packages/google-cloud-bigquery-reservation/README.md +++ b/packages/google-cloud-bigquery-reservation/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Google BigQuery Reservation: Node.js Client](https://github.com/googleapis/nodejs-bigquery-reservation) +# [Google BigQuery Reservation: 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/bigquery-reservation.svg)](https://www.npmjs.org/package/@google-cloud/bigquery-reservation) @@ -14,11 +14,11 @@ BigQuery Reservation client for Node.js A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-bigquery-reservation/blob/main/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/blob/main/CHANGELOG.md). * [Google BigQuery Reservation Node.js Client API Reference][client-docs] * [Google BigQuery Reservation Documentation][product-docs] -* [github.com/googleapis/nodejs-bigquery-reservation](https://github.com/googleapis/nodejs-bigquery-reservation) +* [github.com/googleapis/google-cloud-node](https://github.com/googleapis/google-cloud-node) Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in [Client Libraries Explained][explained]. @@ -95,11 +95,33 @@ listCapacityCommitments(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-bigquery-reservation/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Quickstart | [source code](https://github.com/googleapis/nodejs-bigquery-reservation/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-bigquery-reservation&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Reservation_service.create_assignment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js) | [![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js,samples/README.md) | +| Reservation_service.create_capacity_commitment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js) | [![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js,samples/README.md) | +| Reservation_service.create_reservation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js) | [![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js,samples/README.md) | +| Reservation_service.delete_assignment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js) | [![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js,samples/README.md) | +| Reservation_service.delete_capacity_commitment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js) | [![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js,samples/README.md) | +| Reservation_service.delete_reservation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js) | [![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js,samples/README.md) | +| Reservation_service.get_bi_reservation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js) | [![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js,samples/README.md) | +| Reservation_service.get_capacity_commitment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js) | [![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js,samples/README.md) | +| Reservation_service.get_reservation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js) | [![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js,samples/README.md) | +| Reservation_service.list_assignments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js) | [![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js,samples/README.md) | +| Reservation_service.list_capacity_commitments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js) | [![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js,samples/README.md) | +| Reservation_service.list_reservations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js) | [![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js,samples/README.md) | +| Reservation_service.merge_capacity_commitments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js) | [![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js,samples/README.md) | +| Reservation_service.move_assignment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js) | [![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js,samples/README.md) | +| Reservation_service.search_all_assignments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js) | [![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js,samples/README.md) | +| Reservation_service.search_assignments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js) | [![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js,samples/README.md) | +| Reservation_service.split_capacity_commitment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js) | [![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js,samples/README.md) | +| Reservation_service.update_assignment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js) | [![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js,samples/README.md) | +| Reservation_service.update_bi_reservation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js) | [![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js,samples/README.md) | +| Reservation_service.update_capacity_commitment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js) | [![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js,samples/README.md) | +| Reservation_service.update_reservation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js) | [![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/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-bigquery-reservation/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/test/quickstart.js,samples/README.md) | @@ -149,7 +171,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-bigquery-reservation/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`) @@ -161,7 +183,7 @@ to its templates in Apache Version 2.0 -See [LICENSE](https://github.com/googleapis/nodejs-bigquery-reservation/blob/main/LICENSE) +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [client-docs]: https://cloud.google.com/nodejs/docs/reference/bigquery-reservation/latest [product-docs]: https://cloud.google.com/bigquery/docs/reference/reservations diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index 137bb85e7ad..91a96d2015a 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -34,8 +34,8 @@ "prelint": "cd samples; npm link ../; npm i", "lint": "gts check", "prepare": "npm run compile-protos && npm run compile", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "system-test": "c8 mocha build/system-test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "system-test": "npm run compile && c8 mocha build/system-test", "test": "c8 mocha build/test" }, "dependencies": { diff --git a/packages/google-cloud-bigquery-reservation/samples/README.md b/packages/google-cloud-bigquery-reservation/samples/README.md index d51af5fa62e..ad941a328f2 100644 --- a/packages/google-cloud-bigquery-reservation/samples/README.md +++ b/packages/google-cloud-bigquery-reservation/samples/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Google BigQuery Reservation: Node.js Samples](https://github.com/googleapis/nodejs-bigquery-reservation) +# [Google BigQuery Reservation: Node.js Samples](https://github.com/googleapis/google-cloud-node) [![Open in Cloud Shell][shell_img]][shell_link] @@ -12,12 +12,34 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Reservation_service.create_assignment](#reservation_service.create_assignment) + * [Reservation_service.create_capacity_commitment](#reservation_service.create_capacity_commitment) + * [Reservation_service.create_reservation](#reservation_service.create_reservation) + * [Reservation_service.delete_assignment](#reservation_service.delete_assignment) + * [Reservation_service.delete_capacity_commitment](#reservation_service.delete_capacity_commitment) + * [Reservation_service.delete_reservation](#reservation_service.delete_reservation) + * [Reservation_service.get_bi_reservation](#reservation_service.get_bi_reservation) + * [Reservation_service.get_capacity_commitment](#reservation_service.get_capacity_commitment) + * [Reservation_service.get_reservation](#reservation_service.get_reservation) + * [Reservation_service.list_assignments](#reservation_service.list_assignments) + * [Reservation_service.list_capacity_commitments](#reservation_service.list_capacity_commitments) + * [Reservation_service.list_reservations](#reservation_service.list_reservations) + * [Reservation_service.merge_capacity_commitments](#reservation_service.merge_capacity_commitments) + * [Reservation_service.move_assignment](#reservation_service.move_assignment) + * [Reservation_service.search_all_assignments](#reservation_service.search_all_assignments) + * [Reservation_service.search_assignments](#reservation_service.search_assignments) + * [Reservation_service.split_capacity_commitment](#reservation_service.split_capacity_commitment) + * [Reservation_service.update_assignment](#reservation_service.update_assignment) + * [Reservation_service.update_bi_reservation](#reservation_service.update_bi_reservation) + * [Reservation_service.update_capacity_commitment](#reservation_service.update_capacity_commitment) + * [Reservation_service.update_reservation](#reservation_service.update_reservation) + * [Quickstart](#quickstart) * [Quickstart](#quickstart) ## Before you begin Before running the samples, make sure you've followed the steps outlined in -[Using the client library](https://github.com/googleapis/nodejs-bigquery-reservation#using-the-client-library). +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). `cd samples` @@ -29,16 +51,390 @@ Before running the samples, make sure you've followed the steps outlined in +### Reservation_service.create_assignment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js). + +[![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js` + + +----- + + + + +### Reservation_service.create_capacity_commitment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js). + +[![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js` + + +----- + + + + +### Reservation_service.create_reservation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js). + +[![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js` + + +----- + + + + +### Reservation_service.delete_assignment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js). + +[![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js` + + +----- + + + + +### Reservation_service.delete_capacity_commitment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js). + +[![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js` + + +----- + + + + +### Reservation_service.delete_reservation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js). + +[![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js` + + +----- + + + + +### Reservation_service.get_bi_reservation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js). + +[![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js` + + +----- + + + + +### Reservation_service.get_capacity_commitment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js). + +[![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js` + + +----- + + + + +### Reservation_service.get_reservation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js). + +[![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js` + + +----- + + + + +### Reservation_service.list_assignments + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js). + +[![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js` + + +----- + + + + +### Reservation_service.list_capacity_commitments + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js). + +[![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js` + + +----- + + + + +### Reservation_service.list_reservations + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js). + +[![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js` + + +----- + + + + +### Reservation_service.merge_capacity_commitments + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js). + +[![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js` + + +----- + + + + +### Reservation_service.move_assignment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js). + +[![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js` + + +----- + + + + +### Reservation_service.search_all_assignments + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js). + +[![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js` + + +----- + + + + +### Reservation_service.search_assignments + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js). + +[![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js` + + +----- + + + + +### Reservation_service.split_capacity_commitment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js). + +[![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js` + + +----- + + + + +### Reservation_service.update_assignment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js). + +[![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js` + + +----- + + + + +### Reservation_service.update_bi_reservation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js). + +[![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js` + + +----- + + + + +### Reservation_service.update_capacity_commitment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js). + +[![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js` + + +----- + + + + +### Reservation_service.update_reservation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js). + +[![Open in Cloud 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-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/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-bigquery-reservation/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-bigquery-reservation/samples/quickstart.js` + + +----- + + + + ### Quickstart -View the [source code](https://github.com/googleapis/nodejs-bigquery-reservation/blob/main/samples/quickstart.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigquery-reservation&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-bigquery-reservation/samples/test/quickstart.js,samples/README.md) __Usage:__ -`node samples/quickstart.js` +`node packages/google-cloud-bigquery-reservation/samples/test/quickstart.js` @@ -46,5 +442,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-bigquery-reservation&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/bigquery/docs/reference/reservations diff --git a/packages/google-cloud-bigquery-reservation/src/index.ts b/packages/google-cloud-bigquery-reservation/src/index.ts index 228457ddf0b..0ce0e5367a4 100644 --- a/packages/google-cloud-bigquery-reservation/src/index.ts +++ b/packages/google-cloud-bigquery-reservation/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 231ec839fd4..d887860dd7b 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -10,6 +10,7 @@ "packages/google-cloud-bigquery-analyticshub": {}, "packages/google-cloud-bigquery-datapolicies": {}, "packages/google-cloud-bigquery-datatransfer": {}, + "packages/google-cloud-bigquery-reservation": {}, "packages/google-cloud-gkemulticloud": {}, "packages/google-cloud-language": {}, "packages/google-cloud-oslogin": {}, From 9f98f129f74df607405949f25f4c3a3a921e5382 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Thu, 13 Oct 2022 00:08:05 -0700 Subject: [PATCH 100/105] Update quickstart.js --- .../samples/test/quickstart.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js b/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js index 09198cd009c..9552e767918 100644 --- a/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js +++ b/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js @@ -20,13 +20,19 @@ const {assert} = require('chai'); const cp = require('child_process'); -const {describe, it} = require('mocha'); - +const {before, describe, it} = require('mocha'); +const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation'); +const client = new ReservationServiceClient(); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); const project = process.env.GCLOUD_PROJECT; describe('Quickstart', () => { + let projectId; + before(() => { + projectId = client.getProjectId(); + }); + it('should run quickstart', async () => { const stdout = execSync(`node ./quickstart.js ${project}`); assert.match(stdout, /found [0-9]+ reservations/); From 9c88b4d6d55551da564adf91b302162f93b7dfa6 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Thu, 13 Oct 2022 00:14:20 -0700 Subject: [PATCH 101/105] run lint --- .../samples/test/quickstart.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js b/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js index 9552e767918..3cbdaa0f5d7 100644 --- a/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js +++ b/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js @@ -21,20 +21,20 @@ const {assert} = require('chai'); const cp = require('child_process'); const {before, describe, it} = require('mocha'); -const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation'); +const { + ReservationServiceClient, +} = require('@google-cloud/bigquery-reservation'); const client = new ReservationServiceClient(); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); -const project = process.env.GCLOUD_PROJECT; - describe('Quickstart', () => { let projectId; before(() => { projectId = client.getProjectId(); }); - + it('should run quickstart', async () => { - const stdout = execSync(`node ./quickstart.js ${project}`); + const stdout = execSync(`node ./quickstart.js ${projectId}`); assert.match(stdout, /found [0-9]+ reservations/); assert.match(stdout, /found [0-9]+ commitments/); }); From 9405057b011d298f7d6eab19bbe676d10152dc4e Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Thu, 13 Oct 2022 00:17:29 -0700 Subject: [PATCH 102/105] Update quickstart.js --- .../samples/test/quickstart.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js b/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js index 3cbdaa0f5d7..ce0fa95b60c 100644 --- a/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js +++ b/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js @@ -30,7 +30,7 @@ const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); describe('Quickstart', () => { let projectId; before(() => { - projectId = client.getProjectId(); + projectId = await client.getProjectId(); }); it('should run quickstart', async () => { From 7db26df3f262da99fbbdbc16e4dba9155793b22a Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 13 Oct 2022 07:18:43 +0000 Subject: [PATCH 103/105] =?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 --- .../samples/test/quickstart.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js b/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js index 9552e767918..22a976cdd3b 100644 --- a/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js +++ b/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js @@ -21,7 +21,9 @@ const {assert} = require('chai'); const cp = require('child_process'); const {before, describe, it} = require('mocha'); -const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation'); +const { + ReservationServiceClient, +} = require('@google-cloud/bigquery-reservation'); const client = new ReservationServiceClient(); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); @@ -32,7 +34,7 @@ describe('Quickstart', () => { before(() => { projectId = client.getProjectId(); }); - + it('should run quickstart', async () => { const stdout = execSync(`node ./quickstart.js ${project}`); assert.match(stdout, /found [0-9]+ reservations/); From ce9f7b728faf6ac1bfe3d40d13815f2c42dc95ed Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Thu, 13 Oct 2022 00:34:23 -0700 Subject: [PATCH 104/105] run lint --- .../samples/test/quickstart.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js b/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js index ce0fa95b60c..316b9ec80c8 100644 --- a/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js +++ b/packages/google-cloud-bigquery-reservation/samples/test/quickstart.js @@ -29,7 +29,7 @@ const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); describe('Quickstart', () => { let projectId; - before(() => { + before(async () => { projectId = await client.getProjectId(); }); From fd68be32fad0bdf44d13c74bf261f16999887736 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 13 Oct 2022 08:06:50 +0000 Subject: [PATCH 105/105] =?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-bigquery-dataexchange/README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-bigquery-dataexchange/README.md b/packages/google-cloud-bigquery-dataexchange/README.md index 65b66e7eb39..6d5368f71cc 100644 --- a/packages/google-cloud-bigquery-dataexchange/README.md +++ b/packages/google-cloud-bigquery-dataexchange/README.md @@ -4,7 +4,7 @@ # [Analytics Hub API: Node.js Client](https://github.com/googleapis/google-cloud-node) -[![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-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/bigquery-data-exchange.svg)](https://www.npmjs.org/package/@google-cloud/bigquery-data-exchange) @@ -159,13 +159,12 @@ This library follows [Semantic Versioning](http://semver.org/). -This library is considered to be in **beta**. This means it is expected to be -mostly stable while we work toward a general availability release; however, -complete stability is not guaranteed. We will address issues and requests -against beta libraries with a high priority. +This library is considered to be in **preview**. This means it is still a +work-in-progress and under active development. Any release is subject to +backwards-incompatible changes at any time. More Information: [Google Cloud Platform Launch Stages][launch_stages]