From 17030a109ddb6b8f2078577fc1188b4dc3f67456 Mon Sep 17 00:00:00 2001 From: steffnay Date: Fri, 13 Dec 2019 16:20:08 -0800 Subject: [PATCH 001/182] chore: add initial files for launch --- .../CODE_OF_CONDUCT.md | 43 ++++ .../CONTRIBUTING.md | 65 ++++++ .../google-cloud-bigquery-storage/LICENSE | 202 ++++++++++++++++++ .../google-cloud-bigquery-storage/README.md | 2 + .../google-cloud-bigquery-storage/synth.py | 42 ++++ 5 files changed, 354 insertions(+) create mode 100644 packages/google-cloud-bigquery-storage/CODE_OF_CONDUCT.md create mode 100644 packages/google-cloud-bigquery-storage/CONTRIBUTING.md create mode 100644 packages/google-cloud-bigquery-storage/LICENSE create mode 100644 packages/google-cloud-bigquery-storage/README.md create mode 100644 packages/google-cloud-bigquery-storage/synth.py diff --git a/packages/google-cloud-bigquery-storage/CODE_OF_CONDUCT.md b/packages/google-cloud-bigquery-storage/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..46b2a08ea6d --- /dev/null +++ b/packages/google-cloud-bigquery-storage/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-storage/CONTRIBUTING.md b/packages/google-cloud-bigquery-storage/CONTRIBUTING.md new file mode 100644 index 00000000000..f6c4cf010e3 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/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-storage/LICENSE b/packages/google-cloud-bigquery-storage/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/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-storage/README.md b/packages/google-cloud-bigquery-storage/README.md new file mode 100644 index 00000000000..a966ebe8497 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/README.md @@ -0,0 +1,2 @@ +# Node.js Client for BigQuery Storage API +This is a generated README.md placeholder. Put your own documentation here. \ No newline at end of file diff --git a/packages/google-cloud-bigquery-storage/synth.py b/packages/google-cloud-bigquery-storage/synth.py new file mode 100644 index 00000000000..a45d81d2398 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/synth.py @@ -0,0 +1,42 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""This 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.GAPICGenerator() +versions = ['v1beta1'] +for version in versions: + library = gapic.node_library( + 'bigquery_storage', + version, + config_path="/google/cloud/bigquery/storage/" "artman_bigquerystorage_v1beta1.yaml", + artman_output_name="bigquerystorage-v1beta1", + include_protos=True,) + s.copy(library, excludes=[]) + +# Copy common templates +common_templates = gcp.CommonTemplates() +templates = common_templates.node_library() +s.copy(templates, excludes=[]) + +# Node.js specific cleanup +subprocess.run(['npm', 'install']) +subprocess.run(['npm', 'run', 'fix']) \ No newline at end of file From 70b919aa9052d27a9f3c1ebeeac4f80296eaabb7 Mon Sep 17 00:00:00 2001 From: steffnay Date: Wed, 8 Jan 2020 11:17:14 -0800 Subject: [PATCH 002/182] updated build file --- .../google-cloud-bigquery-storage/synth.py | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/synth.py b/packages/google-cloud-bigquery-storage/synth.py index a45d81d2398..f9620996bce 100644 --- a/packages/google-cloud-bigquery-storage/synth.py +++ b/packages/google-cloud-bigquery-storage/synth.py @@ -1,4 +1,4 @@ -# Copyright 2019 Google LLC +# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,31 +12,31 @@ # 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.GAPICGenerator() +# Run the gapic generator +gapic = gcp.GAPICMicrogenerator() +name = 'bigquerystorage' versions = ['v1beta1'] for version in versions: - library = gapic.node_library( - 'bigquery_storage', - version, - config_path="/google/cloud/bigquery/storage/" "artman_bigquerystorage_v1beta1.yaml", - artman_output_name="bigquerystorage-v1beta1", - include_protos=True,) - s.copy(library, excludes=[]) - + library = gapic.typescript_library( + name, + version, + proto_path=f'google/cloud/bigquery/storage/{version}', + generator_args={ + 'grpc-service-config': f'google/cloud/bigquery/storage/{version}/{name}_grpc_service_config.json', + 'package-name': f'@google-cloud/bigquery-storage', + }, + ) + s.copy(library, excludes=['README.md']) # Copy common templates common_templates = gcp.CommonTemplates() -templates = common_templates.node_library() +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']) \ No newline at end of file +subprocess.run(['npm', 'run', 'fix']) +subprocess.run(['npx', 'compileProtos', 'src']) \ No newline at end of file From 4ebdad41e1078fc9063501f2e0cdb953f8a4d3ca Mon Sep 17 00:00:00 2001 From: Steffany Brown <30247553+steffnay@users.noreply.github.com> Date: Thu, 20 Feb 2020 13:10:03 -0800 Subject: [PATCH 003/182] feat!: initial generation of library (#1) * initial generation * feat: add initial functionality * update quickstart * quickstart * regenerates library and adds quickstart * docs: updates README and samples/README * docs: update metadata, dependencies, & quickstart * chore: rerun synthtool * chore: rerun synthtool * test: updates tests * test: linted * chore: does advice actually work Co-authored-by: Benjamin E. Coe --- .../.eslintignore | 5 + .../.eslintrc.yml | 15 + .../google-cloud-bigquery-storage/.gitignore | 14 + .../google-cloud-bigquery-storage/.jsdoc.js | 48 + .../.mocharc.json | 5 + packages/google-cloud-bigquery-storage/.nycrc | 24 + .../.prettierignore | 3 + .../google-cloud-bigquery-storage/.prettierrc | 8 + .../.repo-metadata.json | 12 + .../google-cloud-bigquery-storage/README.md | 230 +- .../codecov.yaml | 4 + .../linkinator.config.json | 11 + .../package.json | 56 + .../bigquery/storage/v1beta1/arrow.proto | 37 + .../cloud/bigquery/storage/v1beta1/avro.proto | 38 + .../storage/v1beta1/read_options.proto | 41 + .../bigquery/storage/v1beta1/storage.proto | 405 + .../storage/v1beta1/table_reference.proto | 43 + .../protos/protos.d.ts | 6137 ++++++ .../protos/protos.js | 15841 ++++++++++++++++ .../protos/protos.json | 1532 ++ .../samples/README.md | 52 + .../samples/package.json | 25 + .../samples/quickstart.js | 147 + .../samples/test/quickstart.js | 33 + .../src/index.ts | 24 + .../src/v1beta1/big_query_storage_client.ts | 833 + .../big_query_storage_client_config.json | 54 + .../v1beta1/big_query_storage_proto_list.json | 7 + .../src/v1beta1/index.ts | 19 + .../synth.metadata | 38 + .../google-cloud-bigquery-storage/synth.py | 2 +- .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 25 + .../system-test/install.ts | 51 + .../test/gapic-big_query_storage-v1beta1.ts | 372 + .../tsconfig.json | 19 + .../google-cloud-bigquery-storage/tslint.json | 3 + .../webpack.config.js | 64 + 39 files changed, 26301 insertions(+), 3 deletions(-) create mode 100644 packages/google-cloud-bigquery-storage/.eslintignore create mode 100644 packages/google-cloud-bigquery-storage/.eslintrc.yml create mode 100644 packages/google-cloud-bigquery-storage/.gitignore create mode 100644 packages/google-cloud-bigquery-storage/.jsdoc.js create mode 100644 packages/google-cloud-bigquery-storage/.mocharc.json create mode 100644 packages/google-cloud-bigquery-storage/.nycrc create mode 100644 packages/google-cloud-bigquery-storage/.prettierignore create mode 100644 packages/google-cloud-bigquery-storage/.prettierrc create mode 100644 packages/google-cloud-bigquery-storage/.repo-metadata.json create mode 100644 packages/google-cloud-bigquery-storage/codecov.yaml create mode 100644 packages/google-cloud-bigquery-storage/linkinator.config.json create mode 100644 packages/google-cloud-bigquery-storage/package.json create mode 100644 packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/arrow.proto create mode 100644 packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/avro.proto create mode 100644 packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/read_options.proto create mode 100644 packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/storage.proto create mode 100644 packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/table_reference.proto create mode 100644 packages/google-cloud-bigquery-storage/protos/protos.d.ts create mode 100644 packages/google-cloud-bigquery-storage/protos/protos.js create mode 100644 packages/google-cloud-bigquery-storage/protos/protos.json create mode 100644 packages/google-cloud-bigquery-storage/samples/README.md create mode 100644 packages/google-cloud-bigquery-storage/samples/package.json create mode 100644 packages/google-cloud-bigquery-storage/samples/quickstart.js create mode 100644 packages/google-cloud-bigquery-storage/samples/test/quickstart.js create mode 100644 packages/google-cloud-bigquery-storage/src/index.ts create mode 100644 packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts create mode 100644 packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client_config.json create mode 100644 packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_proto_list.json create mode 100644 packages/google-cloud-bigquery-storage/src/v1beta1/index.ts create mode 100644 packages/google-cloud-bigquery-storage/synth.metadata create mode 100644 packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js create mode 100644 packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts create mode 100644 packages/google-cloud-bigquery-storage/system-test/install.ts create mode 100644 packages/google-cloud-bigquery-storage/test/gapic-big_query_storage-v1beta1.ts create mode 100644 packages/google-cloud-bigquery-storage/tsconfig.json create mode 100644 packages/google-cloud-bigquery-storage/tslint.json create mode 100644 packages/google-cloud-bigquery-storage/webpack.config.js diff --git a/packages/google-cloud-bigquery-storage/.eslintignore b/packages/google-cloud-bigquery-storage/.eslintignore new file mode 100644 index 00000000000..09b31fe735a --- /dev/null +++ b/packages/google-cloud-bigquery-storage/.eslintignore @@ -0,0 +1,5 @@ +**/node_modules +src/**/doc/* +build/ +docs/ +protos/ diff --git a/packages/google-cloud-bigquery-storage/.eslintrc.yml b/packages/google-cloud-bigquery-storage/.eslintrc.yml new file mode 100644 index 00000000000..73eeec27612 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/.eslintrc.yml @@ -0,0 +1,15 @@ +--- +extends: + - 'eslint:recommended' + - 'plugin:node/recommended' + - prettier +plugins: + - node + - prettier +rules: + prettier/prettier: error + block-scoped-var: error + eqeqeq: error + no-warning-comments: warn + no-var: error + prefer-const: error diff --git a/packages/google-cloud-bigquery-storage/.gitignore b/packages/google-cloud-bigquery-storage/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-bigquery-storage/.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-storage/.jsdoc.js b/packages/google-cloud-bigquery-storage/.jsdoc.js new file mode 100644 index 00000000000..719a77bf2e9 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/.jsdoc.js @@ -0,0 +1,48 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +'use strict'; + +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' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2018 Google, LLC.', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/bigquery-storage', + theme: 'lumen' + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-bigquery-storage/.mocharc.json b/packages/google-cloud-bigquery-storage/.mocharc.json new file mode 100644 index 00000000000..670c5e2c24b --- /dev/null +++ b/packages/google-cloud-bigquery-storage/.mocharc.json @@ -0,0 +1,5 @@ +{ + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} diff --git a/packages/google-cloud-bigquery-storage/.nycrc b/packages/google-cloud-bigquery-storage/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/.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-storage/.prettierignore b/packages/google-cloud-bigquery-storage/.prettierignore new file mode 100644 index 00000000000..f6fac98b0a8 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/.prettierignore @@ -0,0 +1,3 @@ +node_modules/* +samples/node_modules/* +src/**/doc/* diff --git a/packages/google-cloud-bigquery-storage/.prettierrc b/packages/google-cloud-bigquery-storage/.prettierrc new file mode 100644 index 00000000000..df6eac07446 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/.prettierrc @@ -0,0 +1,8 @@ +--- +bracketSpacing: false +printWidth: 80 +semi: true +singleQuote: true +tabWidth: 2 +trailingComma: es5 +useTabs: false diff --git a/packages/google-cloud-bigquery-storage/.repo-metadata.json b/packages/google-cloud-bigquery-storage/.repo-metadata.json new file mode 100644 index 00000000000..e417e6a9678 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/.repo-metadata.json @@ -0,0 +1,12 @@ +{ + "name": "bigquerystorage", + "name_pretty": "Google BigQuery Storage", + "product_documentation": "https://cloud.google.com/bigquery/docs/reference/storage", + "issue_tracker": "https://b.corp.google.com/savedsearches/559654", + "release_level": "beta", + "language": "nodejs", + "repo": "googleapis/nodejs-bigquery-storage", + "distribution_name": "@google-cloud/bigquery-storage", + "api_id": "bigquerystorage.googleapis.com", + "requires_billing": true + } diff --git a/packages/google-cloud-bigquery-storage/README.md b/packages/google-cloud-bigquery-storage/README.md index a966ebe8497..21c1c791ab3 100644 --- a/packages/google-cloud-bigquery-storage/README.md +++ b/packages/google-cloud-bigquery-storage/README.md @@ -1,2 +1,228 @@ -# Node.js Client for BigQuery Storage API -This is a generated README.md placeholder. Put your own documentation here. \ No newline at end of file +[//]: # "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 Storage: Node.js Client](https://github.com/googleapis/nodejs-bigquery-storage) + +[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/bigquery-storage.svg)](https://www.npmjs.org/package/@google-cloud/bigquery-storage) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-bigquery-storage/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-bigquery-storage) + + + + +Client for the BigQuery Storage API + + + +* [Google BigQuery Storage Documentation][product-docs] +* [github.com/googleapis/nodejs-bigquery-storage](https://github.com/googleapis/nodejs-bigquery-storage) + +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 Storage 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-storage +``` + + +### Using the client library + +```javascript + + // The read stream contains blocks of Avro-encoded bytes. We use the + // 'avsc' library to decode these blocks. Install avsc with the following + // command: npm install avsc + const avro = require('avsc'); + + // See reference documentation at + // https://cloud.google.com/bigquery/docs/reference/storage + const bqStorage = require('@google-cloud/bigquery-storage').v1beta1 + .BigQueryStorageClient; + + const client = new bqStorage(); + + async function bigqueryStorageQuickstart() { + // Get current project ID. The read session is created in this project. + // This project can be different from that which contains the table. + const myProjectId = await client.getProjectId(); + + // This example reads baby name data from the public datasets. + const projectId = 'bigquery-public-data'; + const datasetId = 'usa_names'; + const tableId = 'usa_1910_current'; + + const tableReference = { + projectId, + datasetId, + tableId, + }; + + const parent = `projects/${myProjectId}`; + + /* We limit the output columns to a subset of those allowed in the table, + * and set a simple filter to only report names from the state of + * Washington (WA). + */ + const readOptions = { + selectedFields: ['name', 'number', 'state'], + rowRestriction: 'state = "WA"', + }; + + let tableModifiers = null; + const snapshotSeconds = 0; + + // Set a snapshot time if it's been specified. + if (snapshotSeconds > 0) { + tableModifiers = {snapshotTime: {seconds: snapshotSeconds}}; + } + + // API request. + const request = { + tableReference, + parent, + readOptions, + tableModifiers, + // This API can also deliver data serialized in Apache Arrow format. + // This example leverages Apache Avro. + format: 'AVRO', + /* We use a LIQUID strategy in this example because we only read from a + * single stream. Consider BALANCED if you're consuming multiple streams + * concurrently and want more consistent stream sizes. + */ + shardingStrategy: 'LIQUID', + }; + + const [session] = await client.createReadSession(request); + + const schema = JSON.parse(session.avroSchema.schema); + + const avroType = avro.Type.forSchema(schema); + + /* The offset requested must be less than the last + * row read from ReadRows. Requesting a larger offset is + * undefined. + */ + let offset = 0; + + const readRowsRequest = { + // Optional stream name or offset. Offset requested must be less than the last + // row read from readRows(). Requesting a larger offset is undefined. + readPosition: { + stream: session.streams[0], + offset, + }, + }; + + const names = new Set(); + const states = {}; + + /* We'll use only a single stream for reading data from the table. Because + * of dynamic sharding, this will yield all the rows in the table. However, + * if you wanted to fan out multiple readers you could do so by having a + * reader process each individual stream. + */ + client + .readRows(readRowsRequest) + .on('error', console.error) + .on('data', function(data) { + try { + const decodedData = avroType.decode( + data.avroRows.serializedBinaryRows + ); + + names.add(decodedData.value.name); + + if (!states[decodedData.value.state]) { + states[decodedData.value.state] = true; + } + + offset = decodedData.offset; + } catch (error) { + console.log(error); + } + }) + .on('end', function() { + console.log( + `Got ${names.size} unique names in states: ${Object.keys(states)}` + ); + console.log(`Last offset: ${offset}`); + }); + } + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-bigquery-storage/tree/master/samples) directory. The samples' `README.md` +has instructions for running the samples. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| BigQuery Storage Quickstart | [source code](https://github.com/googleapis/nodejs-bigquery-storage/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-storage&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | + + + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be in **beta**. This means it is expected to be +mostly stable while we work toward a general availability release; however, +complete stability is not guaranteed. We will address issues and requests +against beta libraries with a high priority. + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-bigquery-storage/blob/master/CONTRIBUTING.md). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-bigquery-storage/blob/master/LICENSE) + + +[product-docs]: https://cloud.google.com/bigquery/docs/reference/storage +[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=bigquerystorage.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-bigquery-storage/codecov.yaml b/packages/google-cloud-bigquery-storage/codecov.yaml new file mode 100644 index 00000000000..5724ea9478d --- /dev/null +++ b/packages/google-cloud-bigquery-storage/codecov.yaml @@ -0,0 +1,4 @@ +--- +codecov: + ci: + - source.cloud.google.com diff --git a/packages/google-cloud-bigquery-storage/linkinator.config.json b/packages/google-cloud-bigquery-storage/linkinator.config.json new file mode 100644 index 00000000000..a4a25c7baee --- /dev/null +++ b/packages/google-cloud-bigquery-storage/linkinator.config.json @@ -0,0 +1,11 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://www.npmjs.org/package/@google-cloud/bigquery-storage", + "https://github.com/googleapis/nodejs-bigquery-storage/tree/master/samples", + "https://github.com/googleapis/nodejs-bigquery-storage/blob/master/samples/quickstart.js" + ] +} diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json new file mode 100644 index 00000000000..90fd02d8399 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/package.json @@ -0,0 +1,56 @@ +{ + "name": "@google-cloud/bigquery-storage", + "version": "0.1.0", + "description": "Client for the BigQuery Storage API", + "repository": "googleapis/nodejs-bigquery-storage", + "license": "Apache-2.0", + "author": "Google LLC", + "files": [ + "build/src", + "build/protos" + ], + "main": "build/src/index.js", + "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 && eslint samples --fix", + "prelint": "cd samples; npm link ../; npm i", + "lint": "gts check && eslint samples", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm test && cd ../" + }, + "dependencies": { + "google-gax": "^1.14.1" + }, + "devDependencies": { + "@types/mocha": "^7.0.1", + "@types/node": "^13.7.1", + "c8": "^7.1.0", + "gts": "^1.1.2", + "jsdoc": "^3.6.3", + "jsdoc-fresh": "^1.0.2", + "jsdoc-region-tag": "^1.0.4", + "linkinator": "^2.0.1", + "mocha": "^7.0.1", + "pack-n-play": "^1.0.0-2", + "null-loader": "^3.0.0", + "ts-loader": "^6.2.1", + "typescript": "~3.7.5", + "webpack": "^4.41.6", + "webpack-cli": "^3.3.11", + "eslint": "^6.8.0", + "eslint-config-prettier": "^6.10.0", + "eslint-plugin-node": "^11.0.0", + "eslint-plugin-prettier": "^3.1.2", + "prettier": "^1.19.1" + }, + "engines": { + "node": ">=8.13.0" + } +} diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/arrow.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/arrow.proto new file mode 100644 index 00000000000..3003de444c2 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/arrow.proto @@ -0,0 +1,37 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.bigquery.storage.v1beta1; + +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta1;storage"; +option java_outer_classname = "ArrowProto"; +option java_package = "com.google.cloud.bigquery.storage.v1beta1"; + +// Arrow schema. +message ArrowSchema { + // IPC serialized Arrow schema. + bytes serialized_schema = 1; +} + +// Arrow RecordBatch. +message ArrowRecordBatch { + // IPC serialized Arrow RecordBatch. + bytes serialized_record_batch = 1; + + // The count of rows in the returning block. + int64 row_count = 2; +} diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/avro.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/avro.proto new file mode 100644 index 00000000000..021d8e44f9f --- /dev/null +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/avro.proto @@ -0,0 +1,38 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.bigquery.storage.v1beta1; + +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta1;storage"; +option java_outer_classname = "AvroProto"; +option java_package = "com.google.cloud.bigquery.storage.v1beta1"; + +// Avro schema. +message AvroSchema { + // Json serialized schema, as described at + // https://avro.apache.org/docs/1.8.1/spec.html + string schema = 1; +} + +// Avro rows. +message AvroRows { + // Binary serialized rows in a block. + bytes serialized_binary_rows = 1; + + // The count of rows in the returning block. + int64 row_count = 2; +} diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/read_options.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/read_options.proto new file mode 100644 index 00000000000..9591deba7f4 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/read_options.proto @@ -0,0 +1,41 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.bigquery.storage.v1beta1; + +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta1;storage"; +option java_package = "com.google.cloud.bigquery.storage.v1beta1"; + +// Options dictating how we read a table. +message TableReadOptions { + // Optional. Names of the fields in the table that should be read. If empty, + // all fields will be read. If the specified field is a nested field, all the + // sub-fields in the field will be selected. The output field order is + // unrelated to the order of fields in selected_fields. + repeated string selected_fields = 1; + + // Optional. SQL text filtering statement, similar to a WHERE clause in + // a query. Currently, only a single predicate that is a comparison between + // a column and a constant value is supported. Aggregates are not supported. + // + // Examples: "int_field > 5" + // "date_field = CAST('2014-9-27' as DATE)" + // "nullable_field is not NULL" + // "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))" + // "numeric_field BETWEEN 1.0 AND 5.0" + string row_restriction = 2; +} diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/storage.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/storage.proto new file mode 100644 index 00000000000..22f742fbb65 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/storage.proto @@ -0,0 +1,405 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.bigquery.storage.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/bigquery/storage/v1beta1/arrow.proto"; +import "google/cloud/bigquery/storage/v1beta1/avro.proto"; +import "google/cloud/bigquery/storage/v1beta1/read_options.proto"; +import "google/cloud/bigquery/storage/v1beta1/table_reference.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta1;storage"; +option java_package = "com.google.cloud.bigquery.storage.v1beta1"; + +// BigQuery storage API. +// +// The BigQuery storage API can be used to read data stored in BigQuery. +service BigQueryStorage { + option (google.api.default_host) = "bigquerystorage.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigquery," + "https://www.googleapis.com/auth/bigquery.readonly," + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a new read session. A read session divides the contents of a + // BigQuery table into one or more streams, which can then be used to read + // data from the table. The read session also specifies properties of the + // data to be read, such as a list of columns or a push-down filter describing + // the rows to be returned. + // + // A particular row can be read by at most one stream. When the caller has + // reached the end of each stream in the session, then all the data in the + // table has been read. + // + // Read sessions automatically expire 24 hours after they are created and do + // not require manual clean-up by the caller. + rpc CreateReadSession(CreateReadSessionRequest) returns (ReadSession) { + option (google.api.http) = { + post: "/v1beta1/{table_reference.project_id=projects/*}" + body: "*" + additional_bindings { + post: "/v1beta1/{table_reference.dataset_id=projects/*/datasets/*}" + body: "*" + } + }; + option (google.api.method_signature) = "table_reference,parent,requested_streams"; + } + + // Reads rows from the table in the format prescribed by the read session. + // Each response contains one or more table rows, up to a maximum of 10 MiB + // per response; read requests which attempt to read individual rows larger + // than this will fail. + // + // Each request also returns a set of stream statistics reflecting the + // estimated total number of rows in the read stream. This number is computed + // based on the total table size and the number of active streams in the read + // session, and may change as other streams continue to read data. + rpc ReadRows(ReadRowsRequest) returns (stream ReadRowsResponse) { + option (google.api.http) = { + get: "/v1beta1/{read_position.stream.name=projects/*/streams/*}" + }; + option (google.api.method_signature) = "read_position"; + } + + // Creates additional streams for a ReadSession. This API can be used to + // dynamically adjust the parallelism of a batch processing task upwards by + // adding additional workers. + rpc BatchCreateReadSessionStreams(BatchCreateReadSessionStreamsRequest) returns (BatchCreateReadSessionStreamsResponse) { + option (google.api.http) = { + post: "/v1beta1/{session.name=projects/*/sessions/*}" + body: "*" + }; + option (google.api.method_signature) = "session,requested_streams"; + } + + // Triggers the graceful termination of a single stream in a ReadSession. This + // API can be used to dynamically adjust the parallelism of a batch processing + // task downwards without losing data. + // + // This API does not delete the stream -- it remains visible in the + // ReadSession, and any data processed by the stream is not released to other + // streams. However, no additional data will be assigned to the stream once + // this call completes. Callers must continue reading data on the stream until + // the end of the stream is reached so that data which has already been + // assigned to the stream will be processed. + // + // This method will return an error if there are no other live streams + // in the Session, or if SplitReadStream() has been called on the given + // Stream. + rpc FinalizeStream(FinalizeStreamRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{stream.name=projects/*/streams/*}" + body: "*" + }; + option (google.api.method_signature) = "stream"; + } + + // Splits a given read stream into two Streams. These streams are referred to + // as the primary and the residual of the split. The original stream can still + // be read from in the same manner as before. Both of the returned streams can + // also be read from, and the total rows return by both child streams will be + // the same as the rows read from the original stream. + // + // Moreover, the two child streams will be allocated back to back in the + // original Stream. Concretely, it is guaranteed that for streams Original, + // Primary, and Residual, that Original[0-j] = Primary[0-j] and + // Original[j-n] = Residual[0-m] once the streams have been read to + // completion. + // + // This method is guaranteed to be idempotent. + rpc SplitReadStream(SplitReadStreamRequest) returns (SplitReadStreamResponse) { + option (google.api.http) = { + get: "/v1beta1/{original_stream.name=projects/*/streams/*}" + }; + option (google.api.method_signature) = "original_stream"; + } +} + +// Information about a single data stream within a read session. +message Stream { + option (google.api.resource) = { + type: "bigquerystorage.googleapis.com/Stream" + pattern: "projects/{project}/locations/{location}/streams/{stream}" + }; + + // Name of the stream, in the form + // `projects/{project_id}/locations/{location}/streams/{stream_id}`. + string name = 1; +} + +// Expresses a point within a given stream using an offset position. +message StreamPosition { + // Identifier for a given Stream. + Stream stream = 1; + + // Position in the stream. + int64 offset = 2; +} + +// Information returned from a `CreateReadSession` request. +message ReadSession { + option (google.api.resource) = { + type: "bigquerystorage.googleapis.com/ReadSession" + pattern: "projects/{project}/locations/{location}/sessions/{session}" + }; + + // Unique identifier for the session, in the form + // `projects/{project_id}/locations/{location}/sessions/{session_id}`. + string name = 1; + + // Time at which the session becomes invalid. After this time, subsequent + // requests to read this Session will return errors. + google.protobuf.Timestamp expire_time = 2; + + // The schema for the read. If read_options.selected_fields is set, the + // schema may be different from the table schema as it will only contain + // the selected fields. + oneof schema { + // Avro schema. + AvroSchema avro_schema = 5; + + // Arrow schema. + ArrowSchema arrow_schema = 6; + } + + // Streams associated with this session. + repeated Stream streams = 4; + + // Table that this ReadSession is reading from. + TableReference table_reference = 7; + + // Any modifiers which are applied when reading from the specified table. + TableModifiers table_modifiers = 8; + + // The strategy to use for distributing data among the streams. + ShardingStrategy sharding_strategy = 9; +} + +// Creates a new read session, which may include additional options such as +// requested parallelism, projection filters and constraints. +message CreateReadSessionRequest { + // Required. Reference to the table to read. + TableReference table_reference = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. String of the form `projects/{project_id}` indicating the + // project this ReadSession is associated with. This is the project that will + // be billed for usage. + string parent = 6 [(google.api.field_behavior) = REQUIRED]; + + // Any modifiers to the Table (e.g. snapshot timestamp). + TableModifiers table_modifiers = 2; + + // Initial number of streams. If unset or 0, we will + // provide a value of streams so as to produce reasonable throughput. Must be + // non-negative. The number of streams may be lower than the requested number, + // depending on the amount parallelism that is reasonable for the table and + // the maximum amount of parallelism allowed by the system. + // + // Streams must be read starting from offset 0. + int32 requested_streams = 3; + + // Read options for this session (e.g. column selection, filters). + TableReadOptions read_options = 4; + + // Data output format. Currently default to Avro. + DataFormat format = 5; + + // The strategy to use for distributing data among multiple streams. Currently + // defaults to liquid sharding. + ShardingStrategy sharding_strategy = 7; +} + +// Data format for input or output data. +enum DataFormat { + // Data format is unspecified. + DATA_FORMAT_UNSPECIFIED = 0; + + // Avro is a standard open source row based file format. + // See https://avro.apache.org/ for more details. + AVRO = 1; + + ARROW = 3; +} + +// Strategy for distributing data among multiple streams in a read session. +enum ShardingStrategy { + // Same as LIQUID. + SHARDING_STRATEGY_UNSPECIFIED = 0; + + // Assigns data to each stream based on the client's read rate. The faster the + // client reads from a stream, the more data is assigned to the stream. In + // this strategy, it's possible to read all data from a single stream even if + // there are other streams present. + LIQUID = 1; + + // Assigns data to each stream such that roughly the same number of rows can + // be read from each stream. Because the server-side unit for assigning data + // is collections of rows, the API does not guarantee that each stream will + // return the same number or rows. Additionally, the limits are enforced based + // on the number of pre-filtering rows, so some filters can lead to lopsided + // assignments. + BALANCED = 2; +} + +// Requesting row data via `ReadRows` must provide Stream position information. +message ReadRowsRequest { + // Required. Identifier of the position in the stream to start reading from. + // The offset requested must be less than the last row read from ReadRows. + // Requesting a larger offset is undefined. + StreamPosition read_position = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Progress information for a given Stream. +message StreamStatus { + // Number of estimated rows in the current stream. May change over time as + // different readers in the stream progress at rates which are relatively fast + // or slow. + int64 estimated_row_count = 1; + + // A value in the range [0.0, 1.0] that represents the fraction of rows + // assigned to this stream that have been processed by the server. In the + // presence of read filters, the server may process more rows than it returns, + // so this value reflects progress through the pre-filtering rows. + // + // This value is only populated for sessions created through the BALANCED + // sharding strategy. + float fraction_consumed = 2; + + // Represents the progress of the current stream. + // + // Note: This value is under development and should not be used. Use + // `fraction_consumed` instead. + Progress progress = 4; + + // Whether this stream can be split. For sessions that use the LIQUID sharding + // strategy, this value is always false. For BALANCED sessions, this value is + // false when enough data have been read such that no more splits are possible + // at that point or beyond. For small tables or streams that are the result of + // a chain of splits, this value may never be true. + bool is_splittable = 3; +} + +message Progress { + // The fraction of rows assigned to the stream that have been processed by the + // server so far, not including the rows in the current response message. + // + // This value, along with `at_response_end`, can be used to interpolate the + // progress made as the rows in the message are being processed using the + // following formula: `at_response_start + (at_response_end - + // at_response_start) * rows_processed_from_response / rows_in_response`. + // + // Note that if a filter is provided, the `at_response_end` value of the + // previous response may not necessarily be equal to the `at_response_start` + // value of the current response. + float at_response_start = 1; + + // Similar to `at_response_start`, except that this value includes the rows in + // the current response. + float at_response_end = 2; +} + +// Information on if the current connection is being throttled. +message ThrottleStatus { + // How much this connection is being throttled. + // 0 is no throttling, 100 is completely throttled. + int32 throttle_percent = 1; +} + +// Response from calling `ReadRows` may include row data, progress and +// throttling information. +message ReadRowsResponse { + // Row data is returned in format specified during session creation. + oneof rows { + // Serialized row data in AVRO format. + AvroRows avro_rows = 3; + + // Serialized row data in Arrow RecordBatch format. + ArrowRecordBatch arrow_record_batch = 4; + } + + // Number of serialized rows in the rows block. This value is recorded here, + // in addition to the row_count values in the output-specific messages in + // `rows`, so that code which needs to record progress through the stream can + // do so in an output format-independent way. + int64 row_count = 6; + + // Estimated stream statistics. + StreamStatus status = 2; + + // Throttling status. If unset, the latest response still describes + // the current throttling status. + ThrottleStatus throttle_status = 5; +} + +// Information needed to request additional streams for an established read +// session. +message BatchCreateReadSessionStreamsRequest { + // Required. Must be a non-expired session obtained from a call to + // CreateReadSession. Only the name field needs to be set. + ReadSession session = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Number of new streams requested. Must be positive. + // Number of added streams may be less than this, see CreateReadSessionRequest + // for more information. + int32 requested_streams = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The response from `BatchCreateReadSessionStreams` returns the stream +// identifiers for the newly created streams. +message BatchCreateReadSessionStreamsResponse { + // Newly added streams. + repeated Stream streams = 1; +} + +// Request information for invoking `FinalizeStream`. +message FinalizeStreamRequest { + // Stream to finalize. + Stream stream = 2; +} + +// Request information for `SplitReadStream`. +message SplitReadStreamRequest { + // Stream to split. + Stream original_stream = 1; + + // A value in the range (0.0, 1.0) that specifies the fractional point at + // which the original stream should be split. The actual split point is + // evaluated on pre-filtered rows, so if a filter is provided, then there is + // no guarantee that the division of the rows between the new child streams + // will be proportional to this fractional value. Additionally, because the + // server-side unit for assigning data is collections of rows, this fraction + // will always map to to a data storage boundary on the server side. + float fraction = 2; +} + +// Response from `SplitReadStream`. +message SplitReadStreamResponse { + // Primary stream, which contains the beginning portion of + // |original_stream|. An empty value indicates that the original stream can no + // longer be split. + Stream primary_stream = 1; + + // Remainder stream, which contains the tail of |original_stream|. An empty + // value indicates that the original stream can no longer be split. + Stream remainder_stream = 2; +} diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/table_reference.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/table_reference.proto new file mode 100644 index 00000000000..a55dc48eb02 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/table_reference.proto @@ -0,0 +1,43 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.bigquery.storage.v1beta1; + +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta1;storage"; +option java_outer_classname = "TableReferenceProto"; +option java_package = "com.google.cloud.bigquery.storage.v1beta1"; + +// Table reference that includes just the 3 strings needed to identify a table. +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; +} + +// All fields in this message optional. +message TableModifiers { + // The snapshot time of the table. If not set, interpreted as now. + google.protobuf.Timestamp snapshot_time = 1; +} diff --git a/packages/google-cloud-bigquery-storage/protos/protos.d.ts b/packages/google-cloud-bigquery-storage/protos/protos.d.ts new file mode 100644 index 00000000000..a0b708af703 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/protos/protos.d.ts @@ -0,0 +1,6137 @@ +// 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 storage. */ + namespace storage { + + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** Properties of an ArrowSchema. */ + interface IArrowSchema { + + /** ArrowSchema serializedSchema */ + serializedSchema?: (Uint8Array|string|null); + } + + /** Represents an ArrowSchema. */ + class ArrowSchema implements IArrowSchema { + + /** + * Constructs a new ArrowSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IArrowSchema); + + /** ArrowSchema serializedSchema. */ + public serializedSchema: (Uint8Array|string); + + /** + * Creates a new ArrowSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns ArrowSchema instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IArrowSchema): google.cloud.bigquery.storage.v1beta1.ArrowSchema; + + /** + * Encodes the specified ArrowSchema message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowSchema.verify|verify} messages. + * @param message ArrowSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.IArrowSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ArrowSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowSchema.verify|verify} messages. + * @param message ArrowSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IArrowSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ArrowSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ArrowSchema + * @throws {Error} If the payload is not a 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.storage.v1beta1.ArrowSchema; + + /** + * Decodes an ArrowSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ArrowSchema + * @throws {Error} If the payload is 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.storage.v1beta1.ArrowSchema; + + /** + * Verifies an ArrowSchema message. + * @param message Plain 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 ArrowSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ArrowSchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.ArrowSchema; + + /** + * Creates a plain object from an ArrowSchema message. Also converts values to other types if specified. + * @param message ArrowSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.ArrowSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ArrowSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ArrowRecordBatch. */ + interface IArrowRecordBatch { + + /** ArrowRecordBatch serializedRecordBatch */ + serializedRecordBatch?: (Uint8Array|string|null); + + /** ArrowRecordBatch rowCount */ + rowCount?: (number|Long|string|null); + } + + /** Represents an ArrowRecordBatch. */ + class ArrowRecordBatch implements IArrowRecordBatch { + + /** + * Constructs a new ArrowRecordBatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch); + + /** ArrowRecordBatch serializedRecordBatch. */ + public serializedRecordBatch: (Uint8Array|string); + + /** ArrowRecordBatch rowCount. */ + public rowCount: (number|Long|string); + + /** + * Creates a new ArrowRecordBatch instance using the specified properties. + * @param [properties] Properties to set + * @returns ArrowRecordBatch instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch): google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch; + + /** + * Encodes the specified ArrowRecordBatch message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.verify|verify} messages. + * @param message ArrowRecordBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ArrowRecordBatch message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.verify|verify} messages. + * @param message ArrowRecordBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ArrowRecordBatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ArrowRecordBatch + * @throws {Error} If the payload is not a 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.storage.v1beta1.ArrowRecordBatch; + + /** + * Decodes an ArrowRecordBatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ArrowRecordBatch + * @throws {Error} If the payload is 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.storage.v1beta1.ArrowRecordBatch; + + /** + * Verifies an ArrowRecordBatch message. + * @param message Plain 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 ArrowRecordBatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ArrowRecordBatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch; + + /** + * Creates a plain object from an ArrowRecordBatch message. Also converts values to other types if specified. + * @param message ArrowRecordBatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ArrowRecordBatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AvroSchema. */ + interface IAvroSchema { + + /** AvroSchema schema */ + schema?: (string|null); + } + + /** Represents an AvroSchema. */ + class AvroSchema implements IAvroSchema { + + /** + * Constructs a new AvroSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IAvroSchema); + + /** AvroSchema schema. */ + public schema: string; + + /** + * Creates a new AvroSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns AvroSchema instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IAvroSchema): google.cloud.bigquery.storage.v1beta1.AvroSchema; + + /** + * Encodes the specified AvroSchema message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroSchema.verify|verify} messages. + * @param message AvroSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.IAvroSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AvroSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroSchema.verify|verify} messages. + * @param message AvroSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IAvroSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AvroSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AvroSchema + * @throws {Error} If the payload is not a 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.storage.v1beta1.AvroSchema; + + /** + * Decodes an AvroSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AvroSchema + * @throws {Error} If the payload is 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.storage.v1beta1.AvroSchema; + + /** + * Verifies an AvroSchema message. + * @param message Plain 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 AvroSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AvroSchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.AvroSchema; + + /** + * Creates a plain object from an AvroSchema message. Also converts values to other types if specified. + * @param message AvroSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.AvroSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AvroSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AvroRows. */ + interface IAvroRows { + + /** AvroRows serializedBinaryRows */ + serializedBinaryRows?: (Uint8Array|string|null); + + /** AvroRows rowCount */ + rowCount?: (number|Long|string|null); + } + + /** Represents an AvroRows. */ + class AvroRows implements IAvroRows { + + /** + * Constructs a new AvroRows. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IAvroRows); + + /** AvroRows serializedBinaryRows. */ + public serializedBinaryRows: (Uint8Array|string); + + /** AvroRows rowCount. */ + public rowCount: (number|Long|string); + + /** + * Creates a new AvroRows instance using the specified properties. + * @param [properties] Properties to set + * @returns AvroRows instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IAvroRows): google.cloud.bigquery.storage.v1beta1.AvroRows; + + /** + * Encodes the specified AvroRows message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroRows.verify|verify} messages. + * @param message AvroRows message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.IAvroRows, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AvroRows message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroRows.verify|verify} messages. + * @param message AvroRows message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IAvroRows, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AvroRows message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AvroRows + * @throws {Error} If the payload is not a 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.storage.v1beta1.AvroRows; + + /** + * Decodes an AvroRows message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AvroRows + * @throws {Error} If the payload is 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.storage.v1beta1.AvroRows; + + /** + * Verifies an AvroRows message. + * @param message Plain 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 AvroRows message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AvroRows + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.AvroRows; + + /** + * Creates a plain object from an AvroRows message. Also converts values to other types if specified. + * @param message AvroRows + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.AvroRows, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AvroRows to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TableReadOptions. */ + interface ITableReadOptions { + + /** TableReadOptions selectedFields */ + selectedFields?: (string[]|null); + + /** TableReadOptions rowRestriction */ + rowRestriction?: (string|null); + } + + /** Represents a TableReadOptions. */ + class TableReadOptions implements ITableReadOptions { + + /** + * Constructs a new TableReadOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.ITableReadOptions); + + /** TableReadOptions selectedFields. */ + public selectedFields: string[]; + + /** TableReadOptions rowRestriction. */ + public rowRestriction: string; + + /** + * Creates a new TableReadOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns TableReadOptions instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.ITableReadOptions): google.cloud.bigquery.storage.v1beta1.TableReadOptions; + + /** + * Encodes the specified TableReadOptions message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableReadOptions.verify|verify} messages. + * @param message TableReadOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.ITableReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableReadOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableReadOptions.verify|verify} messages. + * @param message TableReadOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.ITableReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableReadOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableReadOptions + * @throws {Error} If the payload is not a 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.storage.v1beta1.TableReadOptions; + + /** + * Decodes a TableReadOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableReadOptions + * @throws {Error} If the payload is 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.storage.v1beta1.TableReadOptions; + + /** + * Verifies a TableReadOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableReadOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableReadOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.TableReadOptions; + + /** + * Creates a plain object from a TableReadOptions message. Also converts values to other types if specified. + * @param message TableReadOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.TableReadOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableReadOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Represents a BigQueryStorage */ + class BigQueryStorage extends $protobuf.rpc.Service { + + /** + * Constructs a new BigQueryStorage 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 BigQueryStorage 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): BigQueryStorage; + + /** + * Calls CreateReadSession. + * @param request CreateReadSessionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReadSession + */ + public createReadSession(request: google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, callback: google.cloud.bigquery.storage.v1beta1.BigQueryStorage.CreateReadSessionCallback): void; + + /** + * Calls CreateReadSession. + * @param request CreateReadSessionRequest message or plain object + * @returns Promise + */ + public createReadSession(request: google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest): Promise; + + /** + * Calls ReadRows. + * @param request ReadRowsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReadRowsResponse + */ + public readRows(request: google.cloud.bigquery.storage.v1beta1.IReadRowsRequest, callback: google.cloud.bigquery.storage.v1beta1.BigQueryStorage.ReadRowsCallback): void; + + /** + * Calls ReadRows. + * @param request ReadRowsRequest message or plain object + * @returns Promise + */ + public readRows(request: google.cloud.bigquery.storage.v1beta1.IReadRowsRequest): Promise; + + /** + * Calls BatchCreateReadSessionStreams. + * @param request BatchCreateReadSessionStreamsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchCreateReadSessionStreamsResponse + */ + public batchCreateReadSessionStreams(request: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, callback: google.cloud.bigquery.storage.v1beta1.BigQueryStorage.BatchCreateReadSessionStreamsCallback): void; + + /** + * Calls BatchCreateReadSessionStreams. + * @param request BatchCreateReadSessionStreamsRequest message or plain object + * @returns Promise + */ + public batchCreateReadSessionStreams(request: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest): Promise; + + /** + * Calls FinalizeStream. + * @param request FinalizeStreamRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public finalizeStream(request: google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, callback: google.cloud.bigquery.storage.v1beta1.BigQueryStorage.FinalizeStreamCallback): void; + + /** + * Calls FinalizeStream. + * @param request FinalizeStreamRequest message or plain object + * @returns Promise + */ + public finalizeStream(request: google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest): Promise; + + /** + * Calls SplitReadStream. + * @param request SplitReadStreamRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SplitReadStreamResponse + */ + public splitReadStream(request: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, callback: google.cloud.bigquery.storage.v1beta1.BigQueryStorage.SplitReadStreamCallback): void; + + /** + * Calls SplitReadStream. + * @param request SplitReadStreamRequest message or plain object + * @returns Promise + */ + public splitReadStream(request: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest): Promise; + } + + namespace BigQueryStorage { + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#createReadSession}. + * @param error Error, if any + * @param [response] ReadSession + */ + type CreateReadSessionCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1beta1.ReadSession) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#readRows}. + * @param error Error, if any + * @param [response] ReadRowsResponse + */ + type ReadRowsCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1beta1.ReadRowsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#batchCreateReadSessionStreams}. + * @param error Error, if any + * @param [response] BatchCreateReadSessionStreamsResponse + */ + type BatchCreateReadSessionStreamsCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#finalizeStream}. + * @param error Error, if any + * @param [response] Empty + */ + type FinalizeStreamCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#splitReadStream}. + * @param error Error, if any + * @param [response] SplitReadStreamResponse + */ + type SplitReadStreamCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse) => void; + } + + /** Properties of a Stream. */ + interface IStream { + + /** Stream name */ + name?: (string|null); + } + + /** Represents a Stream. */ + class Stream implements IStream { + + /** + * Constructs a new Stream. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IStream); + + /** Stream name. */ + public name: string; + + /** + * Creates a new Stream instance using the specified properties. + * @param [properties] Properties to set + * @returns Stream instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IStream): google.cloud.bigquery.storage.v1beta1.Stream; + + /** + * Encodes the specified Stream message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Stream.verify|verify} messages. + * @param message Stream message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.IStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Stream message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Stream.verify|verify} messages. + * @param message Stream message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Stream message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Stream + * @throws {Error} If the payload is not a 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.storage.v1beta1.Stream; + + /** + * Decodes a Stream message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Stream + * @throws {Error} If the payload is 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.storage.v1beta1.Stream; + + /** + * Verifies a Stream message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Stream message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Stream + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.Stream; + + /** + * Creates a plain object from a Stream message. Also converts values to other types if specified. + * @param message Stream + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.Stream, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Stream to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StreamPosition. */ + interface IStreamPosition { + + /** StreamPosition stream */ + stream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + + /** StreamPosition offset */ + offset?: (number|Long|string|null); + } + + /** Represents a StreamPosition. */ + class StreamPosition implements IStreamPosition { + + /** + * Constructs a new StreamPosition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IStreamPosition); + + /** StreamPosition stream. */ + public stream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + + /** StreamPosition offset. */ + public offset: (number|Long|string); + + /** + * Creates a new StreamPosition instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamPosition instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IStreamPosition): google.cloud.bigquery.storage.v1beta1.StreamPosition; + + /** + * Encodes the specified StreamPosition message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamPosition.verify|verify} messages. + * @param message StreamPosition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.IStreamPosition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamPosition message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamPosition.verify|verify} messages. + * @param message StreamPosition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IStreamPosition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamPosition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamPosition + * @throws {Error} If the payload is not a 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.storage.v1beta1.StreamPosition; + + /** + * Decodes a StreamPosition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamPosition + * @throws {Error} If the payload is 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.storage.v1beta1.StreamPosition; + + /** + * Verifies a StreamPosition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamPosition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamPosition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.StreamPosition; + + /** + * Creates a plain object from a StreamPosition message. Also converts values to other types if specified. + * @param message StreamPosition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.StreamPosition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamPosition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReadSession. */ + interface IReadSession { + + /** ReadSession name */ + name?: (string|null); + + /** ReadSession expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** ReadSession avroSchema */ + avroSchema?: (google.cloud.bigquery.storage.v1beta1.IAvroSchema|null); + + /** ReadSession arrowSchema */ + arrowSchema?: (google.cloud.bigquery.storage.v1beta1.IArrowSchema|null); + + /** ReadSession streams */ + streams?: (google.cloud.bigquery.storage.v1beta1.IStream[]|null); + + /** ReadSession tableReference */ + tableReference?: (google.cloud.bigquery.storage.v1beta1.ITableReference|null); + + /** ReadSession tableModifiers */ + tableModifiers?: (google.cloud.bigquery.storage.v1beta1.ITableModifiers|null); + + /** ReadSession shardingStrategy */ + shardingStrategy?: (google.cloud.bigquery.storage.v1beta1.ShardingStrategy|keyof typeof google.cloud.bigquery.storage.v1beta1.ShardingStrategy|null); + } + + /** Represents a ReadSession. */ + class ReadSession implements IReadSession { + + /** + * Constructs a new ReadSession. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IReadSession); + + /** ReadSession name. */ + public name: string; + + /** ReadSession expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** ReadSession avroSchema. */ + public avroSchema?: (google.cloud.bigquery.storage.v1beta1.IAvroSchema|null); + + /** ReadSession arrowSchema. */ + public arrowSchema?: (google.cloud.bigquery.storage.v1beta1.IArrowSchema|null); + + /** ReadSession streams. */ + public streams: google.cloud.bigquery.storage.v1beta1.IStream[]; + + /** ReadSession tableReference. */ + public tableReference?: (google.cloud.bigquery.storage.v1beta1.ITableReference|null); + + /** ReadSession tableModifiers. */ + public tableModifiers?: (google.cloud.bigquery.storage.v1beta1.ITableModifiers|null); + + /** ReadSession shardingStrategy. */ + public shardingStrategy: (google.cloud.bigquery.storage.v1beta1.ShardingStrategy|keyof typeof google.cloud.bigquery.storage.v1beta1.ShardingStrategy); + + /** ReadSession schema. */ + public schema?: ("avroSchema"|"arrowSchema"); + + /** + * Creates a new ReadSession instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadSession instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IReadSession): google.cloud.bigquery.storage.v1beta1.ReadSession; + + /** + * Encodes the specified ReadSession message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadSession.verify|verify} messages. + * @param message ReadSession message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.IReadSession, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadSession message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadSession.verify|verify} messages. + * @param message ReadSession message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IReadSession, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadSession message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadSession + * @throws {Error} If the payload is not a 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.storage.v1beta1.ReadSession; + + /** + * Decodes a ReadSession message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadSession + * @throws {Error} If the payload is 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.storage.v1beta1.ReadSession; + + /** + * Verifies a ReadSession message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadSession message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadSession + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.ReadSession; + + /** + * Creates a plain object from a ReadSession message. Also converts values to other types if specified. + * @param message ReadSession + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.ReadSession, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadSession to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateReadSessionRequest. */ + interface ICreateReadSessionRequest { + + /** CreateReadSessionRequest tableReference */ + tableReference?: (google.cloud.bigquery.storage.v1beta1.ITableReference|null); + + /** CreateReadSessionRequest parent */ + parent?: (string|null); + + /** CreateReadSessionRequest tableModifiers */ + tableModifiers?: (google.cloud.bigquery.storage.v1beta1.ITableModifiers|null); + + /** CreateReadSessionRequest requestedStreams */ + requestedStreams?: (number|null); + + /** CreateReadSessionRequest readOptions */ + readOptions?: (google.cloud.bigquery.storage.v1beta1.ITableReadOptions|null); + + /** CreateReadSessionRequest format */ + format?: (google.cloud.bigquery.storage.v1beta1.DataFormat|keyof typeof google.cloud.bigquery.storage.v1beta1.DataFormat|null); + + /** CreateReadSessionRequest shardingStrategy */ + shardingStrategy?: (google.cloud.bigquery.storage.v1beta1.ShardingStrategy|keyof typeof google.cloud.bigquery.storage.v1beta1.ShardingStrategy|null); + } + + /** Represents a CreateReadSessionRequest. */ + class CreateReadSessionRequest implements ICreateReadSessionRequest { + + /** + * Constructs a new CreateReadSessionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest); + + /** CreateReadSessionRequest tableReference. */ + public tableReference?: (google.cloud.bigquery.storage.v1beta1.ITableReference|null); + + /** CreateReadSessionRequest parent. */ + public parent: string; + + /** CreateReadSessionRequest tableModifiers. */ + public tableModifiers?: (google.cloud.bigquery.storage.v1beta1.ITableModifiers|null); + + /** CreateReadSessionRequest requestedStreams. */ + public requestedStreams: number; + + /** CreateReadSessionRequest readOptions. */ + public readOptions?: (google.cloud.bigquery.storage.v1beta1.ITableReadOptions|null); + + /** CreateReadSessionRequest format. */ + public format: (google.cloud.bigquery.storage.v1beta1.DataFormat|keyof typeof google.cloud.bigquery.storage.v1beta1.DataFormat); + + /** CreateReadSessionRequest shardingStrategy. */ + public shardingStrategy: (google.cloud.bigquery.storage.v1beta1.ShardingStrategy|keyof typeof google.cloud.bigquery.storage.v1beta1.ShardingStrategy); + + /** + * Creates a new CreateReadSessionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateReadSessionRequest instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest): google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest; + + /** + * Encodes the specified CreateReadSessionRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest.verify|verify} messages. + * @param message CreateReadSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateReadSessionRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest.verify|verify} messages. + * @param message CreateReadSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateReadSessionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateReadSessionRequest + * @throws {Error} If the payload is not a 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.storage.v1beta1.CreateReadSessionRequest; + + /** + * Decodes a CreateReadSessionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateReadSessionRequest + * @throws {Error} If the payload is 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.storage.v1beta1.CreateReadSessionRequest; + + /** + * Verifies a CreateReadSessionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateReadSessionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateReadSessionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest; + + /** + * Creates a plain object from a CreateReadSessionRequest message. Also converts values to other types if specified. + * @param message CreateReadSessionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateReadSessionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** DataFormat enum. */ + enum DataFormat { + DATA_FORMAT_UNSPECIFIED = 0, + AVRO = 1, + ARROW = 3 + } + + /** ShardingStrategy enum. */ + enum ShardingStrategy { + SHARDING_STRATEGY_UNSPECIFIED = 0, + LIQUID = 1, + BALANCED = 2 + } + + /** Properties of a ReadRowsRequest. */ + interface IReadRowsRequest { + + /** ReadRowsRequest readPosition */ + readPosition?: (google.cloud.bigquery.storage.v1beta1.IStreamPosition|null); + } + + /** Represents a ReadRowsRequest. */ + class ReadRowsRequest implements IReadRowsRequest { + + /** + * Constructs a new ReadRowsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IReadRowsRequest); + + /** ReadRowsRequest readPosition. */ + public readPosition?: (google.cloud.bigquery.storage.v1beta1.IStreamPosition|null); + + /** + * Creates a new ReadRowsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadRowsRequest instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IReadRowsRequest): google.cloud.bigquery.storage.v1beta1.ReadRowsRequest; + + /** + * Encodes the specified ReadRowsRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsRequest.verify|verify} messages. + * @param message ReadRowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.IReadRowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadRowsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsRequest.verify|verify} messages. + * @param message ReadRowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IReadRowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadRowsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadRowsRequest + * @throws {Error} If the payload is not a 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.storage.v1beta1.ReadRowsRequest; + + /** + * Decodes a ReadRowsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadRowsRequest + * @throws {Error} If the payload is 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.storage.v1beta1.ReadRowsRequest; + + /** + * Verifies a ReadRowsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadRowsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadRowsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.ReadRowsRequest; + + /** + * Creates a plain object from a ReadRowsRequest message. Also converts values to other types if specified. + * @param message ReadRowsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.ReadRowsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadRowsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StreamStatus. */ + interface IStreamStatus { + + /** StreamStatus estimatedRowCount */ + estimatedRowCount?: (number|Long|string|null); + + /** StreamStatus fractionConsumed */ + fractionConsumed?: (number|null); + + /** StreamStatus progress */ + progress?: (google.cloud.bigquery.storage.v1beta1.IProgress|null); + + /** StreamStatus isSplittable */ + isSplittable?: (boolean|null); + } + + /** Represents a StreamStatus. */ + class StreamStatus implements IStreamStatus { + + /** + * Constructs a new StreamStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IStreamStatus); + + /** StreamStatus estimatedRowCount. */ + public estimatedRowCount: (number|Long|string); + + /** StreamStatus fractionConsumed. */ + public fractionConsumed: number; + + /** StreamStatus progress. */ + public progress?: (google.cloud.bigquery.storage.v1beta1.IProgress|null); + + /** StreamStatus isSplittable. */ + public isSplittable: boolean; + + /** + * Creates a new StreamStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamStatus instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IStreamStatus): google.cloud.bigquery.storage.v1beta1.StreamStatus; + + /** + * Encodes the specified StreamStatus message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamStatus.verify|verify} messages. + * @param message StreamStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.IStreamStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamStatus message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamStatus.verify|verify} messages. + * @param message StreamStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IStreamStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamStatus + * @throws {Error} If the payload is not a 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.storage.v1beta1.StreamStatus; + + /** + * Decodes a StreamStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamStatus + * @throws {Error} If the payload is 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.storage.v1beta1.StreamStatus; + + /** + * Verifies a StreamStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.StreamStatus; + + /** + * Creates a plain object from a StreamStatus message. Also converts values to other types if specified. + * @param message StreamStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.StreamStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Progress. */ + interface IProgress { + + /** Progress atResponseStart */ + atResponseStart?: (number|null); + + /** Progress atResponseEnd */ + atResponseEnd?: (number|null); + } + + /** Represents a Progress. */ + class Progress implements IProgress { + + /** + * Constructs a new Progress. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IProgress); + + /** Progress atResponseStart. */ + public atResponseStart: number; + + /** Progress atResponseEnd. */ + public atResponseEnd: number; + + /** + * Creates a new Progress instance using the specified properties. + * @param [properties] Properties to set + * @returns Progress instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IProgress): google.cloud.bigquery.storage.v1beta1.Progress; + + /** + * Encodes the specified Progress message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Progress.verify|verify} messages. + * @param message Progress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.IProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Progress message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Progress.verify|verify} messages. + * @param message Progress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Progress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Progress + * @throws {Error} If the payload is not a 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.storage.v1beta1.Progress; + + /** + * Decodes a Progress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Progress + * @throws {Error} If the payload is 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.storage.v1beta1.Progress; + + /** + * Verifies a Progress message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Progress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Progress + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.Progress; + + /** + * Creates a plain object from a Progress message. Also converts values to other types if specified. + * @param message Progress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.Progress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Progress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ThrottleStatus. */ + interface IThrottleStatus { + + /** ThrottleStatus throttlePercent */ + throttlePercent?: (number|null); + } + + /** Represents a ThrottleStatus. */ + class ThrottleStatus implements IThrottleStatus { + + /** + * Constructs a new ThrottleStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IThrottleStatus); + + /** ThrottleStatus throttlePercent. */ + public throttlePercent: number; + + /** + * Creates a new ThrottleStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ThrottleStatus instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IThrottleStatus): google.cloud.bigquery.storage.v1beta1.ThrottleStatus; + + /** + * Encodes the specified ThrottleStatus message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ThrottleStatus.verify|verify} messages. + * @param message ThrottleStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.IThrottleStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ThrottleStatus message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ThrottleStatus.verify|verify} messages. + * @param message ThrottleStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IThrottleStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThrottleStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ThrottleStatus + * @throws {Error} If the payload is not a 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.storage.v1beta1.ThrottleStatus; + + /** + * Decodes a ThrottleStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ThrottleStatus + * @throws {Error} If the payload is 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.storage.v1beta1.ThrottleStatus; + + /** + * Verifies a ThrottleStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ThrottleStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ThrottleStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.ThrottleStatus; + + /** + * Creates a plain object from a ThrottleStatus message. Also converts values to other types if specified. + * @param message ThrottleStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.ThrottleStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ThrottleStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReadRowsResponse. */ + interface IReadRowsResponse { + + /** ReadRowsResponse avroRows */ + avroRows?: (google.cloud.bigquery.storage.v1beta1.IAvroRows|null); + + /** ReadRowsResponse arrowRecordBatch */ + arrowRecordBatch?: (google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch|null); + + /** ReadRowsResponse rowCount */ + rowCount?: (number|Long|string|null); + + /** ReadRowsResponse status */ + status?: (google.cloud.bigquery.storage.v1beta1.IStreamStatus|null); + + /** ReadRowsResponse throttleStatus */ + throttleStatus?: (google.cloud.bigquery.storage.v1beta1.IThrottleStatus|null); + } + + /** Represents a ReadRowsResponse. */ + class ReadRowsResponse implements IReadRowsResponse { + + /** + * Constructs a new ReadRowsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IReadRowsResponse); + + /** ReadRowsResponse avroRows. */ + public avroRows?: (google.cloud.bigquery.storage.v1beta1.IAvroRows|null); + + /** ReadRowsResponse arrowRecordBatch. */ + public arrowRecordBatch?: (google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch|null); + + /** ReadRowsResponse rowCount. */ + public rowCount: (number|Long|string); + + /** ReadRowsResponse status. */ + public status?: (google.cloud.bigquery.storage.v1beta1.IStreamStatus|null); + + /** ReadRowsResponse throttleStatus. */ + public throttleStatus?: (google.cloud.bigquery.storage.v1beta1.IThrottleStatus|null); + + /** ReadRowsResponse rows. */ + public rows?: ("avroRows"|"arrowRecordBatch"); + + /** + * Creates a new ReadRowsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadRowsResponse instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IReadRowsResponse): google.cloud.bigquery.storage.v1beta1.ReadRowsResponse; + + /** + * Encodes the specified ReadRowsResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.verify|verify} messages. + * @param message ReadRowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.IReadRowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadRowsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.verify|verify} messages. + * @param message ReadRowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IReadRowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadRowsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadRowsResponse + * @throws {Error} If the payload is not a 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.storage.v1beta1.ReadRowsResponse; + + /** + * Decodes a ReadRowsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadRowsResponse + * @throws {Error} If the payload is 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.storage.v1beta1.ReadRowsResponse; + + /** + * Verifies a ReadRowsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadRowsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadRowsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.ReadRowsResponse; + + /** + * Creates a plain object from a ReadRowsResponse message. Also converts values to other types if specified. + * @param message ReadRowsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.ReadRowsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadRowsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchCreateReadSessionStreamsRequest. */ + interface IBatchCreateReadSessionStreamsRequest { + + /** BatchCreateReadSessionStreamsRequest session */ + session?: (google.cloud.bigquery.storage.v1beta1.IReadSession|null); + + /** BatchCreateReadSessionStreamsRequest requestedStreams */ + requestedStreams?: (number|null); + } + + /** Represents a BatchCreateReadSessionStreamsRequest. */ + class BatchCreateReadSessionStreamsRequest implements IBatchCreateReadSessionStreamsRequest { + + /** + * Constructs a new BatchCreateReadSessionStreamsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest); + + /** BatchCreateReadSessionStreamsRequest session. */ + public session?: (google.cloud.bigquery.storage.v1beta1.IReadSession|null); + + /** BatchCreateReadSessionStreamsRequest requestedStreams. */ + public requestedStreams: number; + + /** + * Creates a new BatchCreateReadSessionStreamsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateReadSessionStreamsRequest instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest): google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest; + + /** + * Encodes the specified BatchCreateReadSessionStreamsRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest.verify|verify} messages. + * @param message BatchCreateReadSessionStreamsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateReadSessionStreamsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest.verify|verify} messages. + * @param message BatchCreateReadSessionStreamsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateReadSessionStreamsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateReadSessionStreamsRequest + * @throws {Error} If the payload is not a 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.storage.v1beta1.BatchCreateReadSessionStreamsRequest; + + /** + * Decodes a BatchCreateReadSessionStreamsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateReadSessionStreamsRequest + * @throws {Error} If the payload is 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.storage.v1beta1.BatchCreateReadSessionStreamsRequest; + + /** + * Verifies a BatchCreateReadSessionStreamsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateReadSessionStreamsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateReadSessionStreamsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest; + + /** + * Creates a plain object from a BatchCreateReadSessionStreamsRequest message. Also converts values to other types if specified. + * @param message BatchCreateReadSessionStreamsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateReadSessionStreamsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchCreateReadSessionStreamsResponse. */ + interface IBatchCreateReadSessionStreamsResponse { + + /** BatchCreateReadSessionStreamsResponse streams */ + streams?: (google.cloud.bigquery.storage.v1beta1.IStream[]|null); + } + + /** Represents a BatchCreateReadSessionStreamsResponse. */ + class BatchCreateReadSessionStreamsResponse implements IBatchCreateReadSessionStreamsResponse { + + /** + * Constructs a new BatchCreateReadSessionStreamsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse); + + /** BatchCreateReadSessionStreamsResponse streams. */ + public streams: google.cloud.bigquery.storage.v1beta1.IStream[]; + + /** + * Creates a new BatchCreateReadSessionStreamsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateReadSessionStreamsResponse instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse): google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse; + + /** + * Encodes the specified BatchCreateReadSessionStreamsResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse.verify|verify} messages. + * @param message BatchCreateReadSessionStreamsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateReadSessionStreamsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse.verify|verify} messages. + * @param message BatchCreateReadSessionStreamsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateReadSessionStreamsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateReadSessionStreamsResponse + * @throws {Error} If the payload is not a 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.storage.v1beta1.BatchCreateReadSessionStreamsResponse; + + /** + * Decodes a BatchCreateReadSessionStreamsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateReadSessionStreamsResponse + * @throws {Error} If the payload is 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.storage.v1beta1.BatchCreateReadSessionStreamsResponse; + + /** + * Verifies a BatchCreateReadSessionStreamsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateReadSessionStreamsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateReadSessionStreamsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse; + + /** + * Creates a plain object from a BatchCreateReadSessionStreamsResponse message. Also converts values to other types if specified. + * @param message BatchCreateReadSessionStreamsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateReadSessionStreamsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FinalizeStreamRequest. */ + interface IFinalizeStreamRequest { + + /** FinalizeStreamRequest stream */ + stream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + } + + /** Represents a FinalizeStreamRequest. */ + class FinalizeStreamRequest implements IFinalizeStreamRequest { + + /** + * Constructs a new FinalizeStreamRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest); + + /** FinalizeStreamRequest stream. */ + public stream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + + /** + * Creates a new FinalizeStreamRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FinalizeStreamRequest instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest): google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest; + + /** + * Encodes the specified FinalizeStreamRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest.verify|verify} messages. + * @param message FinalizeStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FinalizeStreamRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest.verify|verify} messages. + * @param message FinalizeStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FinalizeStreamRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FinalizeStreamRequest + * @throws {Error} If the payload is not a 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.storage.v1beta1.FinalizeStreamRequest; + + /** + * Decodes a FinalizeStreamRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FinalizeStreamRequest + * @throws {Error} If the payload is 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.storage.v1beta1.FinalizeStreamRequest; + + /** + * Verifies a FinalizeStreamRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FinalizeStreamRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FinalizeStreamRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest; + + /** + * Creates a plain object from a FinalizeStreamRequest message. Also converts values to other types if specified. + * @param message FinalizeStreamRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FinalizeStreamRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SplitReadStreamRequest. */ + interface ISplitReadStreamRequest { + + /** SplitReadStreamRequest originalStream */ + originalStream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + + /** SplitReadStreamRequest fraction */ + fraction?: (number|null); + } + + /** Represents a SplitReadStreamRequest. */ + class SplitReadStreamRequest implements ISplitReadStreamRequest { + + /** + * Constructs a new SplitReadStreamRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest); + + /** SplitReadStreamRequest originalStream. */ + public originalStream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + + /** SplitReadStreamRequest fraction. */ + public fraction: number; + + /** + * Creates a new SplitReadStreamRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SplitReadStreamRequest instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest): google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest; + + /** + * Encodes the specified SplitReadStreamRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest.verify|verify} messages. + * @param message SplitReadStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SplitReadStreamRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest.verify|verify} messages. + * @param message SplitReadStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SplitReadStreamRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SplitReadStreamRequest + * @throws {Error} If the payload is not a 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.storage.v1beta1.SplitReadStreamRequest; + + /** + * Decodes a SplitReadStreamRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SplitReadStreamRequest + * @throws {Error} If the payload is 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.storage.v1beta1.SplitReadStreamRequest; + + /** + * Verifies a SplitReadStreamRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SplitReadStreamRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SplitReadStreamRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest; + + /** + * Creates a plain object from a SplitReadStreamRequest message. Also converts values to other types if specified. + * @param message SplitReadStreamRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SplitReadStreamRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SplitReadStreamResponse. */ + interface ISplitReadStreamResponse { + + /** SplitReadStreamResponse primaryStream */ + primaryStream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + + /** SplitReadStreamResponse remainderStream */ + remainderStream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + } + + /** Represents a SplitReadStreamResponse. */ + class SplitReadStreamResponse implements ISplitReadStreamResponse { + + /** + * Constructs a new SplitReadStreamResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse); + + /** SplitReadStreamResponse primaryStream. */ + public primaryStream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + + /** SplitReadStreamResponse remainderStream. */ + public remainderStream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + + /** + * Creates a new SplitReadStreamResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SplitReadStreamResponse instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse): google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse; + + /** + * Encodes the specified SplitReadStreamResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse.verify|verify} messages. + * @param message SplitReadStreamResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SplitReadStreamResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse.verify|verify} messages. + * @param message SplitReadStreamResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SplitReadStreamResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SplitReadStreamResponse + * @throws {Error} If the payload is not a 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.storage.v1beta1.SplitReadStreamResponse; + + /** + * Decodes a SplitReadStreamResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SplitReadStreamResponse + * @throws {Error} If the payload is 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.storage.v1beta1.SplitReadStreamResponse; + + /** + * Verifies a SplitReadStreamResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SplitReadStreamResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SplitReadStreamResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse; + + /** + * Creates a plain object from a SplitReadStreamResponse message. Also converts values to other types if specified. + * @param message SplitReadStreamResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SplitReadStreamResponse 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.storage.v1beta1.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.storage.v1beta1.ITableReference): google.cloud.bigquery.storage.v1beta1.TableReference; + + /** + * Encodes the specified TableReference message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.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.storage.v1beta1.ITableReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.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.storage.v1beta1.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.storage.v1beta1.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.storage.v1beta1.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.storage.v1beta1.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.storage.v1beta1.TableReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TableModifiers. */ + interface ITableModifiers { + + /** TableModifiers snapshotTime */ + snapshotTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TableModifiers. */ + class TableModifiers implements ITableModifiers { + + /** + * Constructs a new TableModifiers. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.ITableModifiers); + + /** TableModifiers snapshotTime. */ + public snapshotTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TableModifiers instance using the specified properties. + * @param [properties] Properties to set + * @returns TableModifiers instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.ITableModifiers): google.cloud.bigquery.storage.v1beta1.TableModifiers; + + /** + * Encodes the specified TableModifiers message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableModifiers.verify|verify} messages. + * @param message TableModifiers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.ITableModifiers, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableModifiers message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableModifiers.verify|verify} messages. + * @param message TableModifiers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.ITableModifiers, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableModifiers message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableModifiers + * @throws {Error} If the payload is not a 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.storage.v1beta1.TableModifiers; + + /** + * Decodes a TableModifiers message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableModifiers + * @throws {Error} If the payload is 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.storage.v1beta1.TableModifiers; + + /** + * Verifies a TableModifiers message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableModifiers message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableModifiers + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.TableModifiers; + + /** + * Creates a plain object from a TableModifiers message. Also converts values to other types if specified. + * @param message TableModifiers + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.TableModifiers, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableModifiers 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); + } + + /** 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); + + /** + * 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 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 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 }; + } + } +} diff --git a/packages/google-cloud-bigquery-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js new file mode 100644 index 00000000000..8da21884529 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/protos/protos.js @@ -0,0 +1,15841 @@ +// 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["default"] || ($protobuf.roots["default"] = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.bigquery = (function() { + + /** + * Namespace bigquery. + * @memberof google.cloud + * @namespace + */ + var bigquery = {}; + + bigquery.storage = (function() { + + /** + * Namespace storage. + * @memberof google.cloud.bigquery + * @namespace + */ + var storage = {}; + + storage.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.bigquery.storage + * @namespace + */ + var v1beta1 = {}; + + v1beta1.ArrowSchema = (function() { + + /** + * Properties of an ArrowSchema. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IArrowSchema + * @property {Uint8Array|null} [serializedSchema] ArrowSchema serializedSchema + */ + + /** + * Constructs a new ArrowSchema. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents an ArrowSchema. + * @implements IArrowSchema + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IArrowSchema=} [properties] Properties to set + */ + function ArrowSchema(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ArrowSchema serializedSchema. + * @member {Uint8Array} serializedSchema + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema + * @instance + */ + ArrowSchema.prototype.serializedSchema = $util.newBuffer([]); + + /** + * Creates a new ArrowSchema instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IArrowSchema=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.ArrowSchema} ArrowSchema instance + */ + ArrowSchema.create = function create(properties) { + return new ArrowSchema(properties); + }; + + /** + * Encodes the specified ArrowSchema message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IArrowSchema} message ArrowSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrowSchema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serializedSchema != null && message.hasOwnProperty("serializedSchema")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.serializedSchema); + return writer; + }; + + /** + * Encodes the specified ArrowSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IArrowSchema} message ArrowSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrowSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ArrowSchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.ArrowSchema} ArrowSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrowSchema.decode = function decode(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.storage.v1beta1.ArrowSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serializedSchema = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ArrowSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.ArrowSchema} ArrowSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrowSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArrowSchema message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArrowSchema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serializedSchema != null && message.hasOwnProperty("serializedSchema")) + if (!(message.serializedSchema && typeof message.serializedSchema.length === "number" || $util.isString(message.serializedSchema))) + return "serializedSchema: buffer expected"; + return null; + }; + + /** + * Creates an ArrowSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.ArrowSchema} ArrowSchema + */ + ArrowSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema(); + if (object.serializedSchema != null) + if (typeof object.serializedSchema === "string") + $util.base64.decode(object.serializedSchema, message.serializedSchema = $util.newBuffer($util.base64.length(object.serializedSchema)), 0); + else if (object.serializedSchema.length) + message.serializedSchema = object.serializedSchema; + return message; + }; + + /** + * Creates a plain object from an ArrowSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ArrowSchema} message ArrowSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArrowSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.serializedSchema = ""; + else { + object.serializedSchema = []; + if (options.bytes !== Array) + object.serializedSchema = $util.newBuffer(object.serializedSchema); + } + if (message.serializedSchema != null && message.hasOwnProperty("serializedSchema")) + object.serializedSchema = options.bytes === String ? $util.base64.encode(message.serializedSchema, 0, message.serializedSchema.length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedSchema) : message.serializedSchema; + return object; + }; + + /** + * Converts this ArrowSchema to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema + * @instance + * @returns {Object.} JSON object + */ + ArrowSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ArrowSchema; + })(); + + v1beta1.ArrowRecordBatch = (function() { + + /** + * Properties of an ArrowRecordBatch. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IArrowRecordBatch + * @property {Uint8Array|null} [serializedRecordBatch] ArrowRecordBatch serializedRecordBatch + * @property {number|Long|null} [rowCount] ArrowRecordBatch rowCount + */ + + /** + * Constructs a new ArrowRecordBatch. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents an ArrowRecordBatch. + * @implements IArrowRecordBatch + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch=} [properties] Properties to set + */ + function ArrowRecordBatch(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ArrowRecordBatch serializedRecordBatch. + * @member {Uint8Array} serializedRecordBatch + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * @instance + */ + ArrowRecordBatch.prototype.serializedRecordBatch = $util.newBuffer([]); + + /** + * ArrowRecordBatch rowCount. + * @member {number|Long} rowCount + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * @instance + */ + ArrowRecordBatch.prototype.rowCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ArrowRecordBatch instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch} ArrowRecordBatch instance + */ + ArrowRecordBatch.create = function create(properties) { + return new ArrowRecordBatch(properties); + }; + + /** + * Encodes the specified ArrowRecordBatch message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch} message ArrowRecordBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrowRecordBatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serializedRecordBatch != null && message.hasOwnProperty("serializedRecordBatch")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.serializedRecordBatch); + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.rowCount); + return writer; + }; + + /** + * Encodes the specified ArrowRecordBatch message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch} message ArrowRecordBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrowRecordBatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ArrowRecordBatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch} ArrowRecordBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrowRecordBatch.decode = function decode(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.storage.v1beta1.ArrowRecordBatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serializedRecordBatch = reader.bytes(); + break; + case 2: + message.rowCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ArrowRecordBatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch} ArrowRecordBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrowRecordBatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArrowRecordBatch message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArrowRecordBatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serializedRecordBatch != null && message.hasOwnProperty("serializedRecordBatch")) + if (!(message.serializedRecordBatch && typeof message.serializedRecordBatch.length === "number" || $util.isString(message.serializedRecordBatch))) + return "serializedRecordBatch: buffer expected"; + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (!$util.isInteger(message.rowCount) && !(message.rowCount && $util.isInteger(message.rowCount.low) && $util.isInteger(message.rowCount.high))) + return "rowCount: integer|Long expected"; + return null; + }; + + /** + * Creates an ArrowRecordBatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch} ArrowRecordBatch + */ + ArrowRecordBatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch(); + if (object.serializedRecordBatch != null) + if (typeof object.serializedRecordBatch === "string") + $util.base64.decode(object.serializedRecordBatch, message.serializedRecordBatch = $util.newBuffer($util.base64.length(object.serializedRecordBatch)), 0); + else if (object.serializedRecordBatch.length) + message.serializedRecordBatch = object.serializedRecordBatch; + if (object.rowCount != null) + if ($util.Long) + (message.rowCount = $util.Long.fromValue(object.rowCount)).unsigned = false; + else if (typeof object.rowCount === "string") + message.rowCount = parseInt(object.rowCount, 10); + else if (typeof object.rowCount === "number") + message.rowCount = object.rowCount; + else if (typeof object.rowCount === "object") + message.rowCount = new $util.LongBits(object.rowCount.low >>> 0, object.rowCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ArrowRecordBatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch} message ArrowRecordBatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArrowRecordBatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.serializedRecordBatch = ""; + else { + object.serializedRecordBatch = []; + if (options.bytes !== Array) + object.serializedRecordBatch = $util.newBuffer(object.serializedRecordBatch); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rowCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowCount = options.longs === String ? "0" : 0; + } + if (message.serializedRecordBatch != null && message.hasOwnProperty("serializedRecordBatch")) + object.serializedRecordBatch = options.bytes === String ? $util.base64.encode(message.serializedRecordBatch, 0, message.serializedRecordBatch.length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedRecordBatch) : message.serializedRecordBatch; + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (typeof message.rowCount === "number") + object.rowCount = options.longs === String ? String(message.rowCount) : message.rowCount; + else + object.rowCount = options.longs === String ? $util.Long.prototype.toString.call(message.rowCount) : options.longs === Number ? new $util.LongBits(message.rowCount.low >>> 0, message.rowCount.high >>> 0).toNumber() : message.rowCount; + return object; + }; + + /** + * Converts this ArrowRecordBatch to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * @instance + * @returns {Object.} JSON object + */ + ArrowRecordBatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ArrowRecordBatch; + })(); + + v1beta1.AvroSchema = (function() { + + /** + * Properties of an AvroSchema. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IAvroSchema + * @property {string|null} [schema] AvroSchema schema + */ + + /** + * Constructs a new AvroSchema. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents an AvroSchema. + * @implements IAvroSchema + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IAvroSchema=} [properties] Properties to set + */ + function AvroSchema(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AvroSchema schema. + * @member {string} schema + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema + * @instance + */ + AvroSchema.prototype.schema = ""; + + /** + * Creates a new AvroSchema instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IAvroSchema=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.AvroSchema} AvroSchema instance + */ + AvroSchema.create = function create(properties) { + return new AvroSchema(properties); + }; + + /** + * Encodes the specified AvroSchema message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IAvroSchema} message AvroSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvroSchema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schema != null && message.hasOwnProperty("schema")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.schema); + return writer; + }; + + /** + * Encodes the specified AvroSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IAvroSchema} message AvroSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvroSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AvroSchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.AvroSchema} AvroSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvroSchema.decode = function decode(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.storage.v1beta1.AvroSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.schema = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AvroSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.AvroSchema} AvroSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvroSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AvroSchema message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AvroSchema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schema != null && message.hasOwnProperty("schema")) + if (!$util.isString(message.schema)) + return "schema: string expected"; + return null; + }; + + /** + * Creates an AvroSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.AvroSchema} AvroSchema + */ + AvroSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.AvroSchema) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.AvroSchema(); + if (object.schema != null) + message.schema = String(object.schema); + return message; + }; + + /** + * Creates a plain object from an AvroSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema + * @static + * @param {google.cloud.bigquery.storage.v1beta1.AvroSchema} message AvroSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AvroSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.schema = ""; + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = message.schema; + return object; + }; + + /** + * Converts this AvroSchema to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema + * @instance + * @returns {Object.} JSON object + */ + AvroSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AvroSchema; + })(); + + v1beta1.AvroRows = (function() { + + /** + * Properties of an AvroRows. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IAvroRows + * @property {Uint8Array|null} [serializedBinaryRows] AvroRows serializedBinaryRows + * @property {number|Long|null} [rowCount] AvroRows rowCount + */ + + /** + * Constructs a new AvroRows. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents an AvroRows. + * @implements IAvroRows + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IAvroRows=} [properties] Properties to set + */ + function AvroRows(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AvroRows serializedBinaryRows. + * @member {Uint8Array} serializedBinaryRows + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @instance + */ + AvroRows.prototype.serializedBinaryRows = $util.newBuffer([]); + + /** + * AvroRows rowCount. + * @member {number|Long} rowCount + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @instance + */ + AvroRows.prototype.rowCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new AvroRows instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IAvroRows=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.AvroRows} AvroRows instance + */ + AvroRows.create = function create(properties) { + return new AvroRows(properties); + }; + + /** + * Encodes the specified AvroRows message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroRows.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IAvroRows} message AvroRows message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvroRows.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serializedBinaryRows != null && message.hasOwnProperty("serializedBinaryRows")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.serializedBinaryRows); + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.rowCount); + return writer; + }; + + /** + * Encodes the specified AvroRows message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroRows.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IAvroRows} message AvroRows message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvroRows.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AvroRows message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.AvroRows} AvroRows + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvroRows.decode = function decode(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.storage.v1beta1.AvroRows(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serializedBinaryRows = reader.bytes(); + break; + case 2: + message.rowCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AvroRows message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.AvroRows} AvroRows + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvroRows.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AvroRows message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AvroRows.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serializedBinaryRows != null && message.hasOwnProperty("serializedBinaryRows")) + if (!(message.serializedBinaryRows && typeof message.serializedBinaryRows.length === "number" || $util.isString(message.serializedBinaryRows))) + return "serializedBinaryRows: buffer expected"; + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (!$util.isInteger(message.rowCount) && !(message.rowCount && $util.isInteger(message.rowCount.low) && $util.isInteger(message.rowCount.high))) + return "rowCount: integer|Long expected"; + return null; + }; + + /** + * Creates an AvroRows message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.AvroRows} AvroRows + */ + AvroRows.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.AvroRows) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.AvroRows(); + if (object.serializedBinaryRows != null) + if (typeof object.serializedBinaryRows === "string") + $util.base64.decode(object.serializedBinaryRows, message.serializedBinaryRows = $util.newBuffer($util.base64.length(object.serializedBinaryRows)), 0); + else if (object.serializedBinaryRows.length) + message.serializedBinaryRows = object.serializedBinaryRows; + if (object.rowCount != null) + if ($util.Long) + (message.rowCount = $util.Long.fromValue(object.rowCount)).unsigned = false; + else if (typeof object.rowCount === "string") + message.rowCount = parseInt(object.rowCount, 10); + else if (typeof object.rowCount === "number") + message.rowCount = object.rowCount; + else if (typeof object.rowCount === "object") + message.rowCount = new $util.LongBits(object.rowCount.low >>> 0, object.rowCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an AvroRows message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @static + * @param {google.cloud.bigquery.storage.v1beta1.AvroRows} message AvroRows + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AvroRows.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.serializedBinaryRows = ""; + else { + object.serializedBinaryRows = []; + if (options.bytes !== Array) + object.serializedBinaryRows = $util.newBuffer(object.serializedBinaryRows); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rowCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowCount = options.longs === String ? "0" : 0; + } + if (message.serializedBinaryRows != null && message.hasOwnProperty("serializedBinaryRows")) + object.serializedBinaryRows = options.bytes === String ? $util.base64.encode(message.serializedBinaryRows, 0, message.serializedBinaryRows.length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedBinaryRows) : message.serializedBinaryRows; + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (typeof message.rowCount === "number") + object.rowCount = options.longs === String ? String(message.rowCount) : message.rowCount; + else + object.rowCount = options.longs === String ? $util.Long.prototype.toString.call(message.rowCount) : options.longs === Number ? new $util.LongBits(message.rowCount.low >>> 0, message.rowCount.high >>> 0).toNumber() : message.rowCount; + return object; + }; + + /** + * Converts this AvroRows to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @instance + * @returns {Object.} JSON object + */ + AvroRows.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AvroRows; + })(); + + v1beta1.TableReadOptions = (function() { + + /** + * Properties of a TableReadOptions. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface ITableReadOptions + * @property {Array.|null} [selectedFields] TableReadOptions selectedFields + * @property {string|null} [rowRestriction] TableReadOptions rowRestriction + */ + + /** + * Constructs a new TableReadOptions. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a TableReadOptions. + * @implements ITableReadOptions + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.ITableReadOptions=} [properties] Properties to set + */ + function TableReadOptions(properties) { + this.selectedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableReadOptions selectedFields. + * @member {Array.} selectedFields + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @instance + */ + TableReadOptions.prototype.selectedFields = $util.emptyArray; + + /** + * TableReadOptions rowRestriction. + * @member {string} rowRestriction + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @instance + */ + TableReadOptions.prototype.rowRestriction = ""; + + /** + * Creates a new TableReadOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ITableReadOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.TableReadOptions} TableReadOptions instance + */ + TableReadOptions.create = function create(properties) { + return new TableReadOptions(properties); + }; + + /** + * Encodes the specified TableReadOptions message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableReadOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ITableReadOptions} message TableReadOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableReadOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selectedFields != null && message.selectedFields.length) + for (var i = 0; i < message.selectedFields.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectedFields[i]); + if (message.rowRestriction != null && message.hasOwnProperty("rowRestriction")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rowRestriction); + return writer; + }; + + /** + * Encodes the specified TableReadOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableReadOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ITableReadOptions} message TableReadOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableReadOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableReadOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.TableReadOptions} TableReadOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableReadOptions.decode = function decode(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.storage.v1beta1.TableReadOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.selectedFields && message.selectedFields.length)) + message.selectedFields = []; + message.selectedFields.push(reader.string()); + break; + case 2: + message.rowRestriction = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableReadOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.TableReadOptions} TableReadOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableReadOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableReadOptions message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableReadOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selectedFields != null && message.hasOwnProperty("selectedFields")) { + if (!Array.isArray(message.selectedFields)) + return "selectedFields: array expected"; + for (var i = 0; i < message.selectedFields.length; ++i) + if (!$util.isString(message.selectedFields[i])) + return "selectedFields: string[] expected"; + } + if (message.rowRestriction != null && message.hasOwnProperty("rowRestriction")) + if (!$util.isString(message.rowRestriction)) + return "rowRestriction: string expected"; + return null; + }; + + /** + * Creates a TableReadOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.TableReadOptions} TableReadOptions + */ + TableReadOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions(); + if (object.selectedFields) { + if (!Array.isArray(object.selectedFields)) + throw TypeError(".google.cloud.bigquery.storage.v1beta1.TableReadOptions.selectedFields: array expected"); + message.selectedFields = []; + for (var i = 0; i < object.selectedFields.length; ++i) + message.selectedFields[i] = String(object.selectedFields[i]); + } + if (object.rowRestriction != null) + message.rowRestriction = String(object.rowRestriction); + return message; + }; + + /** + * Creates a plain object from a TableReadOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @static + * @param {google.cloud.bigquery.storage.v1beta1.TableReadOptions} message TableReadOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableReadOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.selectedFields = []; + if (options.defaults) + object.rowRestriction = ""; + if (message.selectedFields && message.selectedFields.length) { + object.selectedFields = []; + for (var j = 0; j < message.selectedFields.length; ++j) + object.selectedFields[j] = message.selectedFields[j]; + } + if (message.rowRestriction != null && message.hasOwnProperty("rowRestriction")) + object.rowRestriction = message.rowRestriction; + return object; + }; + + /** + * Converts this TableReadOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @instance + * @returns {Object.} JSON object + */ + TableReadOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TableReadOptions; + })(); + + v1beta1.BigQueryStorage = (function() { + + /** + * Constructs a new BigQueryStorage service. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a BigQueryStorage + * @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 BigQueryStorage(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (BigQueryStorage.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BigQueryStorage; + + /** + * Creates new BigQueryStorage service using the specified rpc implementation. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @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 {BigQueryStorage} RPC service. Useful where requests and/or responses are streamed. + */ + BigQueryStorage.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#createReadSession}. + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @typedef CreateReadSessionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.storage.v1beta1.ReadSession} [response] ReadSession + */ + + /** + * Calls CreateReadSession. + * @function createReadSession + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @instance + * @param {google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest} request CreateReadSessionRequest message or plain object + * @param {google.cloud.bigquery.storage.v1beta1.BigQueryStorage.CreateReadSessionCallback} callback Node-style callback called with the error, if any, and ReadSession + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigQueryStorage.prototype.createReadSession = function createReadSession(request, callback) { + return this.rpcCall(createReadSession, $root.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest, $root.google.cloud.bigquery.storage.v1beta1.ReadSession, request, callback); + }, "name", { value: "CreateReadSession" }); + + /** + * Calls CreateReadSession. + * @function createReadSession + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @instance + * @param {google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest} request CreateReadSessionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#readRows}. + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @typedef ReadRowsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} [response] ReadRowsResponse + */ + + /** + * Calls ReadRows. + * @function readRows + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @instance + * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsRequest} request ReadRowsRequest message or plain object + * @param {google.cloud.bigquery.storage.v1beta1.BigQueryStorage.ReadRowsCallback} callback Node-style callback called with the error, if any, and ReadRowsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigQueryStorage.prototype.readRows = function readRows(request, callback) { + return this.rpcCall(readRows, $root.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest, $root.google.cloud.bigquery.storage.v1beta1.ReadRowsResponse, request, callback); + }, "name", { value: "ReadRows" }); + + /** + * Calls ReadRows. + * @function readRows + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @instance + * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsRequest} request ReadRowsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#batchCreateReadSessionStreams}. + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @typedef BatchCreateReadSessionStreamsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse} [response] BatchCreateReadSessionStreamsResponse + */ + + /** + * Calls BatchCreateReadSessionStreams. + * @function batchCreateReadSessionStreams + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @instance + * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest} request BatchCreateReadSessionStreamsRequest message or plain object + * @param {google.cloud.bigquery.storage.v1beta1.BigQueryStorage.BatchCreateReadSessionStreamsCallback} callback Node-style callback called with the error, if any, and BatchCreateReadSessionStreamsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigQueryStorage.prototype.batchCreateReadSessionStreams = function batchCreateReadSessionStreams(request, callback) { + return this.rpcCall(batchCreateReadSessionStreams, $root.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest, $root.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse, request, callback); + }, "name", { value: "BatchCreateReadSessionStreams" }); + + /** + * Calls BatchCreateReadSessionStreams. + * @function batchCreateReadSessionStreams + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @instance + * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest} request BatchCreateReadSessionStreamsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#finalizeStream}. + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @typedef FinalizeStreamCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls FinalizeStream. + * @function finalizeStream + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @instance + * @param {google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest} request FinalizeStreamRequest message or plain object + * @param {google.cloud.bigquery.storage.v1beta1.BigQueryStorage.FinalizeStreamCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigQueryStorage.prototype.finalizeStream = function finalizeStream(request, callback) { + return this.rpcCall(finalizeStream, $root.google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "FinalizeStream" }); + + /** + * Calls FinalizeStream. + * @function finalizeStream + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @instance + * @param {google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest} request FinalizeStreamRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#splitReadStream}. + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @typedef SplitReadStreamCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse} [response] SplitReadStreamResponse + */ + + /** + * Calls SplitReadStream. + * @function splitReadStream + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @instance + * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest} request SplitReadStreamRequest message or plain object + * @param {google.cloud.bigquery.storage.v1beta1.BigQueryStorage.SplitReadStreamCallback} callback Node-style callback called with the error, if any, and SplitReadStreamResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigQueryStorage.prototype.splitReadStream = function splitReadStream(request, callback) { + return this.rpcCall(splitReadStream, $root.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest, $root.google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse, request, callback); + }, "name", { value: "SplitReadStream" }); + + /** + * Calls SplitReadStream. + * @function splitReadStream + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @instance + * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest} request SplitReadStreamRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return BigQueryStorage; + })(); + + v1beta1.Stream = (function() { + + /** + * Properties of a Stream. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IStream + * @property {string|null} [name] Stream name + */ + + /** + * Constructs a new Stream. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a Stream. + * @implements IStream + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IStream=} [properties] Properties to set + */ + function Stream(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Stream name. + * @member {string} name + * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @instance + */ + Stream.prototype.name = ""; + + /** + * Creates a new Stream instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IStream=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.Stream} Stream instance + */ + Stream.create = function create(properties) { + return new Stream(properties); + }; + + /** + * Encodes the specified Stream message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Stream.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IStream} message Stream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Stream.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified Stream message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Stream.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IStream} message Stream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Stream.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Stream message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.Stream} Stream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Stream.decode = function decode(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.storage.v1beta1.Stream(); + 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 Stream message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.Stream} Stream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Stream.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Stream message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Stream.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 Stream message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.Stream} Stream + */ + Stream.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.Stream) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.Stream(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a Stream message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @static + * @param {google.cloud.bigquery.storage.v1beta1.Stream} message Stream + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Stream.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 Stream to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @instance + * @returns {Object.} JSON object + */ + Stream.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Stream; + })(); + + v1beta1.StreamPosition = (function() { + + /** + * Properties of a StreamPosition. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IStreamPosition + * @property {google.cloud.bigquery.storage.v1beta1.IStream|null} [stream] StreamPosition stream + * @property {number|Long|null} [offset] StreamPosition offset + */ + + /** + * Constructs a new StreamPosition. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a StreamPosition. + * @implements IStreamPosition + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IStreamPosition=} [properties] Properties to set + */ + function StreamPosition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamPosition stream. + * @member {google.cloud.bigquery.storage.v1beta1.IStream|null|undefined} stream + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * @instance + */ + StreamPosition.prototype.stream = null; + + /** + * StreamPosition offset. + * @member {number|Long} offset + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * @instance + */ + StreamPosition.prototype.offset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new StreamPosition instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IStreamPosition=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.StreamPosition} StreamPosition instance + */ + StreamPosition.create = function create(properties) { + return new StreamPosition(properties); + }; + + /** + * Encodes the specified StreamPosition message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamPosition.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IStreamPosition} message StreamPosition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamPosition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stream != null && message.hasOwnProperty("stream")) + $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.stream, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.offset != null && message.hasOwnProperty("offset")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.offset); + return writer; + }; + + /** + * Encodes the specified StreamPosition message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamPosition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IStreamPosition} message StreamPosition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamPosition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamPosition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.StreamPosition} StreamPosition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamPosition.decode = function decode(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.storage.v1beta1.StreamPosition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); + break; + case 2: + message.offset = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamPosition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.StreamPosition} StreamPosition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamPosition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamPosition message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamPosition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stream != null && message.hasOwnProperty("stream")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.stream); + if (error) + return "stream." + error; + } + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset) && !(message.offset && $util.isInteger(message.offset.low) && $util.isInteger(message.offset.high))) + return "offset: integer|Long expected"; + return null; + }; + + /** + * Creates a StreamPosition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.StreamPosition} StreamPosition + */ + StreamPosition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.StreamPosition) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.StreamPosition(); + if (object.stream != null) { + if (typeof object.stream !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.StreamPosition.stream: object expected"); + message.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.fromObject(object.stream); + } + if (object.offset != null) + if ($util.Long) + (message.offset = $util.Long.fromValue(object.offset)).unsigned = false; + else if (typeof object.offset === "string") + message.offset = parseInt(object.offset, 10); + else if (typeof object.offset === "number") + message.offset = object.offset; + else if (typeof object.offset === "object") + message.offset = new $util.LongBits(object.offset.low >>> 0, object.offset.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a StreamPosition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * @static + * @param {google.cloud.bigquery.storage.v1beta1.StreamPosition} message StreamPosition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamPosition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.stream = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.offset = options.longs === String ? "0" : 0; + } + if (message.stream != null && message.hasOwnProperty("stream")) + object.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.toObject(message.stream, options); + if (message.offset != null && message.hasOwnProperty("offset")) + if (typeof message.offset === "number") + object.offset = options.longs === String ? String(message.offset) : message.offset; + else + object.offset = options.longs === String ? $util.Long.prototype.toString.call(message.offset) : options.longs === Number ? new $util.LongBits(message.offset.low >>> 0, message.offset.high >>> 0).toNumber() : message.offset; + return object; + }; + + /** + * Converts this StreamPosition to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * @instance + * @returns {Object.} JSON object + */ + StreamPosition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StreamPosition; + })(); + + v1beta1.ReadSession = (function() { + + /** + * Properties of a ReadSession. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IReadSession + * @property {string|null} [name] ReadSession name + * @property {google.protobuf.ITimestamp|null} [expireTime] ReadSession expireTime + * @property {google.cloud.bigquery.storage.v1beta1.IAvroSchema|null} [avroSchema] ReadSession avroSchema + * @property {google.cloud.bigquery.storage.v1beta1.IArrowSchema|null} [arrowSchema] ReadSession arrowSchema + * @property {Array.|null} [streams] ReadSession streams + * @property {google.cloud.bigquery.storage.v1beta1.ITableReference|null} [tableReference] ReadSession tableReference + * @property {google.cloud.bigquery.storage.v1beta1.ITableModifiers|null} [tableModifiers] ReadSession tableModifiers + * @property {google.cloud.bigquery.storage.v1beta1.ShardingStrategy|null} [shardingStrategy] ReadSession shardingStrategy + */ + + /** + * Constructs a new ReadSession. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a ReadSession. + * @implements IReadSession + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IReadSession=} [properties] Properties to set + */ + function ReadSession(properties) { + this.streams = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadSession name. + * @member {string} name + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @instance + */ + ReadSession.prototype.name = ""; + + /** + * ReadSession expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @instance + */ + ReadSession.prototype.expireTime = null; + + /** + * ReadSession avroSchema. + * @member {google.cloud.bigquery.storage.v1beta1.IAvroSchema|null|undefined} avroSchema + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @instance + */ + ReadSession.prototype.avroSchema = null; + + /** + * ReadSession arrowSchema. + * @member {google.cloud.bigquery.storage.v1beta1.IArrowSchema|null|undefined} arrowSchema + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @instance + */ + ReadSession.prototype.arrowSchema = null; + + /** + * ReadSession streams. + * @member {Array.} streams + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @instance + */ + ReadSession.prototype.streams = $util.emptyArray; + + /** + * ReadSession tableReference. + * @member {google.cloud.bigquery.storage.v1beta1.ITableReference|null|undefined} tableReference + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @instance + */ + ReadSession.prototype.tableReference = null; + + /** + * ReadSession tableModifiers. + * @member {google.cloud.bigquery.storage.v1beta1.ITableModifiers|null|undefined} tableModifiers + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @instance + */ + ReadSession.prototype.tableModifiers = null; + + /** + * ReadSession shardingStrategy. + * @member {google.cloud.bigquery.storage.v1beta1.ShardingStrategy} shardingStrategy + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @instance + */ + ReadSession.prototype.shardingStrategy = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReadSession schema. + * @member {"avroSchema"|"arrowSchema"|undefined} schema + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @instance + */ + Object.defineProperty(ReadSession.prototype, "schema", { + get: $util.oneOfGetter($oneOfFields = ["avroSchema", "arrowSchema"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReadSession instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IReadSession=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.ReadSession} ReadSession instance + */ + ReadSession.create = function create(properties) { + return new ReadSession(properties); + }; + + /** + * Encodes the specified ReadSession message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadSession.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IReadSession} message ReadSession message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadSession.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.streams != null && message.streams.length) + for (var i = 0; i < message.streams.length; ++i) + $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.streams[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.avroSchema != null && message.hasOwnProperty("avroSchema")) + $root.google.cloud.bigquery.storage.v1beta1.AvroSchema.encode(message.avroSchema, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.arrowSchema != null && message.hasOwnProperty("arrowSchema")) + $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema.encode(message.arrowSchema, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.tableReference != null && message.hasOwnProperty("tableReference")) + $root.google.cloud.bigquery.storage.v1beta1.TableReference.encode(message.tableReference, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) + $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.encode(message.tableModifiers, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.shardingStrategy != null && message.hasOwnProperty("shardingStrategy")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.shardingStrategy); + return writer; + }; + + /** + * Encodes the specified ReadSession message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadSession.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IReadSession} message ReadSession message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadSession.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadSession message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.ReadSession} ReadSession + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadSession.decode = function decode(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.storage.v1beta1.ReadSession(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.avroSchema = $root.google.cloud.bigquery.storage.v1beta1.AvroSchema.decode(reader, reader.uint32()); + break; + case 6: + message.arrowSchema = $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.streams && message.streams.length)) + message.streams = []; + message.streams.push($root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32())); + break; + case 7: + message.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.decode(reader, reader.uint32()); + break; + case 8: + message.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.decode(reader, reader.uint32()); + break; + case 9: + message.shardingStrategy = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadSession message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.ReadSession} ReadSession + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadSession.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadSession message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadSession.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.avroSchema != null && message.hasOwnProperty("avroSchema")) { + properties.schema = 1; + { + var error = $root.google.cloud.bigquery.storage.v1beta1.AvroSchema.verify(message.avroSchema); + if (error) + return "avroSchema." + error; + } + } + if (message.arrowSchema != null && message.hasOwnProperty("arrowSchema")) { + if (properties.schema === 1) + return "schema: multiple values"; + properties.schema = 1; + { + var error = $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema.verify(message.arrowSchema); + if (error) + return "arrowSchema." + error; + } + } + if (message.streams != null && message.hasOwnProperty("streams")) { + if (!Array.isArray(message.streams)) + return "streams: array expected"; + for (var i = 0; i < message.streams.length; ++i) { + var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.streams[i]); + if (error) + return "streams." + error; + } + } + if (message.tableReference != null && message.hasOwnProperty("tableReference")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.TableReference.verify(message.tableReference); + if (error) + return "tableReference." + error; + } + if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.verify(message.tableModifiers); + if (error) + return "tableModifiers." + error; + } + if (message.shardingStrategy != null && message.hasOwnProperty("shardingStrategy")) + switch (message.shardingStrategy) { + default: + return "shardingStrategy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ReadSession message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.ReadSession} ReadSession + */ + ReadSession.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.ReadSession) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.ReadSession(); + if (object.name != null) + message.name = String(object.name); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadSession.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.avroSchema != null) { + if (typeof object.avroSchema !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadSession.avroSchema: object expected"); + message.avroSchema = $root.google.cloud.bigquery.storage.v1beta1.AvroSchema.fromObject(object.avroSchema); + } + if (object.arrowSchema != null) { + if (typeof object.arrowSchema !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadSession.arrowSchema: object expected"); + message.arrowSchema = $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema.fromObject(object.arrowSchema); + } + if (object.streams) { + if (!Array.isArray(object.streams)) + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadSession.streams: array expected"); + message.streams = []; + for (var i = 0; i < object.streams.length; ++i) { + if (typeof object.streams[i] !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadSession.streams: object expected"); + message.streams[i] = $root.google.cloud.bigquery.storage.v1beta1.Stream.fromObject(object.streams[i]); + } + } + if (object.tableReference != null) { + if (typeof object.tableReference !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadSession.tableReference: object expected"); + message.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.fromObject(object.tableReference); + } + if (object.tableModifiers != null) { + if (typeof object.tableModifiers !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadSession.tableModifiers: object expected"); + message.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.fromObject(object.tableModifiers); + } + switch (object.shardingStrategy) { + case "SHARDING_STRATEGY_UNSPECIFIED": + case 0: + message.shardingStrategy = 0; + break; + case "LIQUID": + case 1: + message.shardingStrategy = 1; + break; + case "BALANCED": + case 2: + message.shardingStrategy = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ReadSession message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ReadSession} message ReadSession + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadSession.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.streams = []; + if (options.defaults) { + object.name = ""; + object.expireTime = null; + object.tableReference = null; + object.tableModifiers = null; + object.shardingStrategy = options.enums === String ? "SHARDING_STRATEGY_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.streams && message.streams.length) { + object.streams = []; + for (var j = 0; j < message.streams.length; ++j) + object.streams[j] = $root.google.cloud.bigquery.storage.v1beta1.Stream.toObject(message.streams[j], options); + } + if (message.avroSchema != null && message.hasOwnProperty("avroSchema")) { + object.avroSchema = $root.google.cloud.bigquery.storage.v1beta1.AvroSchema.toObject(message.avroSchema, options); + if (options.oneofs) + object.schema = "avroSchema"; + } + if (message.arrowSchema != null && message.hasOwnProperty("arrowSchema")) { + object.arrowSchema = $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema.toObject(message.arrowSchema, options); + if (options.oneofs) + object.schema = "arrowSchema"; + } + if (message.tableReference != null && message.hasOwnProperty("tableReference")) + object.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.toObject(message.tableReference, options); + if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) + object.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.toObject(message.tableModifiers, options); + if (message.shardingStrategy != null && message.hasOwnProperty("shardingStrategy")) + object.shardingStrategy = options.enums === String ? $root.google.cloud.bigquery.storage.v1beta1.ShardingStrategy[message.shardingStrategy] : message.shardingStrategy; + return object; + }; + + /** + * Converts this ReadSession to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @instance + * @returns {Object.} JSON object + */ + ReadSession.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReadSession; + })(); + + v1beta1.CreateReadSessionRequest = (function() { + + /** + * Properties of a CreateReadSessionRequest. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface ICreateReadSessionRequest + * @property {google.cloud.bigquery.storage.v1beta1.ITableReference|null} [tableReference] CreateReadSessionRequest tableReference + * @property {string|null} [parent] CreateReadSessionRequest parent + * @property {google.cloud.bigquery.storage.v1beta1.ITableModifiers|null} [tableModifiers] CreateReadSessionRequest tableModifiers + * @property {number|null} [requestedStreams] CreateReadSessionRequest requestedStreams + * @property {google.cloud.bigquery.storage.v1beta1.ITableReadOptions|null} [readOptions] CreateReadSessionRequest readOptions + * @property {google.cloud.bigquery.storage.v1beta1.DataFormat|null} [format] CreateReadSessionRequest format + * @property {google.cloud.bigquery.storage.v1beta1.ShardingStrategy|null} [shardingStrategy] CreateReadSessionRequest shardingStrategy + */ + + /** + * Constructs a new CreateReadSessionRequest. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a CreateReadSessionRequest. + * @implements ICreateReadSessionRequest + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest=} [properties] Properties to set + */ + function CreateReadSessionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateReadSessionRequest tableReference. + * @member {google.cloud.bigquery.storage.v1beta1.ITableReference|null|undefined} tableReference + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @instance + */ + CreateReadSessionRequest.prototype.tableReference = null; + + /** + * CreateReadSessionRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @instance + */ + CreateReadSessionRequest.prototype.parent = ""; + + /** + * CreateReadSessionRequest tableModifiers. + * @member {google.cloud.bigquery.storage.v1beta1.ITableModifiers|null|undefined} tableModifiers + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @instance + */ + CreateReadSessionRequest.prototype.tableModifiers = null; + + /** + * CreateReadSessionRequest requestedStreams. + * @member {number} requestedStreams + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @instance + */ + CreateReadSessionRequest.prototype.requestedStreams = 0; + + /** + * CreateReadSessionRequest readOptions. + * @member {google.cloud.bigquery.storage.v1beta1.ITableReadOptions|null|undefined} readOptions + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @instance + */ + CreateReadSessionRequest.prototype.readOptions = null; + + /** + * CreateReadSessionRequest format. + * @member {google.cloud.bigquery.storage.v1beta1.DataFormat} format + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @instance + */ + CreateReadSessionRequest.prototype.format = 0; + + /** + * CreateReadSessionRequest shardingStrategy. + * @member {google.cloud.bigquery.storage.v1beta1.ShardingStrategy} shardingStrategy + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @instance + */ + CreateReadSessionRequest.prototype.shardingStrategy = 0; + + /** + * Creates a new CreateReadSessionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest} CreateReadSessionRequest instance + */ + CreateReadSessionRequest.create = function create(properties) { + return new CreateReadSessionRequest(properties); + }; + + /** + * Encodes the specified CreateReadSessionRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest} message CreateReadSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateReadSessionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tableReference != null && message.hasOwnProperty("tableReference")) + $root.google.cloud.bigquery.storage.v1beta1.TableReference.encode(message.tableReference, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) + $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.encode(message.tableModifiers, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestedStreams != null && message.hasOwnProperty("requestedStreams")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.requestedStreams); + if (message.readOptions != null && message.hasOwnProperty("readOptions")) + $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions.encode(message.readOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.format != null && message.hasOwnProperty("format")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.format); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.parent); + if (message.shardingStrategy != null && message.hasOwnProperty("shardingStrategy")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.shardingStrategy); + return writer; + }; + + /** + * Encodes the specified CreateReadSessionRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest} message CreateReadSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateReadSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateReadSessionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest} CreateReadSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateReadSessionRequest.decode = function decode(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.storage.v1beta1.CreateReadSessionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.decode(reader, reader.uint32()); + break; + case 6: + message.parent = reader.string(); + break; + case 2: + message.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.decode(reader, reader.uint32()); + break; + case 3: + message.requestedStreams = reader.int32(); + break; + case 4: + message.readOptions = $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions.decode(reader, reader.uint32()); + break; + case 5: + message.format = reader.int32(); + break; + case 7: + message.shardingStrategy = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateReadSessionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest} CreateReadSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateReadSessionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateReadSessionRequest message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateReadSessionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tableReference != null && message.hasOwnProperty("tableReference")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.TableReference.verify(message.tableReference); + if (error) + return "tableReference." + error; + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.verify(message.tableModifiers); + if (error) + return "tableModifiers." + error; + } + if (message.requestedStreams != null && message.hasOwnProperty("requestedStreams")) + if (!$util.isInteger(message.requestedStreams)) + return "requestedStreams: integer expected"; + if (message.readOptions != null && message.hasOwnProperty("readOptions")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions.verify(message.readOptions); + if (error) + return "readOptions." + error; + } + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + case 3: + break; + } + if (message.shardingStrategy != null && message.hasOwnProperty("shardingStrategy")) + switch (message.shardingStrategy) { + default: + return "shardingStrategy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a CreateReadSessionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest} CreateReadSessionRequest + */ + CreateReadSessionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest(); + if (object.tableReference != null) { + if (typeof object.tableReference !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest.tableReference: object expected"); + message.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.fromObject(object.tableReference); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.tableModifiers != null) { + if (typeof object.tableModifiers !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest.tableModifiers: object expected"); + message.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.fromObject(object.tableModifiers); + } + if (object.requestedStreams != null) + message.requestedStreams = object.requestedStreams | 0; + if (object.readOptions != null) { + if (typeof object.readOptions !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest.readOptions: object expected"); + message.readOptions = $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions.fromObject(object.readOptions); + } + switch (object.format) { + case "DATA_FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "AVRO": + case 1: + message.format = 1; + break; + case "ARROW": + case 3: + message.format = 3; + break; + } + switch (object.shardingStrategy) { + case "SHARDING_STRATEGY_UNSPECIFIED": + case 0: + message.shardingStrategy = 0; + break; + case "LIQUID": + case 1: + message.shardingStrategy = 1; + break; + case "BALANCED": + case 2: + message.shardingStrategy = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a CreateReadSessionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest} message CreateReadSessionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateReadSessionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tableReference = null; + object.tableModifiers = null; + object.requestedStreams = 0; + object.readOptions = null; + object.format = options.enums === String ? "DATA_FORMAT_UNSPECIFIED" : 0; + object.parent = ""; + object.shardingStrategy = options.enums === String ? "SHARDING_STRATEGY_UNSPECIFIED" : 0; + } + if (message.tableReference != null && message.hasOwnProperty("tableReference")) + object.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.toObject(message.tableReference, options); + if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) + object.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.toObject(message.tableModifiers, options); + if (message.requestedStreams != null && message.hasOwnProperty("requestedStreams")) + object.requestedStreams = message.requestedStreams; + if (message.readOptions != null && message.hasOwnProperty("readOptions")) + object.readOptions = $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions.toObject(message.readOptions, options); + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.cloud.bigquery.storage.v1beta1.DataFormat[message.format] : message.format; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.shardingStrategy != null && message.hasOwnProperty("shardingStrategy")) + object.shardingStrategy = options.enums === String ? $root.google.cloud.bigquery.storage.v1beta1.ShardingStrategy[message.shardingStrategy] : message.shardingStrategy; + return object; + }; + + /** + * Converts this CreateReadSessionRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateReadSessionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateReadSessionRequest; + })(); + + /** + * DataFormat enum. + * @name google.cloud.bigquery.storage.v1beta1.DataFormat + * @enum {string} + * @property {number} DATA_FORMAT_UNSPECIFIED=0 DATA_FORMAT_UNSPECIFIED value + * @property {number} AVRO=1 AVRO value + * @property {number} ARROW=3 ARROW value + */ + v1beta1.DataFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "AVRO"] = 1; + values[valuesById[3] = "ARROW"] = 3; + return values; + })(); + + /** + * ShardingStrategy enum. + * @name google.cloud.bigquery.storage.v1beta1.ShardingStrategy + * @enum {string} + * @property {number} SHARDING_STRATEGY_UNSPECIFIED=0 SHARDING_STRATEGY_UNSPECIFIED value + * @property {number} LIQUID=1 LIQUID value + * @property {number} BALANCED=2 BALANCED value + */ + v1beta1.ShardingStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHARDING_STRATEGY_UNSPECIFIED"] = 0; + values[valuesById[1] = "LIQUID"] = 1; + values[valuesById[2] = "BALANCED"] = 2; + return values; + })(); + + v1beta1.ReadRowsRequest = (function() { + + /** + * Properties of a ReadRowsRequest. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IReadRowsRequest + * @property {google.cloud.bigquery.storage.v1beta1.IStreamPosition|null} [readPosition] ReadRowsRequest readPosition + */ + + /** + * Constructs a new ReadRowsRequest. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a ReadRowsRequest. + * @implements IReadRowsRequest + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsRequest=} [properties] Properties to set + */ + function ReadRowsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadRowsRequest readPosition. + * @member {google.cloud.bigquery.storage.v1beta1.IStreamPosition|null|undefined} readPosition + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.readPosition = null; + + /** + * Creates a new ReadRowsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsRequest} ReadRowsRequest instance + */ + ReadRowsRequest.create = function create(properties) { + return new ReadRowsRequest(properties); + }; + + /** + * Encodes the specified ReadRowsRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsRequest} message ReadRowsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadRowsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readPosition != null && message.hasOwnProperty("readPosition")) + $root.google.cloud.bigquery.storage.v1beta1.StreamPosition.encode(message.readPosition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadRowsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsRequest} message ReadRowsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadRowsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadRowsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsRequest} ReadRowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadRowsRequest.decode = function decode(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.storage.v1beta1.ReadRowsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.readPosition = $root.google.cloud.bigquery.storage.v1beta1.StreamPosition.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadRowsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsRequest} ReadRowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadRowsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadRowsRequest message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadRowsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readPosition != null && message.hasOwnProperty("readPosition")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.StreamPosition.verify(message.readPosition); + if (error) + return "readPosition." + error; + } + return null; + }; + + /** + * Creates a ReadRowsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsRequest} ReadRowsRequest + */ + ReadRowsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest(); + if (object.readPosition != null) { + if (typeof object.readPosition !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadRowsRequest.readPosition: object expected"); + message.readPosition = $root.google.cloud.bigquery.storage.v1beta1.StreamPosition.fromObject(object.readPosition); + } + return message; + }; + + /** + * Creates a plain object from a ReadRowsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ReadRowsRequest} message ReadRowsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadRowsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.readPosition = null; + if (message.readPosition != null && message.hasOwnProperty("readPosition")) + object.readPosition = $root.google.cloud.bigquery.storage.v1beta1.StreamPosition.toObject(message.readPosition, options); + return object; + }; + + /** + * Converts this ReadRowsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @instance + * @returns {Object.} JSON object + */ + ReadRowsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReadRowsRequest; + })(); + + v1beta1.StreamStatus = (function() { + + /** + * Properties of a StreamStatus. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IStreamStatus + * @property {number|Long|null} [estimatedRowCount] StreamStatus estimatedRowCount + * @property {number|null} [fractionConsumed] StreamStatus fractionConsumed + * @property {google.cloud.bigquery.storage.v1beta1.IProgress|null} [progress] StreamStatus progress + * @property {boolean|null} [isSplittable] StreamStatus isSplittable + */ + + /** + * Constructs a new StreamStatus. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a StreamStatus. + * @implements IStreamStatus + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IStreamStatus=} [properties] Properties to set + */ + function StreamStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamStatus estimatedRowCount. + * @member {number|Long} estimatedRowCount + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @instance + */ + StreamStatus.prototype.estimatedRowCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * StreamStatus fractionConsumed. + * @member {number} fractionConsumed + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @instance + */ + StreamStatus.prototype.fractionConsumed = 0; + + /** + * StreamStatus progress. + * @member {google.cloud.bigquery.storage.v1beta1.IProgress|null|undefined} progress + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @instance + */ + StreamStatus.prototype.progress = null; + + /** + * StreamStatus isSplittable. + * @member {boolean} isSplittable + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @instance + */ + StreamStatus.prototype.isSplittable = false; + + /** + * Creates a new StreamStatus instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IStreamStatus=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.StreamStatus} StreamStatus instance + */ + StreamStatus.create = function create(properties) { + return new StreamStatus(properties); + }; + + /** + * Encodes the specified StreamStatus message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IStreamStatus} message StreamStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.estimatedRowCount != null && message.hasOwnProperty("estimatedRowCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.estimatedRowCount); + if (message.fractionConsumed != null && message.hasOwnProperty("fractionConsumed")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.fractionConsumed); + if (message.isSplittable != null && message.hasOwnProperty("isSplittable")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isSplittable); + if (message.progress != null && message.hasOwnProperty("progress")) + $root.google.cloud.bigquery.storage.v1beta1.Progress.encode(message.progress, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamStatus message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IStreamStatus} message StreamStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.StreamStatus} StreamStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamStatus.decode = function decode(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.storage.v1beta1.StreamStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.estimatedRowCount = reader.int64(); + break; + case 2: + message.fractionConsumed = reader.float(); + break; + case 4: + message.progress = $root.google.cloud.bigquery.storage.v1beta1.Progress.decode(reader, reader.uint32()); + break; + case 3: + message.isSplittable = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.StreamStatus} StreamStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamStatus message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.estimatedRowCount != null && message.hasOwnProperty("estimatedRowCount")) + if (!$util.isInteger(message.estimatedRowCount) && !(message.estimatedRowCount && $util.isInteger(message.estimatedRowCount.low) && $util.isInteger(message.estimatedRowCount.high))) + return "estimatedRowCount: integer|Long expected"; + if (message.fractionConsumed != null && message.hasOwnProperty("fractionConsumed")) + if (typeof message.fractionConsumed !== "number") + return "fractionConsumed: number expected"; + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.Progress.verify(message.progress); + if (error) + return "progress." + error; + } + if (message.isSplittable != null && message.hasOwnProperty("isSplittable")) + if (typeof message.isSplittable !== "boolean") + return "isSplittable: boolean expected"; + return null; + }; + + /** + * Creates a StreamStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.StreamStatus} StreamStatus + */ + StreamStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.StreamStatus) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.StreamStatus(); + if (object.estimatedRowCount != null) + if ($util.Long) + (message.estimatedRowCount = $util.Long.fromValue(object.estimatedRowCount)).unsigned = false; + else if (typeof object.estimatedRowCount === "string") + message.estimatedRowCount = parseInt(object.estimatedRowCount, 10); + else if (typeof object.estimatedRowCount === "number") + message.estimatedRowCount = object.estimatedRowCount; + else if (typeof object.estimatedRowCount === "object") + message.estimatedRowCount = new $util.LongBits(object.estimatedRowCount.low >>> 0, object.estimatedRowCount.high >>> 0).toNumber(); + if (object.fractionConsumed != null) + message.fractionConsumed = Number(object.fractionConsumed); + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.StreamStatus.progress: object expected"); + message.progress = $root.google.cloud.bigquery.storage.v1beta1.Progress.fromObject(object.progress); + } + if (object.isSplittable != null) + message.isSplittable = Boolean(object.isSplittable); + return message; + }; + + /** + * Creates a plain object from a StreamStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @static + * @param {google.cloud.bigquery.storage.v1beta1.StreamStatus} message StreamStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamStatus.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.estimatedRowCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.estimatedRowCount = options.longs === String ? "0" : 0; + object.fractionConsumed = 0; + object.isSplittable = false; + object.progress = null; + } + if (message.estimatedRowCount != null && message.hasOwnProperty("estimatedRowCount")) + if (typeof message.estimatedRowCount === "number") + object.estimatedRowCount = options.longs === String ? String(message.estimatedRowCount) : message.estimatedRowCount; + else + object.estimatedRowCount = options.longs === String ? $util.Long.prototype.toString.call(message.estimatedRowCount) : options.longs === Number ? new $util.LongBits(message.estimatedRowCount.low >>> 0, message.estimatedRowCount.high >>> 0).toNumber() : message.estimatedRowCount; + if (message.fractionConsumed != null && message.hasOwnProperty("fractionConsumed")) + object.fractionConsumed = options.json && !isFinite(message.fractionConsumed) ? String(message.fractionConsumed) : message.fractionConsumed; + if (message.isSplittable != null && message.hasOwnProperty("isSplittable")) + object.isSplittable = message.isSplittable; + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.cloud.bigquery.storage.v1beta1.Progress.toObject(message.progress, options); + return object; + }; + + /** + * Converts this StreamStatus to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @instance + * @returns {Object.} JSON object + */ + StreamStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StreamStatus; + })(); + + v1beta1.Progress = (function() { + + /** + * Properties of a Progress. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IProgress + * @property {number|null} [atResponseStart] Progress atResponseStart + * @property {number|null} [atResponseEnd] Progress atResponseEnd + */ + + /** + * Constructs a new Progress. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a Progress. + * @implements IProgress + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IProgress=} [properties] Properties to set + */ + function Progress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Progress atResponseStart. + * @member {number} atResponseStart + * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @instance + */ + Progress.prototype.atResponseStart = 0; + + /** + * Progress atResponseEnd. + * @member {number} atResponseEnd + * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @instance + */ + Progress.prototype.atResponseEnd = 0; + + /** + * Creates a new Progress instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IProgress=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.Progress} Progress instance + */ + Progress.create = function create(properties) { + return new Progress(properties); + }; + + /** + * Encodes the specified Progress message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Progress.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IProgress} message Progress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Progress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.atResponseStart != null && message.hasOwnProperty("atResponseStart")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.atResponseStart); + if (message.atResponseEnd != null && message.hasOwnProperty("atResponseEnd")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.atResponseEnd); + return writer; + }; + + /** + * Encodes the specified Progress message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Progress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IProgress} message Progress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Progress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Progress message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.Progress} Progress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Progress.decode = function decode(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.storage.v1beta1.Progress(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.atResponseStart = reader.float(); + break; + case 2: + message.atResponseEnd = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Progress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.Progress} Progress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Progress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Progress message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Progress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.atResponseStart != null && message.hasOwnProperty("atResponseStart")) + if (typeof message.atResponseStart !== "number") + return "atResponseStart: number expected"; + if (message.atResponseEnd != null && message.hasOwnProperty("atResponseEnd")) + if (typeof message.atResponseEnd !== "number") + return "atResponseEnd: number expected"; + return null; + }; + + /** + * Creates a Progress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.Progress} Progress + */ + Progress.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.Progress) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.Progress(); + if (object.atResponseStart != null) + message.atResponseStart = Number(object.atResponseStart); + if (object.atResponseEnd != null) + message.atResponseEnd = Number(object.atResponseEnd); + return message; + }; + + /** + * Creates a plain object from a Progress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @static + * @param {google.cloud.bigquery.storage.v1beta1.Progress} message Progress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Progress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.atResponseStart = 0; + object.atResponseEnd = 0; + } + if (message.atResponseStart != null && message.hasOwnProperty("atResponseStart")) + object.atResponseStart = options.json && !isFinite(message.atResponseStart) ? String(message.atResponseStart) : message.atResponseStart; + if (message.atResponseEnd != null && message.hasOwnProperty("atResponseEnd")) + object.atResponseEnd = options.json && !isFinite(message.atResponseEnd) ? String(message.atResponseEnd) : message.atResponseEnd; + return object; + }; + + /** + * Converts this Progress to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @instance + * @returns {Object.} JSON object + */ + Progress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Progress; + })(); + + v1beta1.ThrottleStatus = (function() { + + /** + * Properties of a ThrottleStatus. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IThrottleStatus + * @property {number|null} [throttlePercent] ThrottleStatus throttlePercent + */ + + /** + * Constructs a new ThrottleStatus. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a ThrottleStatus. + * @implements IThrottleStatus + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IThrottleStatus=} [properties] Properties to set + */ + function ThrottleStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ThrottleStatus throttlePercent. + * @member {number} throttlePercent + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @instance + */ + ThrottleStatus.prototype.throttlePercent = 0; + + /** + * Creates a new ThrottleStatus instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IThrottleStatus=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.ThrottleStatus} ThrottleStatus instance + */ + ThrottleStatus.create = function create(properties) { + return new ThrottleStatus(properties); + }; + + /** + * Encodes the specified ThrottleStatus message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ThrottleStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IThrottleStatus} message ThrottleStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThrottleStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.throttlePercent != null && message.hasOwnProperty("throttlePercent")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.throttlePercent); + return writer; + }; + + /** + * Encodes the specified ThrottleStatus message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ThrottleStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IThrottleStatus} message ThrottleStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThrottleStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ThrottleStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.ThrottleStatus} ThrottleStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThrottleStatus.decode = function decode(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.storage.v1beta1.ThrottleStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.throttlePercent = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ThrottleStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.ThrottleStatus} ThrottleStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThrottleStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ThrottleStatus message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ThrottleStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.throttlePercent != null && message.hasOwnProperty("throttlePercent")) + if (!$util.isInteger(message.throttlePercent)) + return "throttlePercent: integer expected"; + return null; + }; + + /** + * Creates a ThrottleStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.ThrottleStatus} ThrottleStatus + */ + ThrottleStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus(); + if (object.throttlePercent != null) + message.throttlePercent = object.throttlePercent | 0; + return message; + }; + + /** + * Creates a plain object from a ThrottleStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ThrottleStatus} message ThrottleStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ThrottleStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.throttlePercent = 0; + if (message.throttlePercent != null && message.hasOwnProperty("throttlePercent")) + object.throttlePercent = message.throttlePercent; + return object; + }; + + /** + * Converts this ThrottleStatus to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @instance + * @returns {Object.} JSON object + */ + ThrottleStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ThrottleStatus; + })(); + + v1beta1.ReadRowsResponse = (function() { + + /** + * Properties of a ReadRowsResponse. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IReadRowsResponse + * @property {google.cloud.bigquery.storage.v1beta1.IAvroRows|null} [avroRows] ReadRowsResponse avroRows + * @property {google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch|null} [arrowRecordBatch] ReadRowsResponse arrowRecordBatch + * @property {number|Long|null} [rowCount] ReadRowsResponse rowCount + * @property {google.cloud.bigquery.storage.v1beta1.IStreamStatus|null} [status] ReadRowsResponse status + * @property {google.cloud.bigquery.storage.v1beta1.IThrottleStatus|null} [throttleStatus] ReadRowsResponse throttleStatus + */ + + /** + * Constructs a new ReadRowsResponse. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a ReadRowsResponse. + * @implements IReadRowsResponse + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsResponse=} [properties] Properties to set + */ + function ReadRowsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadRowsResponse avroRows. + * @member {google.cloud.bigquery.storage.v1beta1.IAvroRows|null|undefined} avroRows + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.avroRows = null; + + /** + * ReadRowsResponse arrowRecordBatch. + * @member {google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch|null|undefined} arrowRecordBatch + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.arrowRecordBatch = null; + + /** + * ReadRowsResponse rowCount. + * @member {number|Long} rowCount + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.rowCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReadRowsResponse status. + * @member {google.cloud.bigquery.storage.v1beta1.IStreamStatus|null|undefined} status + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.status = null; + + /** + * ReadRowsResponse throttleStatus. + * @member {google.cloud.bigquery.storage.v1beta1.IThrottleStatus|null|undefined} throttleStatus + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.throttleStatus = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReadRowsResponse rows. + * @member {"avroRows"|"arrowRecordBatch"|undefined} rows + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @instance + */ + Object.defineProperty(ReadRowsResponse.prototype, "rows", { + get: $util.oneOfGetter($oneOfFields = ["avroRows", "arrowRecordBatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReadRowsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} ReadRowsResponse instance + */ + ReadRowsResponse.create = function create(properties) { + return new ReadRowsResponse(properties); + }; + + /** + * Encodes the specified ReadRowsResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsResponse} message ReadRowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadRowsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && message.hasOwnProperty("status")) + $root.google.cloud.bigquery.storage.v1beta1.StreamStatus.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.avroRows != null && message.hasOwnProperty("avroRows")) + $root.google.cloud.bigquery.storage.v1beta1.AvroRows.encode(message.avroRows, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.arrowRecordBatch != null && message.hasOwnProperty("arrowRecordBatch")) + $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.encode(message.arrowRecordBatch, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.throttleStatus != null && message.hasOwnProperty("throttleStatus")) + $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus.encode(message.throttleStatus, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.rowCount); + return writer; + }; + + /** + * Encodes the specified ReadRowsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsResponse} message ReadRowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadRowsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadRowsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} ReadRowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadRowsResponse.decode = function decode(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.storage.v1beta1.ReadRowsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.avroRows = $root.google.cloud.bigquery.storage.v1beta1.AvroRows.decode(reader, reader.uint32()); + break; + case 4: + message.arrowRecordBatch = $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.decode(reader, reader.uint32()); + break; + case 6: + message.rowCount = reader.int64(); + break; + case 2: + message.status = $root.google.cloud.bigquery.storage.v1beta1.StreamStatus.decode(reader, reader.uint32()); + break; + case 5: + message.throttleStatus = $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadRowsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} ReadRowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadRowsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadRowsResponse message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadRowsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.avroRows != null && message.hasOwnProperty("avroRows")) { + properties.rows = 1; + { + var error = $root.google.cloud.bigquery.storage.v1beta1.AvroRows.verify(message.avroRows); + if (error) + return "avroRows." + error; + } + } + if (message.arrowRecordBatch != null && message.hasOwnProperty("arrowRecordBatch")) { + if (properties.rows === 1) + return "rows: multiple values"; + properties.rows = 1; + { + var error = $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.verify(message.arrowRecordBatch); + if (error) + return "arrowRecordBatch." + error; + } + } + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (!$util.isInteger(message.rowCount) && !(message.rowCount && $util.isInteger(message.rowCount.low) && $util.isInteger(message.rowCount.high))) + return "rowCount: integer|Long expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.StreamStatus.verify(message.status); + if (error) + return "status." + error; + } + if (message.throttleStatus != null && message.hasOwnProperty("throttleStatus")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus.verify(message.throttleStatus); + if (error) + return "throttleStatus." + error; + } + return null; + }; + + /** + * Creates a ReadRowsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} ReadRowsResponse + */ + ReadRowsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.ReadRowsResponse) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.ReadRowsResponse(); + if (object.avroRows != null) { + if (typeof object.avroRows !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.avroRows: object expected"); + message.avroRows = $root.google.cloud.bigquery.storage.v1beta1.AvroRows.fromObject(object.avroRows); + } + if (object.arrowRecordBatch != null) { + if (typeof object.arrowRecordBatch !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.arrowRecordBatch: object expected"); + message.arrowRecordBatch = $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.fromObject(object.arrowRecordBatch); + } + if (object.rowCount != null) + if ($util.Long) + (message.rowCount = $util.Long.fromValue(object.rowCount)).unsigned = false; + else if (typeof object.rowCount === "string") + message.rowCount = parseInt(object.rowCount, 10); + else if (typeof object.rowCount === "number") + message.rowCount = object.rowCount; + else if (typeof object.rowCount === "object") + message.rowCount = new $util.LongBits(object.rowCount.low >>> 0, object.rowCount.high >>> 0).toNumber(); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.status: object expected"); + message.status = $root.google.cloud.bigquery.storage.v1beta1.StreamStatus.fromObject(object.status); + } + if (object.throttleStatus != null) { + if (typeof object.throttleStatus !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.throttleStatus: object expected"); + message.throttleStatus = $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus.fromObject(object.throttleStatus); + } + return message; + }; + + /** + * Creates a plain object from a ReadRowsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} message ReadRowsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadRowsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.status = null; + object.throttleStatus = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rowCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowCount = options.longs === String ? "0" : 0; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.bigquery.storage.v1beta1.StreamStatus.toObject(message.status, options); + if (message.avroRows != null && message.hasOwnProperty("avroRows")) { + object.avroRows = $root.google.cloud.bigquery.storage.v1beta1.AvroRows.toObject(message.avroRows, options); + if (options.oneofs) + object.rows = "avroRows"; + } + if (message.arrowRecordBatch != null && message.hasOwnProperty("arrowRecordBatch")) { + object.arrowRecordBatch = $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.toObject(message.arrowRecordBatch, options); + if (options.oneofs) + object.rows = "arrowRecordBatch"; + } + if (message.throttleStatus != null && message.hasOwnProperty("throttleStatus")) + object.throttleStatus = $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus.toObject(message.throttleStatus, options); + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (typeof message.rowCount === "number") + object.rowCount = options.longs === String ? String(message.rowCount) : message.rowCount; + else + object.rowCount = options.longs === String ? $util.Long.prototype.toString.call(message.rowCount) : options.longs === Number ? new $util.LongBits(message.rowCount.low >>> 0, message.rowCount.high >>> 0).toNumber() : message.rowCount; + return object; + }; + + /** + * Converts this ReadRowsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @instance + * @returns {Object.} JSON object + */ + ReadRowsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReadRowsResponse; + })(); + + v1beta1.BatchCreateReadSessionStreamsRequest = (function() { + + /** + * Properties of a BatchCreateReadSessionStreamsRequest. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IBatchCreateReadSessionStreamsRequest + * @property {google.cloud.bigquery.storage.v1beta1.IReadSession|null} [session] BatchCreateReadSessionStreamsRequest session + * @property {number|null} [requestedStreams] BatchCreateReadSessionStreamsRequest requestedStreams + */ + + /** + * Constructs a new BatchCreateReadSessionStreamsRequest. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a BatchCreateReadSessionStreamsRequest. + * @implements IBatchCreateReadSessionStreamsRequest + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest=} [properties] Properties to set + */ + function BatchCreateReadSessionStreamsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateReadSessionStreamsRequest session. + * @member {google.cloud.bigquery.storage.v1beta1.IReadSession|null|undefined} session + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @instance + */ + BatchCreateReadSessionStreamsRequest.prototype.session = null; + + /** + * BatchCreateReadSessionStreamsRequest requestedStreams. + * @member {number} requestedStreams + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @instance + */ + BatchCreateReadSessionStreamsRequest.prototype.requestedStreams = 0; + + /** + * Creates a new BatchCreateReadSessionStreamsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest} BatchCreateReadSessionStreamsRequest instance + */ + BatchCreateReadSessionStreamsRequest.create = function create(properties) { + return new BatchCreateReadSessionStreamsRequest(properties); + }; + + /** + * Encodes the specified BatchCreateReadSessionStreamsRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest} message BatchCreateReadSessionStreamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateReadSessionStreamsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && message.hasOwnProperty("session")) + $root.google.cloud.bigquery.storage.v1beta1.ReadSession.encode(message.session, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestedStreams != null && message.hasOwnProperty("requestedStreams")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.requestedStreams); + return writer; + }; + + /** + * Encodes the specified BatchCreateReadSessionStreamsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest} message BatchCreateReadSessionStreamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateReadSessionStreamsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateReadSessionStreamsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest} BatchCreateReadSessionStreamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateReadSessionStreamsRequest.decode = function decode(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.storage.v1beta1.BatchCreateReadSessionStreamsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.session = $root.google.cloud.bigquery.storage.v1beta1.ReadSession.decode(reader, reader.uint32()); + break; + case 2: + message.requestedStreams = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateReadSessionStreamsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest} BatchCreateReadSessionStreamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateReadSessionStreamsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateReadSessionStreamsRequest message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateReadSessionStreamsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.ReadSession.verify(message.session); + if (error) + return "session." + error; + } + if (message.requestedStreams != null && message.hasOwnProperty("requestedStreams")) + if (!$util.isInteger(message.requestedStreams)) + return "requestedStreams: integer expected"; + return null; + }; + + /** + * Creates a BatchCreateReadSessionStreamsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest} BatchCreateReadSessionStreamsRequest + */ + BatchCreateReadSessionStreamsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest(); + if (object.session != null) { + if (typeof object.session !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest.session: object expected"); + message.session = $root.google.cloud.bigquery.storage.v1beta1.ReadSession.fromObject(object.session); + } + if (object.requestedStreams != null) + message.requestedStreams = object.requestedStreams | 0; + return message; + }; + + /** + * Creates a plain object from a BatchCreateReadSessionStreamsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest} message BatchCreateReadSessionStreamsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateReadSessionStreamsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.session = null; + object.requestedStreams = 0; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = $root.google.cloud.bigquery.storage.v1beta1.ReadSession.toObject(message.session, options); + if (message.requestedStreams != null && message.hasOwnProperty("requestedStreams")) + object.requestedStreams = message.requestedStreams; + return object; + }; + + /** + * Converts this BatchCreateReadSessionStreamsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @instance + * @returns {Object.} JSON object + */ + BatchCreateReadSessionStreamsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchCreateReadSessionStreamsRequest; + })(); + + v1beta1.BatchCreateReadSessionStreamsResponse = (function() { + + /** + * Properties of a BatchCreateReadSessionStreamsResponse. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IBatchCreateReadSessionStreamsResponse + * @property {Array.|null} [streams] BatchCreateReadSessionStreamsResponse streams + */ + + /** + * Constructs a new BatchCreateReadSessionStreamsResponse. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a BatchCreateReadSessionStreamsResponse. + * @implements IBatchCreateReadSessionStreamsResponse + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse=} [properties] Properties to set + */ + function BatchCreateReadSessionStreamsResponse(properties) { + this.streams = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateReadSessionStreamsResponse streams. + * @member {Array.} streams + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @instance + */ + BatchCreateReadSessionStreamsResponse.prototype.streams = $util.emptyArray; + + /** + * Creates a new BatchCreateReadSessionStreamsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse} BatchCreateReadSessionStreamsResponse instance + */ + BatchCreateReadSessionStreamsResponse.create = function create(properties) { + return new BatchCreateReadSessionStreamsResponse(properties); + }; + + /** + * Encodes the specified BatchCreateReadSessionStreamsResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse} message BatchCreateReadSessionStreamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateReadSessionStreamsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.streams != null && message.streams.length) + for (var i = 0; i < message.streams.length; ++i) + $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.streams[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchCreateReadSessionStreamsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse} message BatchCreateReadSessionStreamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateReadSessionStreamsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateReadSessionStreamsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse} BatchCreateReadSessionStreamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateReadSessionStreamsResponse.decode = function decode(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.storage.v1beta1.BatchCreateReadSessionStreamsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.streams && message.streams.length)) + message.streams = []; + message.streams.push($root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateReadSessionStreamsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse} BatchCreateReadSessionStreamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateReadSessionStreamsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateReadSessionStreamsResponse message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateReadSessionStreamsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.streams != null && message.hasOwnProperty("streams")) { + if (!Array.isArray(message.streams)) + return "streams: array expected"; + for (var i = 0; i < message.streams.length; ++i) { + var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.streams[i]); + if (error) + return "streams." + error; + } + } + return null; + }; + + /** + * Creates a BatchCreateReadSessionStreamsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse} BatchCreateReadSessionStreamsResponse + */ + BatchCreateReadSessionStreamsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse(); + if (object.streams) { + if (!Array.isArray(object.streams)) + throw TypeError(".google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse.streams: array expected"); + message.streams = []; + for (var i = 0; i < object.streams.length; ++i) { + if (typeof object.streams[i] !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse.streams: object expected"); + message.streams[i] = $root.google.cloud.bigquery.storage.v1beta1.Stream.fromObject(object.streams[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateReadSessionStreamsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse} message BatchCreateReadSessionStreamsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateReadSessionStreamsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.streams = []; + if (message.streams && message.streams.length) { + object.streams = []; + for (var j = 0; j < message.streams.length; ++j) + object.streams[j] = $root.google.cloud.bigquery.storage.v1beta1.Stream.toObject(message.streams[j], options); + } + return object; + }; + + /** + * Converts this BatchCreateReadSessionStreamsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @instance + * @returns {Object.} JSON object + */ + BatchCreateReadSessionStreamsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchCreateReadSessionStreamsResponse; + })(); + + v1beta1.FinalizeStreamRequest = (function() { + + /** + * Properties of a FinalizeStreamRequest. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IFinalizeStreamRequest + * @property {google.cloud.bigquery.storage.v1beta1.IStream|null} [stream] FinalizeStreamRequest stream + */ + + /** + * Constructs a new FinalizeStreamRequest. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a FinalizeStreamRequest. + * @implements IFinalizeStreamRequest + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest=} [properties] Properties to set + */ + function FinalizeStreamRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FinalizeStreamRequest stream. + * @member {google.cloud.bigquery.storage.v1beta1.IStream|null|undefined} stream + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @instance + */ + FinalizeStreamRequest.prototype.stream = null; + + /** + * Creates a new FinalizeStreamRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest} FinalizeStreamRequest instance + */ + FinalizeStreamRequest.create = function create(properties) { + return new FinalizeStreamRequest(properties); + }; + + /** + * Encodes the specified FinalizeStreamRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest} message FinalizeStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FinalizeStreamRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stream != null && message.hasOwnProperty("stream")) + $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.stream, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FinalizeStreamRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest} message FinalizeStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FinalizeStreamRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FinalizeStreamRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest} FinalizeStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FinalizeStreamRequest.decode = function decode(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.storage.v1beta1.FinalizeStreamRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FinalizeStreamRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest} FinalizeStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FinalizeStreamRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FinalizeStreamRequest message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FinalizeStreamRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stream != null && message.hasOwnProperty("stream")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.stream); + if (error) + return "stream." + error; + } + return null; + }; + + /** + * Creates a FinalizeStreamRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest} FinalizeStreamRequest + */ + FinalizeStreamRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest(); + if (object.stream != null) { + if (typeof object.stream !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest.stream: object expected"); + message.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.fromObject(object.stream); + } + return message; + }; + + /** + * Creates a plain object from a FinalizeStreamRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest} message FinalizeStreamRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FinalizeStreamRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.stream = null; + if (message.stream != null && message.hasOwnProperty("stream")) + object.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.toObject(message.stream, options); + return object; + }; + + /** + * Converts this FinalizeStreamRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @instance + * @returns {Object.} JSON object + */ + FinalizeStreamRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FinalizeStreamRequest; + })(); + + v1beta1.SplitReadStreamRequest = (function() { + + /** + * Properties of a SplitReadStreamRequest. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface ISplitReadStreamRequest + * @property {google.cloud.bigquery.storage.v1beta1.IStream|null} [originalStream] SplitReadStreamRequest originalStream + * @property {number|null} [fraction] SplitReadStreamRequest fraction + */ + + /** + * Constructs a new SplitReadStreamRequest. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a SplitReadStreamRequest. + * @implements ISplitReadStreamRequest + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest=} [properties] Properties to set + */ + function SplitReadStreamRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SplitReadStreamRequest originalStream. + * @member {google.cloud.bigquery.storage.v1beta1.IStream|null|undefined} originalStream + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @instance + */ + SplitReadStreamRequest.prototype.originalStream = null; + + /** + * SplitReadStreamRequest fraction. + * @member {number} fraction + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @instance + */ + SplitReadStreamRequest.prototype.fraction = 0; + + /** + * Creates a new SplitReadStreamRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest} SplitReadStreamRequest instance + */ + SplitReadStreamRequest.create = function create(properties) { + return new SplitReadStreamRequest(properties); + }; + + /** + * Encodes the specified SplitReadStreamRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest} message SplitReadStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitReadStreamRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalStream != null && message.hasOwnProperty("originalStream")) + $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.originalStream, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fraction != null && message.hasOwnProperty("fraction")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.fraction); + return writer; + }; + + /** + * Encodes the specified SplitReadStreamRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest} message SplitReadStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitReadStreamRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SplitReadStreamRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest} SplitReadStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitReadStreamRequest.decode = function decode(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.storage.v1beta1.SplitReadStreamRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.originalStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); + break; + case 2: + message.fraction = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SplitReadStreamRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest} SplitReadStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitReadStreamRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SplitReadStreamRequest message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SplitReadStreamRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalStream != null && message.hasOwnProperty("originalStream")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.originalStream); + if (error) + return "originalStream." + error; + } + if (message.fraction != null && message.hasOwnProperty("fraction")) + if (typeof message.fraction !== "number") + return "fraction: number expected"; + return null; + }; + + /** + * Creates a SplitReadStreamRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest} SplitReadStreamRequest + */ + SplitReadStreamRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest(); + if (object.originalStream != null) { + if (typeof object.originalStream !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest.originalStream: object expected"); + message.originalStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.fromObject(object.originalStream); + } + if (object.fraction != null) + message.fraction = Number(object.fraction); + return message; + }; + + /** + * Creates a plain object from a SplitReadStreamRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest} message SplitReadStreamRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SplitReadStreamRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalStream = null; + object.fraction = 0; + } + if (message.originalStream != null && message.hasOwnProperty("originalStream")) + object.originalStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.toObject(message.originalStream, options); + if (message.fraction != null && message.hasOwnProperty("fraction")) + object.fraction = options.json && !isFinite(message.fraction) ? String(message.fraction) : message.fraction; + return object; + }; + + /** + * Converts this SplitReadStreamRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @instance + * @returns {Object.} JSON object + */ + SplitReadStreamRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SplitReadStreamRequest; + })(); + + v1beta1.SplitReadStreamResponse = (function() { + + /** + * Properties of a SplitReadStreamResponse. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface ISplitReadStreamResponse + * @property {google.cloud.bigquery.storage.v1beta1.IStream|null} [primaryStream] SplitReadStreamResponse primaryStream + * @property {google.cloud.bigquery.storage.v1beta1.IStream|null} [remainderStream] SplitReadStreamResponse remainderStream + */ + + /** + * Constructs a new SplitReadStreamResponse. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a SplitReadStreamResponse. + * @implements ISplitReadStreamResponse + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse=} [properties] Properties to set + */ + function SplitReadStreamResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SplitReadStreamResponse primaryStream. + * @member {google.cloud.bigquery.storage.v1beta1.IStream|null|undefined} primaryStream + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @instance + */ + SplitReadStreamResponse.prototype.primaryStream = null; + + /** + * SplitReadStreamResponse remainderStream. + * @member {google.cloud.bigquery.storage.v1beta1.IStream|null|undefined} remainderStream + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @instance + */ + SplitReadStreamResponse.prototype.remainderStream = null; + + /** + * Creates a new SplitReadStreamResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse} SplitReadStreamResponse instance + */ + SplitReadStreamResponse.create = function create(properties) { + return new SplitReadStreamResponse(properties); + }; + + /** + * Encodes the specified SplitReadStreamResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse} message SplitReadStreamResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitReadStreamResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.primaryStream != null && message.hasOwnProperty("primaryStream")) + $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.primaryStream, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.remainderStream != null && message.hasOwnProperty("remainderStream")) + $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.remainderStream, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SplitReadStreamResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse} message SplitReadStreamResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitReadStreamResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SplitReadStreamResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse} SplitReadStreamResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitReadStreamResponse.decode = function decode(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.storage.v1beta1.SplitReadStreamResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.primaryStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); + break; + case 2: + message.remainderStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SplitReadStreamResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse} SplitReadStreamResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitReadStreamResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SplitReadStreamResponse message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SplitReadStreamResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.primaryStream != null && message.hasOwnProperty("primaryStream")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.primaryStream); + if (error) + return "primaryStream." + error; + } + if (message.remainderStream != null && message.hasOwnProperty("remainderStream")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.remainderStream); + if (error) + return "remainderStream." + error; + } + return null; + }; + + /** + * Creates a SplitReadStreamResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse} SplitReadStreamResponse + */ + SplitReadStreamResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse(); + if (object.primaryStream != null) { + if (typeof object.primaryStream !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse.primaryStream: object expected"); + message.primaryStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.fromObject(object.primaryStream); + } + if (object.remainderStream != null) { + if (typeof object.remainderStream !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse.remainderStream: object expected"); + message.remainderStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.fromObject(object.remainderStream); + } + return message; + }; + + /** + * Creates a plain object from a SplitReadStreamResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse} message SplitReadStreamResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SplitReadStreamResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.primaryStream = null; + object.remainderStream = null; + } + if (message.primaryStream != null && message.hasOwnProperty("primaryStream")) + object.primaryStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.toObject(message.primaryStream, options); + if (message.remainderStream != null && message.hasOwnProperty("remainderStream")) + object.remainderStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.toObject(message.remainderStream, options); + return object; + }; + + /** + * Converts this SplitReadStreamResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @instance + * @returns {Object.} JSON object + */ + SplitReadStreamResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SplitReadStreamResponse; + })(); + + v1beta1.TableReference = (function() { + + /** + * Properties of a TableReference. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @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.storage.v1beta1 + * @classdesc Represents a TableReference. + * @implements ITableReference + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.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.storage.v1beta1.TableReference + * @instance + */ + TableReference.prototype.projectId = ""; + + /** + * TableReference datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * @instance + */ + TableReference.prototype.datasetId = ""; + + /** + * TableReference tableId. + * @member {string} tableId + * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * @instance + */ + TableReference.prototype.tableId = ""; + + /** + * Creates a new TableReference instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ITableReference=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.TableReference} TableReference instance + */ + TableReference.create = function create(properties) { + return new TableReference(properties); + }; + + /** + * Encodes the specified TableReference message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * @static + * @param {google.cloud.bigquery.storage.v1beta1.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 && message.hasOwnProperty("projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.datasetId != null && message.hasOwnProperty("datasetId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); + if (message.tableId != null && message.hasOwnProperty("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.storage.v1beta1.TableReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * @static + * @param {google.cloud.bigquery.storage.v1beta1.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.storage.v1beta1.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.storage.v1beta1.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.storage.v1beta1.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.storage.v1beta1.TableReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.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.storage.v1beta1.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.storage.v1beta1.TableReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.TableReference} TableReference + */ + TableReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.TableReference) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.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.storage.v1beta1.TableReference + * @static + * @param {google.cloud.bigquery.storage.v1beta1.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.storage.v1beta1.TableReference + * @instance + * @returns {Object.} JSON object + */ + TableReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TableReference; + })(); + + v1beta1.TableModifiers = (function() { + + /** + * Properties of a TableModifiers. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface ITableModifiers + * @property {google.protobuf.ITimestamp|null} [snapshotTime] TableModifiers snapshotTime + */ + + /** + * Constructs a new TableModifiers. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a TableModifiers. + * @implements ITableModifiers + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.ITableModifiers=} [properties] Properties to set + */ + function TableModifiers(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableModifiers snapshotTime. + * @member {google.protobuf.ITimestamp|null|undefined} snapshotTime + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * @instance + */ + TableModifiers.prototype.snapshotTime = null; + + /** + * Creates a new TableModifiers instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ITableModifiers=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.TableModifiers} TableModifiers instance + */ + TableModifiers.create = function create(properties) { + return new TableModifiers(properties); + }; + + /** + * Encodes the specified TableModifiers message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableModifiers.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ITableModifiers} message TableModifiers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableModifiers.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) + $root.google.protobuf.Timestamp.encode(message.snapshotTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TableModifiers message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableModifiers.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ITableModifiers} message TableModifiers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableModifiers.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableModifiers message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.TableModifiers} TableModifiers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableModifiers.decode = function decode(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.storage.v1beta1.TableModifiers(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.snapshotTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableModifiers message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.TableModifiers} TableModifiers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableModifiers.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableModifiers message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableModifiers.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.snapshotTime); + if (error) + return "snapshotTime." + error; + } + return null; + }; + + /** + * Creates a TableModifiers message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.TableModifiers} TableModifiers + */ + TableModifiers.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.TableModifiers) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.TableModifiers(); + if (object.snapshotTime != null) { + if (typeof object.snapshotTime !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.TableModifiers.snapshotTime: object expected"); + message.snapshotTime = $root.google.protobuf.Timestamp.fromObject(object.snapshotTime); + } + return message; + }; + + /** + * Creates a plain object from a TableModifiers message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * @static + * @param {google.cloud.bigquery.storage.v1beta1.TableModifiers} message TableModifiers + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableModifiers.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.snapshotTime = null; + if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) + object.snapshotTime = $root.google.protobuf.Timestamp.toObject(message.snapshotTime, options); + return object; + }; + + /** + * Converts this TableModifiers to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * @instance + * @returns {Object.} JSON object + */ + TableModifiers.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TableModifiers; + })(); + + return v1beta1; + })(); + + return storage; + })(); + + 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 && message.hasOwnProperty("fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fullyDecodeReservedExpansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = ""; + + /** + * HttpRule put. + * @member {string} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = ""; + + /** + * HttpRule post. + * @member {string} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = ""; + + /** + * HttpRule delete. + * @member {string} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = ""; + + /** + * HttpRule patch. + * @member {string} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = ""; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && message.hasOwnProperty("selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && message.hasOwnProperty("get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && message.hasOwnProperty("put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && message.hasOwnProperty("post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && message.hasOwnProperty("delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && message.hasOwnProperty("patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && message.hasOwnProperty("body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && message.hasOwnProperty("custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message["delete"] = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.responseBody = reader.string(); + break; + case 11: + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && message.hasOwnProperty("kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && message.hasOwnProperty("path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CustomHttpPattern; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {string} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && message.hasOwnProperty("nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && message.hasOwnProperty("history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && message.hasOwnProperty("plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && message.hasOwnProperty("singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + case 3: + message.nameField = reader.string(); + break; + case 4: + message.history = reader.int32(); + break; + case 5: + message.plural = reader.string(); + break; + case 6: + message.singular = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pattern = []; + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {string} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && message.hasOwnProperty("childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.childType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && message.hasOwnProperty("package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && message.hasOwnProperty("syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message["package"] = reader.string(); + break; + case 3: + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + case 10: + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + case 11: + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + case 4: + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 8: + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + case 8: + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + case 10: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && message.hasOwnProperty("extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && message.hasOwnProperty("number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && message.hasOwnProperty("label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && message.hasOwnProperty("typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32(); + break; + case 5: + message.type = reader.int32(); + break; + case 6: + message.typeName = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.defaultValue = reader.string(); + break; + case 9: + message.oneofIndex = reader.int32(); + break; + case 10: + message.jsonName = reader.string(); + break; + case 8: + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {string} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {string} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && message.hasOwnProperty("number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && message.hasOwnProperty("inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && message.hasOwnProperty("outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.inputType = reader.string(); + break; + case 3: + message.outputType = reader.string(); + break; + case 4: + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.clientStreaming = reader.bool(); + break; + case 6: + message.serverStreaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @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 = false; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + 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 = false; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {string} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @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 && message.hasOwnProperty("messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageSetWireFormat = reader.bool(); + break; + case 2: + message.noStandardDescriptorAccessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.mapEntry = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1053: + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * 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 && message.hasOwnProperty("ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && message.hasOwnProperty("packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && message.hasOwnProperty("lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && message.hasOwnProperty("jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && message.hasOwnProperty("weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @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 {string} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {string} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allowAlias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1049: + message[".google.api.defaultHost"] = reader.string(); + break; + case 1050: + message[".google.api.oauthScopes"] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {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 && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 34: + message.idempotencyLevel = reader.int32(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 72295728: + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + case 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 {string} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + case 3: + message.identifierValue = reader.string(); + break; + case 4: + message.positiveIntValue = reader.uint64(); + break; + case 5: + message.negativeIntValue = reader.int64(); + break; + case 6: + message.doubleValue = reader.double(); + break; + case 7: + message.stringValue = reader.bytes(); + break; + case 8: + message.aggregateValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namePart = reader.string(); + break; + case 2: + message.isExtension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + case 3: + message.leadingComments = reader.string(); + break; + case 4: + message.trailingComments = reader.string(); + break; + case 6: + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && message.hasOwnProperty("begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + message.sourceFile = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && message.hasOwnProperty("seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && message.hasOwnProperty("nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Timestamp; + })(); + + protobuf.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; + })(); + + return protobuf; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-bigquery-storage/protos/protos.json b/packages/google-cloud-bigquery-storage/protos/protos.json new file mode 100644 index 00000000000..6f3c1689461 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/protos/protos.json @@ -0,0 +1,1532 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "bigquery": { + "nested": { + "storage": { + "nested": { + "v1beta1": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta1;storage", + "java_outer_classname": "TableReferenceProto", + "java_package": "com.google.cloud.bigquery.storage.v1beta1" + }, + "nested": { + "ArrowSchema": { + "fields": { + "serializedSchema": { + "type": "bytes", + "id": 1 + } + } + }, + "ArrowRecordBatch": { + "fields": { + "serializedRecordBatch": { + "type": "bytes", + "id": 1 + }, + "rowCount": { + "type": "int64", + "id": 2 + } + } + }, + "AvroSchema": { + "fields": { + "schema": { + "type": "string", + "id": 1 + } + } + }, + "AvroRows": { + "fields": { + "serializedBinaryRows": { + "type": "bytes", + "id": 1 + }, + "rowCount": { + "type": "int64", + "id": 2 + } + } + }, + "TableReadOptions": { + "fields": { + "selectedFields": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "rowRestriction": { + "type": "string", + "id": 2 + } + } + }, + "BigQueryStorage": { + "options": { + "(google.api.default_host)": "bigquerystorage.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/bigquery.readonly,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateReadSession": { + "requestType": "CreateReadSessionRequest", + "responseType": "ReadSession", + "options": { + "(google.api.http).post": "/v1beta1/{table_reference.project_id=projects/*}", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1beta1/{table_reference.dataset_id=projects/*/datasets/*}", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "table_reference,parent,requested_streams" + } + }, + "ReadRows": { + "requestType": "ReadRowsRequest", + "responseType": "ReadRowsResponse", + "responseStream": true, + "options": { + "(google.api.http).get": "/v1beta1/{read_position.stream.name=projects/*/streams/*}", + "(google.api.method_signature)": "read_position" + } + }, + "BatchCreateReadSessionStreams": { + "requestType": "BatchCreateReadSessionStreamsRequest", + "responseType": "BatchCreateReadSessionStreamsResponse", + "options": { + "(google.api.http).post": "/v1beta1/{session.name=projects/*/sessions/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "session,requested_streams" + } + }, + "FinalizeStream": { + "requestType": "FinalizeStreamRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1beta1/{stream.name=projects/*/streams/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "stream" + } + }, + "SplitReadStream": { + "requestType": "SplitReadStreamRequest", + "responseType": "SplitReadStreamResponse", + "options": { + "(google.api.http).get": "/v1beta1/{original_stream.name=projects/*/streams/*}", + "(google.api.method_signature)": "original_stream" + } + } + } + }, + "Stream": { + "options": { + "(google.api.resource).type": "bigquerystorage.googleapis.com/Stream", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/streams/{stream}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "StreamPosition": { + "fields": { + "stream": { + "type": "Stream", + "id": 1 + }, + "offset": { + "type": "int64", + "id": 2 + } + } + }, + "ReadSession": { + "options": { + "(google.api.resource).type": "bigquerystorage.googleapis.com/ReadSession", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/sessions/{session}" + }, + "oneofs": { + "schema": { + "oneof": [ + "avroSchema", + "arrowSchema" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "avroSchema": { + "type": "AvroSchema", + "id": 5 + }, + "arrowSchema": { + "type": "ArrowSchema", + "id": 6 + }, + "streams": { + "rule": "repeated", + "type": "Stream", + "id": 4 + }, + "tableReference": { + "type": "TableReference", + "id": 7 + }, + "tableModifiers": { + "type": "TableModifiers", + "id": 8 + }, + "shardingStrategy": { + "type": "ShardingStrategy", + "id": 9 + } + } + }, + "CreateReadSessionRequest": { + "fields": { + "tableReference": { + "type": "TableReference", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "parent": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tableModifiers": { + "type": "TableModifiers", + "id": 2 + }, + "requestedStreams": { + "type": "int32", + "id": 3 + }, + "readOptions": { + "type": "TableReadOptions", + "id": 4 + }, + "format": { + "type": "DataFormat", + "id": 5 + }, + "shardingStrategy": { + "type": "ShardingStrategy", + "id": 7 + } + } + }, + "DataFormat": { + "values": { + "DATA_FORMAT_UNSPECIFIED": 0, + "AVRO": 1, + "ARROW": 3 + } + }, + "ShardingStrategy": { + "values": { + "SHARDING_STRATEGY_UNSPECIFIED": 0, + "LIQUID": 1, + "BALANCED": 2 + } + }, + "ReadRowsRequest": { + "fields": { + "readPosition": { + "type": "StreamPosition", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "StreamStatus": { + "fields": { + "estimatedRowCount": { + "type": "int64", + "id": 1 + }, + "fractionConsumed": { + "type": "float", + "id": 2 + }, + "progress": { + "type": "Progress", + "id": 4 + }, + "isSplittable": { + "type": "bool", + "id": 3 + } + } + }, + "Progress": { + "fields": { + "atResponseStart": { + "type": "float", + "id": 1 + }, + "atResponseEnd": { + "type": "float", + "id": 2 + } + } + }, + "ThrottleStatus": { + "fields": { + "throttlePercent": { + "type": "int32", + "id": 1 + } + } + }, + "ReadRowsResponse": { + "oneofs": { + "rows": { + "oneof": [ + "avroRows", + "arrowRecordBatch" + ] + } + }, + "fields": { + "avroRows": { + "type": "AvroRows", + "id": 3 + }, + "arrowRecordBatch": { + "type": "ArrowRecordBatch", + "id": 4 + }, + "rowCount": { + "type": "int64", + "id": 6 + }, + "status": { + "type": "StreamStatus", + "id": 2 + }, + "throttleStatus": { + "type": "ThrottleStatus", + "id": 5 + } + } + }, + "BatchCreateReadSessionStreamsRequest": { + "fields": { + "session": { + "type": "ReadSession", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestedStreams": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchCreateReadSessionStreamsResponse": { + "fields": { + "streams": { + "rule": "repeated", + "type": "Stream", + "id": 1 + } + } + }, + "FinalizeStreamRequest": { + "fields": { + "stream": { + "type": "Stream", + "id": 2 + } + } + }, + "SplitReadStreamRequest": { + "fields": { + "originalStream": { + "type": "Stream", + "id": 1 + }, + "fraction": { + "type": "float", + "id": 2 + } + } + }, + "SplitReadStreamResponse": { + "fields": { + "primaryStream": { + "type": "Stream", + "id": 1 + }, + "remainderStream": { + "type": "Stream", + "id": 2 + } + } + }, + "TableReference": { + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "datasetId": { + "type": "string", + "id": 2 + }, + "tableId": { + "type": "string", + "id": 3 + } + } + }, + "TableModifiers": { + "fields": { + "snapshotTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + } + } + } + } + } + } + } + } + } + } + }, + "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 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": false + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + } + } + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-bigquery-storage/samples/README.md b/packages/google-cloud-bigquery-storage/samples/README.md new file mode 100644 index 00000000000..27ca6db4d3e --- /dev/null +++ b/packages/google-cloud-bigquery-storage/samples/README.md @@ -0,0 +1,52 @@ +[//]: # "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 Storage: Node.js Samples](https://github.com/googleapis/nodejs-bigquery-storage) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [BigQuery Storage Quickstart](#bigquery-storage-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-storage#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### BigQuery Storage Quickstart + +Read data from a table via read stream. + +View the [source code](https://github.com/googleapis/nodejs-bigquery-storage/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-storage&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node 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-storage&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/bigquery/docs/reference/storage diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json new file mode 100644 index 00000000000..3b4674c4bf5 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -0,0 +1,25 @@ +{ + "name": "nodejs-docs-samples-bigquery-storage", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=8" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/bigquery-storage": "^0.1.0", + "avsc": "^5.4.18", + "snappy": "^6.2.3" + }, + "devDependencies": { + "c8": "^5.0.1", + "chai": "^4.2.0", + "mocha": "^6.2.2" + } +} diff --git a/packages/google-cloud-bigquery-storage/samples/quickstart.js b/packages/google-cloud-bigquery-storage/samples/quickstart.js new file mode 100644 index 00000000000..43054d2ff0c --- /dev/null +++ b/packages/google-cloud-bigquery-storage/samples/quickstart.js @@ -0,0 +1,147 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +// sample-metadata: +// title: BigQuery Storage Quickstart +// description: Read data from a table via read stream. +// usage: node quickstart.js +async function main() { + // [START bigquery_storage_quickstart] + + // The read stream contains blocks of Avro-encoded bytes. We use the + // 'avsc' library to decode these blocks. Install avsc with the following + // command: npm install avsc + const avro = require('avsc'); + + // See reference documentation at + // https://cloud.google.com/bigquery/docs/reference/storage + const bqStorage = require('@google-cloud/bigquery-storage').v1beta1 + .BigQueryStorageClient; + + const client = new bqStorage(); + + async function bigqueryStorageQuickstart() { + // Get current project ID. The read session is created in this project. + // This project can be different from that which contains the table. + const myProjectId = await client.getProjectId(); + + // This example reads baby name data from the public datasets. + const projectId = 'bigquery-public-data'; + const datasetId = 'usa_names'; + const tableId = 'usa_1910_current'; + + const tableReference = { + projectId, + datasetId, + tableId, + }; + + const parent = `projects/${myProjectId}`; + + /* We limit the output columns to a subset of those allowed in the table, + * and set a simple filter to only report names from the state of + * Washington (WA). + */ + const readOptions = { + selectedFields: ['name', 'number', 'state'], + rowRestriction: 'state = "WA"', + }; + + let tableModifiers = null; + const snapshotSeconds = 0; + + // Set a snapshot time if it's been specified. + if (snapshotSeconds > 0) { + tableModifiers = {snapshotTime: {seconds: snapshotSeconds}}; + } + + // API request. + const request = { + tableReference, + parent, + readOptions, + tableModifiers, + // This API can also deliver data serialized in Apache Arrow format. + // This example leverages Apache Avro. + format: 'AVRO', + /* We use a LIQUID strategy in this example because we only read from a + * single stream. Consider BALANCED if you're consuming multiple streams + * concurrently and want more consistent stream sizes. + */ + shardingStrategy: 'LIQUID', + }; + + const [session] = await client.createReadSession(request); + + const schema = JSON.parse(session.avroSchema.schema); + + const avroType = avro.Type.forSchema(schema); + + /* The offset requested must be less than the last + * row read from ReadRows. Requesting a larger offset is + * undefined. + */ + let offset = 0; + + const readRowsRequest = { + // Optional stream name or offset. Offset requested must be less than the last + // row read from readRows(). Requesting a larger offset is undefined. + readPosition: { + stream: session.streams[0], + offset, + }, + }; + + const names = new Set(); + const states = {}; + + /* We'll use only a single stream for reading data from the table. Because + * of dynamic sharding, this will yield all the rows in the table. However, + * if you wanted to fan out multiple readers you could do so by having a + * reader process each individual stream. + */ + client + .readRows(readRowsRequest) + .on('error', console.error) + .on('data', function(data) { + try { + const decodedData = avroType.decode( + data.avroRows.serializedBinaryRows + ); + + names.add(decodedData.value.name); + + if (!states[decodedData.value.state]) { + states[decodedData.value.state] = true; + } + + offset = decodedData.offset; + } catch (error) { + console.log(error); + } + }) + .on('end', function() { + console.log( + `Got ${names.size} unique names in states: ${Object.keys(states)}` + ); + console.log(`Last offset: ${offset}`); + }); + } + // [END bigquery_storage_quickstart] + bigqueryStorageQuickstart(); +} + +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-storage/samples/test/quickstart.js b/packages/google-cloud-bigquery-storage/samples/test/quickstart.js new file mode 100644 index 00000000000..44c15b1bfdb --- /dev/null +++ b/packages/google-cloud-bigquery-storage/samples/test/quickstart.js @@ -0,0 +1,33 @@ +// 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 {describe, it} = require('mocha'); +const cp = require('child_process'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +describe('Quickstart', () => { + it('quickstart should create a dataset', async () => { + const output = execSync(`node quickstart`); + assert.match(output, /unique names in states/); + assert.match(output, /Last offset:/); + }); +}); diff --git a/packages/google-cloud-bigquery-storage/src/index.ts b/packages/google-cloud-bigquery-storage/src/index.ts new file mode 100644 index 00000000000..544140dbe62 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/src/index.ts @@ -0,0 +1,24 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1beta1 from './v1beta1'; +const BigQueryStorageClient = v1beta1.BigQueryStorageClient; +export {v1beta1, BigQueryStorageClient}; +// For compatibility with JavaScript libraries we need to provide this default export: +// tslint:disable-next-line no-default-export +export default {v1beta1, BigQueryStorageClient}; diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts new file mode 100644 index 00000000000..5f41cbd976e --- /dev/null +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -0,0 +1,833 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; +import * as path from 'path'; + +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './big_query_storage_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * BigQuery storage API. + * + * The BigQuery storage API can be used to read data stored in BigQuery. + * @class + * @memberof v1beta1 + */ +export class BigQueryStorageClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + auth: gax.GoogleAuth; + bigQueryStorageStub: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BigQueryStorageClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof BigQueryStorageClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof BigQueryStorageClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this._pathTemplates = { + readSessionPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sessions/{session}' + ), + streamPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/streams/{stream}' + ), + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this._descriptors.stream = { + readRows: new gaxModule.StreamDescriptor(gax.StreamType.SERVER_STREAMING), + }; + + // Put together the default options sent with requests. + const defaults = gaxGrpc.constructSettings( + 'google.cloud.bigquery.storage.v1beta1.BigQueryStorage', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this._innerApiCalls = {}; + + // Put together the "service stub" for + // google.cloud.bigquery.storage.v1beta1.BigQueryStorage. + this.bigQueryStorageStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService( + 'google.cloud.bigquery.storage.v1beta1.BigQueryStorage' + ) + : // tslint:disable-next-line no-any + (protos as any).google.cloud.bigquery.storage.v1beta1.BigQueryStorage, + 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 bigQueryStorageStubMethods = [ + 'createReadSession', + 'readRows', + 'batchCreateReadSessionStreams', + 'finalizeStream', + 'splitReadStream', + ]; + + for (const methodName of bigQueryStorageStubMethods) { + const innerCallPromise = this.bigQueryStorageStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'bigquerystorage.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'bigquerystorage.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/bigquery.readonly', + '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 -- + // ------------------- + createReadSession( + request: protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.bigquery.storage.v1beta1.IReadSession, + ( + | protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest + | undefined + ), + {} | undefined + ] + >; + createReadSession( + request: protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.bigquery.storage.v1beta1.IReadSession, + | protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest + | undefined, + {} | undefined + > + ): void; + /** + * Creates a new read session. A read session divides the contents of a + * BigQuery table into one or more streams, which can then be used to read + * data from the table. The read session also specifies properties of the + * data to be read, such as a list of columns or a push-down filter describing + * the rows to be returned. + * + * A particular row can be read by at most one stream. When the caller has + * reached the end of each stream in the session, then all the data in the + * table has been read. + * + * Read sessions automatically expire 24 hours after they are created and do + * not require manual clean-up by the caller. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.bigquery.storage.v1beta1.TableReference} request.tableReference + * Required. Reference to the table to read. + * @param {string} request.parent + * Required. String of the form `projects/{project_id}` indicating the + * project this ReadSession is associated with. This is the project that will + * be billed for usage. + * @param {google.cloud.bigquery.storage.v1beta1.TableModifiers} request.tableModifiers + * Any modifiers to the Table (e.g. snapshot timestamp). + * @param {number} request.requestedStreams + * Initial number of streams. If unset or 0, we will + * provide a value of streams so as to produce reasonable throughput. Must be + * non-negative. The number of streams may be lower than the requested number, + * depending on the amount parallelism that is reasonable for the table and + * the maximum amount of parallelism allowed by the system. + * + * Streams must be read starting from offset 0. + * @param {google.cloud.bigquery.storage.v1beta1.TableReadOptions} request.readOptions + * Read options for this session (e.g. column selection, filters). + * @param {google.cloud.bigquery.storage.v1beta1.DataFormat} request.format + * Data output format. Currently default to Avro. + * @param {google.cloud.bigquery.storage.v1beta1.ShardingStrategy} request.shardingStrategy + * The strategy to use for distributing data among multiple streams. Currently + * defaults to liquid sharding. + * @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 [ReadSession]{@link google.cloud.bigquery.storage.v1beta1.ReadSession}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createReadSession( + request: protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.bigquery.storage.v1beta1.IReadSession, + | protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.bigquery.storage.v1beta1.IReadSession, + | protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.bigquery.storage.v1beta1.IReadSession, + ( + | protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest + | 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({ + 'table_reference.project_id': request.tableReference!.projectId || '', + 'table_reference.dataset_id': request.tableReference!.datasetId || '', + }); + return this._innerApiCalls.createReadSession(request, options, callback); + } + batchCreateReadSessionStreams( + request: protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, + ( + | protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest + | undefined + ), + {} | undefined + ] + >; + batchCreateReadSessionStreams( + request: protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, + | protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest + | undefined, + {} | undefined + > + ): void; + /** + * Creates additional streams for a ReadSession. This API can be used to + * dynamically adjust the parallelism of a batch processing task upwards by + * adding additional workers. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.bigquery.storage.v1beta1.ReadSession} request.session + * Required. Must be a non-expired session obtained from a call to + * CreateReadSession. Only the name field needs to be set. + * @param {number} request.requestedStreams + * Required. Number of new streams requested. Must be positive. + * Number of added streams may be less than this, see CreateReadSessionRequest + * for more information. + * @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 [BatchCreateReadSessionStreamsResponse]{@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + batchCreateReadSessionStreams( + request: protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, + | protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, + | protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, + ( + | protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest + | 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({ + 'session.name': request.session!.name || '', + }); + return this._innerApiCalls.batchCreateReadSessionStreams( + request, + options, + callback + ); + } + finalizeStream( + request: protosTypes.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest + | undefined + ), + {} | undefined + ] + >; + finalizeStream( + request: protosTypes.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest + | undefined, + {} | undefined + > + ): void; + /** + * Triggers the graceful termination of a single stream in a ReadSession. This + * API can be used to dynamically adjust the parallelism of a batch processing + * task downwards without losing data. + * + * This API does not delete the stream -- it remains visible in the + * ReadSession, and any data processed by the stream is not released to other + * streams. However, no additional data will be assigned to the stream once + * this call completes. Callers must continue reading data on the stream until + * the end of the stream is reached so that data which has already been + * assigned to the stream will be processed. + * + * This method will return an error if there are no other live streams + * in the Session, or if SplitReadStream() has been called on the given + * Stream. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.bigquery.storage.v1beta1.Stream} request.stream + * Stream to finalize. + * @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. + */ + finalizeStream( + request: protosTypes.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.protobuf.IEmpty, + | protosTypes.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.protobuf.IEmpty, + ( + | protosTypes.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest + | 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({ + 'stream.name': request.stream!.name || '', + }); + return this._innerApiCalls.finalizeStream(request, options, callback); + } + splitReadStream( + request: protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, + ( + | protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest + | undefined + ), + {} | undefined + ] + >; + splitReadStream( + request: protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, + | protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest + | undefined, + {} | undefined + > + ): void; + /** + * Splits a given read stream into two Streams. These streams are referred to + * as the primary and the residual of the split. The original stream can still + * be read from in the same manner as before. Both of the returned streams can + * also be read from, and the total rows return by both child streams will be + * the same as the rows read from the original stream. + * + * Moreover, the two child streams will be allocated back to back in the + * original Stream. Concretely, it is guaranteed that for streams Original, + * Primary, and Residual, that Original[0-j] = Primary[0-j] and + * Original[j-n] = Residual[0-m] once the streams have been read to + * completion. + * + * This method is guaranteed to be idempotent. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.bigquery.storage.v1beta1.Stream} request.originalStream + * Stream to split. + * @param {number} request.fraction + * A value in the range (0.0, 1.0) that specifies the fractional point at + * which the original stream should be split. The actual split point is + * evaluated on pre-filtered rows, so if a filter is provided, then there is + * no guarantee that the division of the rows between the new child streams + * will be proportional to this fractional value. Additionally, because the + * server-side unit for assigning data is collections of rows, this fraction + * will always map to to a data storage boundary on the server side. + * @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 [SplitReadStreamResponse]{@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + splitReadStream( + request: protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, + | protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, + | protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, + ( + | protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest + | 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({ + 'original_stream.name': request.originalStream!.name || '', + }); + return this._innerApiCalls.splitReadStream(request, options, callback); + } + + /** + * Reads rows from the table in the format prescribed by the read session. + * Each response contains one or more table rows, up to a maximum of 10 MiB + * per response; read requests which attempt to read individual rows larger + * than this will fail. + * + * Each request also returns a set of stream statistics reflecting the + * estimated total number of rows in the read stream. This number is computed + * based on the total table size and the number of active streams in the read + * session, and may change as other streams continue to read data. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.bigquery.storage.v1beta1.StreamPosition} request.readPosition + * Required. Identifier of the position in the stream to start reading from. + * The offset requested must be less than the last row read from ReadRows. + * Requesting a larger offset is undefined. + * @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 [ReadRowsResponse]{@link google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} on 'data' event. + */ + readRows( + request?: protosTypes.google.cloud.bigquery.storage.v1beta1.IReadRowsRequest, + options?: gax.CallOptions + ): gax.CancellableStream { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'read_position.stream.name': request.readPosition!.stream!.name || '', + }); + return this._innerApiCalls.readRows(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified readSession resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} session + * @returns {string} Resource name string. + */ + readSessionPath(project: string, location: string, session: string) { + return this._pathTemplates.readSessionPathTemplate.render({ + project, + location, + session, + }); + } + + /** + * Parse the project from ReadSession resource. + * + * @param {string} readSessionName + * A fully-qualified path representing ReadSession resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReadSessionName(readSessionName: string) { + return this._pathTemplates.readSessionPathTemplate.match(readSessionName) + .project; + } + + /** + * Parse the location from ReadSession resource. + * + * @param {string} readSessionName + * A fully-qualified path representing ReadSession resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReadSessionName(readSessionName: string) { + return this._pathTemplates.readSessionPathTemplate.match(readSessionName) + .location; + } + + /** + * Parse the session from ReadSession resource. + * + * @param {string} readSessionName + * A fully-qualified path representing ReadSession resource. + * @returns {string} A string representing the session. + */ + matchSessionFromReadSessionName(readSessionName: string) { + return this._pathTemplates.readSessionPathTemplate.match(readSessionName) + .session; + } + + /** + * Return a fully-qualified stream resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} stream + * @returns {string} Resource name string. + */ + streamPath(project: string, location: string, stream: string) { + return this._pathTemplates.streamPathTemplate.render({ + project, + location, + stream, + }); + } + + /** + * Parse the project from Stream resource. + * + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStreamName(streamName: string) { + return this._pathTemplates.streamPathTemplate.match(streamName).project; + } + + /** + * Parse the location from Stream resource. + * + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStreamName(streamName: string) { + return this._pathTemplates.streamPathTemplate.match(streamName).location; + } + + /** + * Parse the stream from Stream resource. + * + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the stream. + */ + matchStreamFromStreamName(streamName: string) { + return this._pathTemplates.streamPathTemplate.match(streamName).stream; + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + if (!this._terminated) { + return this.bigQueryStorageStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client_config.json b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client_config.json new file mode 100644 index 00000000000..003cb084ff8 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.bigquery.storage.v1beta1.BigQueryStorage": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateReadSession": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ReadRows": { + "timeout_millis": 86400000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "BatchCreateReadSessionStreams": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "FinalizeStream": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "SplitReadStream": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_proto_list.json b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_proto_list.json new file mode 100644 index 00000000000..0b8010758a6 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_proto_list.json @@ -0,0 +1,7 @@ +[ + "../../protos/google/cloud/bigquery/storage/v1beta1/arrow.proto", + "../../protos/google/cloud/bigquery/storage/v1beta1/avro.proto", + "../../protos/google/cloud/bigquery/storage/v1beta1/read_options.proto", + "../../protos/google/cloud/bigquery/storage/v1beta1/storage.proto", + "../../protos/google/cloud/bigquery/storage/v1beta1/table_reference.proto" +] diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/index.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/index.ts new file mode 100644 index 00000000000..7346292b381 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {BigQueryStorageClient} from './big_query_storage_client'; diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata new file mode 100644 index 00000000000..ab38fb4bc6d --- /dev/null +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -0,0 +1,38 @@ +{ + "updateTime": "2020-02-18T22:56:39.544261Z", + "sources": [ + { + "git": { + "name": ".", + "remote": "sso://user/steffanyb/nodejs-bigquery-storage", + "sha": "6152883ee18789d86f9d44ffc8433b55b7889118" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "ab2685d8d3a0e191dc8aef83df36773c07cb3d06", + "internalRef": "295738415" + } + }, + { + "template": { + "name": "node_library", + "origin": "synthtool.gcp", + "version": "2020.2.4" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "bigquerystorage", + "apiVersion": "v1beta1", + "language": "typescript", + "generator": "gapic-generator-typescript" + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-bigquery-storage/synth.py b/packages/google-cloud-bigquery-storage/synth.py index f9620996bce..ec0cb3d4f47 100644 --- a/packages/google-cloud-bigquery-storage/synth.py +++ b/packages/google-cloud-bigquery-storage/synth.py @@ -31,7 +31,7 @@ 'package-name': f'@google-cloud/bigquery-storage', }, ) - s.copy(library, excludes=['README.md']) + s.copy(library, excludes=['package.json', 'README.md']) # Copy common templates common_templates = gcp.CommonTemplates() templates = common_templates.node_library(source_location='build/src') diff --git a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..e1637d5246a --- /dev/null +++ b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const storage = require('@google-cloud/bigquery-storage'); + +function main() { + const bigQueryStorageClient = new storage.BigQueryStorageClient(); +} + +main(); diff --git a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..f0ce2eb8a76 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {BigQueryStorageClient} from '@google-cloud/bigquery-storage'; + +function main() { + const bigQueryStorageClient = new BigQueryStorageClient(); +} + +main(); diff --git a/packages/google-cloud-bigquery-storage/system-test/install.ts b/packages/google-cloud-bigquery-storage/system-test/install.ts new file mode 100644 index 00000000000..c9aa74ec221 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('typescript consumer tests', () => { + it('should have correct type signature for typescript users', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); + + it('should have correct type signature for javascript users', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); +}); diff --git a/packages/google-cloud-bigquery-storage/test/gapic-big_query_storage-v1beta1.ts b/packages/google-cloud-bigquery-storage/test/gapic-big_query_storage-v1beta1.ts new file mode 100644 index 00000000000..c087a51c2d8 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/test/gapic-big_query_storage-v1beta1.ts @@ -0,0 +1,372 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const bigquerystorageModule = require('../src'); + +import {PassThrough} from 'stream'; + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +function mockServerStreamingGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + const mockStream = new PassThrough({ + objectMode: true, + transform: (chunk: {}, enc: {}, callback: Callback) => { + if (error) { + callback(error); + } else { + callback(null, response); + } + }, + }); + return mockStream; + }; +} +describe('v1beta1.BigQueryStorageClient', () => { + it('has servicePath', () => { + const servicePath = + bigquerystorageModule.v1beta1.BigQueryStorageClient.servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = + bigquerystorageModule.v1beta1.BigQueryStorageClient.apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = bigquerystorageModule.v1beta1.BigQueryStorageClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + fallback: true, + }); + assert(client); + }); + describe('createReadSession', () => { + it('invokes createReadSession without error', done => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest = {}; + request.tableReference = {}; + request.tableReference.projectId = ''; + request.tableReference = {}; + request.tableReference.datasetId = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createReadSession = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createReadSession(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createReadSession with error', done => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest = {}; + request.tableReference = {}; + request.tableReference.projectId = ''; + request.tableReference = {}; + request.tableReference.datasetId = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createReadSession = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createReadSession(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('batchCreateReadSessionStreams', () => { + it('invokes batchCreateReadSessionStreams without error', done => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest = {}; + request.session = {}; + request.session.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.batchCreateReadSessionStreams = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.batchCreateReadSessionStreams(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes batchCreateReadSessionStreams with error', done => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest = {}; + request.session = {}; + request.session.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.batchCreateReadSessionStreams = mockSimpleGrpcMethod( + request, + null, + error + ); + client.batchCreateReadSessionStreams( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('finalizeStream', () => { + it('invokes finalizeStream without error', done => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest = {}; + request.stream = {}; + request.stream.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.finalizeStream = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.finalizeStream(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes finalizeStream with error', done => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest = {}; + request.stream = {}; + request.stream.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.finalizeStream = mockSimpleGrpcMethod( + request, + null, + error + ); + client.finalizeStream(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('splitReadStream', () => { + it('invokes splitReadStream without error', done => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest = {}; + request.originalStream = {}; + request.originalStream.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.splitReadStream = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.splitReadStream(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes splitReadStream with error', done => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest = {}; + request.originalStream = {}; + request.originalStream.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.splitReadStream = mockSimpleGrpcMethod( + request, + null, + error + ); + client.splitReadStream(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('readRows', () => { + it('invokes readRows without error', done => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request = { + readPosition: {stream: ''}, + }; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.readRows = mockServerStreamingGrpcMethod( + request, + expectedResponse, + null + ); + const stream = client.readRows(request); + stream.on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + stream.on('error', (err: FakeError) => { + done(err); + }); + stream.write(); + }); + it('invokes readRows with error', done => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request = { + readPosition: {stream: ''}, + }; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.readRows = mockServerStreamingGrpcMethod( + request, + null, + error + ); + const stream = client.readRows(request); + stream.on('data', () => { + assert.fail(); + }); + stream.on('error', (err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + stream.write(); + }); + }); +}); diff --git a/packages/google-cloud-bigquery-storage/tsconfig.json b/packages/google-cloud-bigquery-storage/tsconfig.json new file mode 100644 index 00000000000..613d35597b5 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2016", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-bigquery-storage/tslint.json b/packages/google-cloud-bigquery-storage/tslint.json new file mode 100644 index 00000000000..617dc975bae --- /dev/null +++ b/packages/google-cloud-bigquery-storage/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "gts/tslint.json" +} diff --git a/packages/google-cloud-bigquery-storage/webpack.config.js b/packages/google-cloud-bigquery-storage/webpack.config.js new file mode 100644 index 00000000000..ad9db41c80c --- /dev/null +++ b/packages/google-cloud-bigquery-storage/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'BigQueryStorage', + filename: './big-query-storage.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 d1dbca245c0c270d8ddc511bebdf000fe4737018 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 21 Feb 2020 16:45:10 +0100 Subject: [PATCH 004/182] chore(deps): update dependency mocha to v7 (#8) --- packages/google-cloud-bigquery-storage/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index 3b4674c4bf5..0ee487f94a1 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -20,6 +20,6 @@ "devDependencies": { "c8": "^5.0.1", "chai": "^4.2.0", - "mocha": "^6.2.2" + "mocha": "^7.0.0" } } From 010b770dd7e76efd54e7741e95bb179c99902325 Mon Sep 17 00:00:00 2001 From: Xiaozhen Liu Date: Wed, 26 Feb 2020 16:42:07 -0800 Subject: [PATCH 005/182] feat: export protos in src/index.ts --- packages/google-cloud-bigquery-storage/src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-bigquery-storage/src/index.ts b/packages/google-cloud-bigquery-storage/src/index.ts index 544140dbe62..b8de7b5c834 100644 --- a/packages/google-cloud-bigquery-storage/src/index.ts +++ b/packages/google-cloud-bigquery-storage/src/index.ts @@ -22,3 +22,5 @@ export {v1beta1, BigQueryStorageClient}; // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export export default {v1beta1, BigQueryStorageClient}; +import * as protos from '../protos/protos'; +export {protos}; From 983014fe8780c6f00db1ec6802a5be09e4a00dda Mon Sep 17 00:00:00 2001 From: Summer Ji Date: Thu, 27 Feb 2020 11:52:46 -0800 Subject: [PATCH 006/182] chore: update jsdoc.js (#14) --- packages/google-cloud-bigquery-storage/.jsdoc.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/.jsdoc.js b/packages/google-cloud-bigquery-storage/.jsdoc.js index 719a77bf2e9..908288f55c1 100644 --- a/packages/google-cloud-bigquery-storage/.jsdoc.js +++ b/packages/google-cloud-bigquery-storage/.jsdoc.js @@ -36,11 +36,14 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2018 Google, LLC.', + copyright: 'Copyright 2019 Google, LLC.', includeDate: false, sourceFiles: false, systemName: '@google-cloud/bigquery-storage', - theme: 'lumen' + theme: 'lumen', + default: { + "outputSourceFiles": false + } }, markdown: { idInHeadings: true From 3d64223e34df0068143ea6eb5a7574d32e90c622 Mon Sep 17 00:00:00 2001 From: Summer Ji Date: Thu, 27 Feb 2020 15:38:41 -0800 Subject: [PATCH 007/182] chore: update .jsdoc.js by add protos and remove double quotes (#15) --- packages/google-cloud-bigquery-storage/.jsdoc.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/.jsdoc.js b/packages/google-cloud-bigquery-storage/.jsdoc.js index 908288f55c1..079bc593259 100644 --- a/packages/google-cloud-bigquery-storage/.jsdoc.js +++ b/packages/google-cloud-bigquery-storage/.jsdoc.js @@ -31,7 +31,8 @@ module.exports = { source: { excludePattern: '(^|\\/|\\\\)[._]', include: [ - 'build/src' + 'build/src', + 'protos' ], includePattern: '\\.js$' }, @@ -42,7 +43,7 @@ module.exports = { systemName: '@google-cloud/bigquery-storage', theme: 'lumen', default: { - "outputSourceFiles": false + outputSourceFiles: false } }, markdown: { From 4b8309db104d06662c757c9b56b99883af144c58 Mon Sep 17 00:00:00 2001 From: Summer Ji Date: Fri, 28 Feb 2020 16:36:05 -0800 Subject: [PATCH 008/182] chore: update jsdoc with macro license (#17) --- packages/google-cloud-bigquery-storage/.jsdoc.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/google-cloud-bigquery-storage/.jsdoc.js b/packages/google-cloud-bigquery-storage/.jsdoc.js index 079bc593259..30eccb20f81 100644 --- a/packages/google-cloud-bigquery-storage/.jsdoc.js +++ b/packages/google-cloud-bigquery-storage/.jsdoc.js @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. // +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; From 1493260019396395b7badcbca6d2e149fa516df8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 29 Feb 2020 22:11:41 +0100 Subject: [PATCH 009/182] chore(deps): update dependency c8 to v7 (#7) --- packages/google-cloud-bigquery-storage/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index 0ee487f94a1..1ffd6dea971 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -18,7 +18,7 @@ "snappy": "^6.2.3" }, "devDependencies": { - "c8": "^5.0.1", + "c8": "^7.0.0", "chai": "^4.2.0", "mocha": "^7.0.0" } From d201a761a71af3933320cc3f2db870372ab7d7ce Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 11:15:03 -0800 Subject: [PATCH 010/182] chore: release 1.0.0 (#6) * created CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] Co-authored-by: Benjamin E. Coe --- packages/google-cloud-bigquery-storage/CHANGELOG.md | 13 +++++++++++++ packages/google-cloud-bigquery-storage/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-bigquery-storage/CHANGELOG.md diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md new file mode 100644 index 00000000000..7d8184e95bc --- /dev/null +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +## 1.0.0 (2020-02-29) + + +### ⚠ BREAKING CHANGES + +* initial generation of library (#1) + +### Features + +* export protos in src/index.ts ([68b922a](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/68b922a4c242a6ad2e360758ef0658ca8451b62f)) +* initial generation of library ([#1](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/1)) ([bd42fbd](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/bd42fbd45616adaf36cdf197d2b0f3c811025e39)) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 90fd02d8399..52262d0a14d 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "0.1.0", + "version": "1.0.0", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index 1ffd6dea971..2fe5174035f 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^0.1.0", + "@google-cloud/bigquery-storage": "^1.0.0", "avsc": "^5.4.18", "snappy": "^6.2.3" }, From 6ae47eba0e4f7854fd382c8147970701e5f4cc13 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 3 Mar 2020 09:35:38 -0800 Subject: [PATCH 011/182] chore: update linkinator config and auto-generated test (#19) * [CHANGE ME] Re-generated to pick up changes in the API or client library generator. * generator fix Co-authored-by: Alexander Fenster --- .../linkinator.config.json | 5 +---- .../google-cloud-bigquery-storage/synth.metadata | 14 ++++---------- .../test/gapic-big_query_storage-v1beta1.ts | 14 ++++++++------ 3 files changed, 13 insertions(+), 20 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/linkinator.config.json b/packages/google-cloud-bigquery-storage/linkinator.config.json index a4a25c7baee..b555215ca02 100644 --- a/packages/google-cloud-bigquery-storage/linkinator.config.json +++ b/packages/google-cloud-bigquery-storage/linkinator.config.json @@ -3,9 +3,6 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", - "img.shields.io", - "https://www.npmjs.org/package/@google-cloud/bigquery-storage", - "https://github.com/googleapis/nodejs-bigquery-storage/tree/master/samples", - "https://github.com/googleapis/nodejs-bigquery-storage/blob/master/samples/quickstart.js" + "img.shields.io" ] } diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index ab38fb4bc6d..6d57d60c02c 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -1,19 +1,13 @@ { - "updateTime": "2020-02-18T22:56:39.544261Z", + "updateTime": "2020-03-03T17:23:33.988627Z", "sources": [ - { - "git": { - "name": ".", - "remote": "sso://user/steffanyb/nodejs-bigquery-storage", - "sha": "6152883ee18789d86f9d44ffc8433b55b7889118" - } - }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "ab2685d8d3a0e191dc8aef83df36773c07cb3d06", - "internalRef": "295738415" + "sha": "a78ed801b82a5c6d9c5368e24b1412212e541bb7", + "internalRef": "298607357", + "log": "a78ed801b82a5c6d9c5368e24b1412212e541bb7\nPublishing v3 protos and configs.\n\nPiperOrigin-RevId: 298607357\n\n4a180bfff8a21645b3a935c2756e8d6ab18a74e0\nautoml/v1beta1 publish proto updates\n\nPiperOrigin-RevId: 298484782\n\n6de6e938b7df1cd62396563a067334abeedb9676\nchore: use the latest gapic-generator and protoc-java-resource-name-plugin in Bazel workspace.\n\nPiperOrigin-RevId: 298474513\n\n244ab2b83a82076a1fa7be63b7e0671af73f5c02\nAdds service config definition for bigqueryreservation v1\n\nPiperOrigin-RevId: 298455048\n\n" } }, { diff --git a/packages/google-cloud-bigquery-storage/test/gapic-big_query_storage-v1beta1.ts b/packages/google-cloud-bigquery-storage/test/gapic-big_query_storage-v1beta1.ts index c087a51c2d8..4b9fa589b7a 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic-big_query_storage-v1beta1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic-big_query_storage-v1beta1.ts @@ -319,9 +319,10 @@ describe('v1beta1.BigQueryStorageClient', () => { projectId: 'bogus', }); // Mock request - const request = { - readPosition: {stream: ''}, - }; + const request: protosTypes.google.cloud.bigquery.storage.v1beta1.IReadRowsRequest = {}; + request.readPosition = {}; + request.readPosition.stream = {}; + request.readPosition.stream.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -346,9 +347,10 @@ describe('v1beta1.BigQueryStorageClient', () => { projectId: 'bogus', }); // Mock request - const request = { - readPosition: {stream: ''}, - }; + const request: protosTypes.google.cloud.bigquery.storage.v1beta1.IReadRowsRequest = {}; + request.readPosition = {}; + request.readPosition.stream = {}; + request.readPosition.stream.name = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer From 890b4357a8c9b4f2c6b4118a69a49afceeedd513 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 5 Mar 2020 07:54:41 -0800 Subject: [PATCH 012/182] docs: updated comments for TableReadOptions --- .../cloud/bigquery/storage/v1beta1/read_options.proto | 3 +-- packages/google-cloud-bigquery-storage/synth.metadata | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/read_options.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/read_options.proto index 9591deba7f4..8ed9b73f6cf 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/read_options.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/read_options.proto @@ -29,8 +29,7 @@ message TableReadOptions { repeated string selected_fields = 1; // Optional. SQL text filtering statement, similar to a WHERE clause in - // a query. Currently, only a single predicate that is a comparison between - // a column and a constant value is supported. Aggregates are not supported. + // a query. Aggregates are not supported. // // Examples: "int_field > 5" // "date_field = CAST('2014-9-27' as DATE)" diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 6d57d60c02c..3600eb7341d 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -1,13 +1,13 @@ { - "updateTime": "2020-03-03T17:23:33.988627Z", + "updateTime": "2020-03-05T12:45:42.538924Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "a78ed801b82a5c6d9c5368e24b1412212e541bb7", - "internalRef": "298607357", - "log": "a78ed801b82a5c6d9c5368e24b1412212e541bb7\nPublishing v3 protos and configs.\n\nPiperOrigin-RevId: 298607357\n\n4a180bfff8a21645b3a935c2756e8d6ab18a74e0\nautoml/v1beta1 publish proto updates\n\nPiperOrigin-RevId: 298484782\n\n6de6e938b7df1cd62396563a067334abeedb9676\nchore: use the latest gapic-generator and protoc-java-resource-name-plugin in Bazel workspace.\n\nPiperOrigin-RevId: 298474513\n\n244ab2b83a82076a1fa7be63b7e0671af73f5c02\nAdds service config definition for bigqueryreservation v1\n\nPiperOrigin-RevId: 298455048\n\n" + "sha": "638253bf86d1ce1c314108a089b7351440c2f0bf", + "internalRef": "298971070", + "log": "638253bf86d1ce1c314108a089b7351440c2f0bf\nfix: add java_multiple_files option for automl text_sentiment.proto\n\nPiperOrigin-RevId: 298971070\n\n373d655703bf914fb8b0b1cc4071d772bac0e0d1\nUpdate Recs AI Beta public bazel file\n\nPiperOrigin-RevId: 298961623\n\ndcc5d00fc8a8d8b56f16194d7c682027b2c66a3b\nfix: add java_multiple_files option for automl classification.proto\n\nPiperOrigin-RevId: 298953301\n\na3f791827266f3496a6a5201d58adc4bb265c2a3\nchore: automl/v1 publish annotations and retry config\n\nPiperOrigin-RevId: 298942178\n\n01c681586d8d6dbd60155289b587aee678530bd9\nMark return_immediately in PullRequest deprecated.\n\nPiperOrigin-RevId: 298893281\n\nc9f5e9c4bfed54bbd09227e990e7bded5f90f31c\nRemove out of date documentation for predicate support on the Storage API\n\nPiperOrigin-RevId: 298883309\n\nfd5b3b8238d783b04692a113ffe07c0363f5de0f\ngenerate webrisk v1 proto\n\nPiperOrigin-RevId: 298847934\n\n541b1ded4abadcc38e8178680b0677f65594ea6f\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 298686266\n\nc0d171acecb4f5b0bfd2c4ca34fc54716574e300\n Updated to include the Notification v1 API.\n\nPiperOrigin-RevId: 298652775\n\n2346a9186c0bff2c9cc439f2459d558068637e05\nAdd Service Directory v1beta1 protos and configs\n\nPiperOrigin-RevId: 298625638\n\n" } }, { From aeb68425d24b7210cd310ff53c35e379f5ca29e5 Mon Sep 17 00:00:00 2001 From: "gcf-merge-on-green[bot]" <60162190+gcf-merge-on-green[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2020 00:08:06 +0000 Subject: [PATCH 013/182] feat: deferred client initialization (#23) This PR includes changes from https://github.com/googleapis/gapic-generator-typescript/pull/317 that will move the asynchronous initialization and authentication from the client constructor to an `initialize()` method. This method will be automatically called when the first RPC call is performed. The client library usage has not changed, there is no need to update any code. If you want to make sure the client is authenticated _before_ the first RPC call, you can do ```js await client.initialize(); ``` manually before calling any client method. --- .../src/v1beta1/big_query_storage_client.ts | 79 +++++++++++++------ .../synth.metadata | 8 +- .../test/gapic-big_query_storage-v1beta1.ts | 36 +++++++++ 3 files changed, 97 insertions(+), 26 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index 5f41cbd976e..e85d0072dc2 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -43,8 +43,13 @@ export class BigQueryStorageClient { private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; - bigQueryStorageStub: Promise<{[name: string]: Function}>; + bigQueryStorageStub?: Promise<{[name: string]: Function}>; /** * Construct an instance of BigQueryStorageClient. @@ -68,8 +73,6 @@ export class BigQueryStorageClient { * app is running in an environment which supports * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. - * @param {function} [options.promise] - Custom promise module to use instead - * of native Promises. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ @@ -99,25 +102,28 @@ export class BigQueryStorageClient { // If we are in browser, we are already using fallback because of the // "browser" field in package.json. // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = (this.constructor as typeof BigQueryStorageClient).scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; // Save the auth object to the client, for use by other methods. - this.auth = gaxGrpc.auth as gax.GoogleAuth; + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { - clientHeader.push(`gl-web/${gaxModule.version}`); + clientHeader.push(`gl-web/${this._gaxModule.version}`); } if (!opts.fallback) { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); @@ -133,7 +139,7 @@ export class BigQueryStorageClient { 'protos', 'protos.json' ); - const protos = gaxGrpc.loadProto( + this._protos = this._gaxGrpc.loadProto( opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); @@ -141,10 +147,10 @@ export class BigQueryStorageClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - readSessionPathTemplate: new gaxModule.PathTemplate( + readSessionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/sessions/{session}' ), - streamPathTemplate: new gaxModule.PathTemplate( + streamPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/streams/{stream}' ), }; @@ -152,11 +158,13 @@ export class BigQueryStorageClient { // Some of the methods on this service provide streaming responses. // Provide descriptors for these. this._descriptors.stream = { - readRows: new gaxModule.StreamDescriptor(gax.StreamType.SERVER_STREAMING), + readRows: new this._gaxModule.StreamDescriptor( + gax.StreamType.SERVER_STREAMING + ), }; // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( + this._defaults = this._gaxGrpc.constructSettings( 'google.cloud.bigquery.storage.v1beta1.BigQueryStorage', gapicConfig as gax.ClientConfig, opts.clientConfig || {}, @@ -167,17 +175,36 @@ export class BigQueryStorageClient { // 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.bigQueryStorageStub) { + return this.bigQueryStorageStub; + } // Put together the "service stub" for // google.cloud.bigquery.storage.v1beta1.BigQueryStorage. - this.bigQueryStorageStub = gaxGrpc.createStub( - opts.fallback - ? (protos as protobuf.Root).lookupService( + this.bigQueryStorageStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( 'google.cloud.bigquery.storage.v1beta1.BigQueryStorage' ) : // tslint:disable-next-line no-any - (protos as any).google.cloud.bigquery.storage.v1beta1.BigQueryStorage, - opts + (this._protos as any).google.cloud.bigquery.storage.v1beta1 + .BigQueryStorage, + this._opts ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides @@ -203,9 +230,9 @@ export class BigQueryStorageClient { } ); - const apiCall = gaxModule.createApiCall( + const apiCall = this._gaxModule.createApiCall( innerCallPromise, - defaults[methodName], + this._defaults[methodName], this._descriptors.page[methodName] || this._descriptors.stream[methodName] || this._descriptors.longrunning[methodName] @@ -219,6 +246,8 @@ export class BigQueryStorageClient { return apiCall(argument, callOptions, callback); }; } + + return this.bigQueryStorageStub; } /** @@ -386,6 +415,7 @@ export class BigQueryStorageClient { 'table_reference.project_id': request.tableReference!.projectId || '', 'table_reference.dataset_id': request.tableReference!.datasetId || '', }); + this.initialize(); return this._innerApiCalls.createReadSession(request, options, callback); } batchCreateReadSessionStreams( @@ -473,6 +503,7 @@ export class BigQueryStorageClient { ] = gax.routingHeader.fromParams({ 'session.name': request.session!.name || '', }); + this.initialize(); return this._innerApiCalls.batchCreateReadSessionStreams( request, options, @@ -570,6 +601,7 @@ export class BigQueryStorageClient { ] = gax.routingHeader.fromParams({ 'stream.name': request.stream!.name || '', }); + this.initialize(); return this._innerApiCalls.finalizeStream(request, options, callback); } splitReadStream( @@ -670,6 +702,7 @@ export class BigQueryStorageClient { ] = gax.routingHeader.fromParams({ 'original_stream.name': request.originalStream!.name || '', }); + this.initialize(); return this._innerApiCalls.splitReadStream(request, options, callback); } @@ -708,6 +741,7 @@ export class BigQueryStorageClient { ] = gax.routingHeader.fromParams({ 'read_position.stream.name': request.readPosition!.stream!.name || '', }); + this.initialize(); return this._innerApiCalls.readRows(request, options); } @@ -822,8 +856,9 @@ export class BigQueryStorageClient { * The client will no longer be usable and all future behavior is undefined. */ close(): Promise { + this.initialize(); if (!this._terminated) { - return this.bigQueryStorageStub.then(stub => { + return this.bigQueryStorageStub!.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 3600eb7341d..4d0b0a1a89b 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -1,13 +1,13 @@ { - "updateTime": "2020-03-05T12:45:42.538924Z", + "updateTime": "2020-03-05T23:02:10.150448Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "638253bf86d1ce1c314108a089b7351440c2f0bf", - "internalRef": "298971070", - "log": "638253bf86d1ce1c314108a089b7351440c2f0bf\nfix: add java_multiple_files option for automl text_sentiment.proto\n\nPiperOrigin-RevId: 298971070\n\n373d655703bf914fb8b0b1cc4071d772bac0e0d1\nUpdate Recs AI Beta public bazel file\n\nPiperOrigin-RevId: 298961623\n\ndcc5d00fc8a8d8b56f16194d7c682027b2c66a3b\nfix: add java_multiple_files option for automl classification.proto\n\nPiperOrigin-RevId: 298953301\n\na3f791827266f3496a6a5201d58adc4bb265c2a3\nchore: automl/v1 publish annotations and retry config\n\nPiperOrigin-RevId: 298942178\n\n01c681586d8d6dbd60155289b587aee678530bd9\nMark return_immediately in PullRequest deprecated.\n\nPiperOrigin-RevId: 298893281\n\nc9f5e9c4bfed54bbd09227e990e7bded5f90f31c\nRemove out of date documentation for predicate support on the Storage API\n\nPiperOrigin-RevId: 298883309\n\nfd5b3b8238d783b04692a113ffe07c0363f5de0f\ngenerate webrisk v1 proto\n\nPiperOrigin-RevId: 298847934\n\n541b1ded4abadcc38e8178680b0677f65594ea6f\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 298686266\n\nc0d171acecb4f5b0bfd2c4ca34fc54716574e300\n Updated to include the Notification v1 API.\n\nPiperOrigin-RevId: 298652775\n\n2346a9186c0bff2c9cc439f2459d558068637e05\nAdd Service Directory v1beta1 protos and configs\n\nPiperOrigin-RevId: 298625638\n\n" + "sha": "f0b581b5bdf803e45201ecdb3688b60e381628a8", + "internalRef": "299181282", + "log": "f0b581b5bdf803e45201ecdb3688b60e381628a8\nfix: recommendationengine/v1beta1 update some comments\n\nPiperOrigin-RevId: 299181282\n\n10e9a0a833dc85ff8f05b2c67ebe5ac785fe04ff\nbuild: add generated BUILD file for Routes Preferred API\n\nPiperOrigin-RevId: 299164808\n\n86738c956a8238d7c77f729be78b0ed887a6c913\npublish v1p1beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299152383\n\n73d9f2ad4591de45c2e1f352bc99d70cbd2a6d95\npublish v1: update with absolute address in comments\n\nPiperOrigin-RevId: 299147194\n\nd2158f24cb77b0b0ccfe68af784c6a628705e3c6\npublish v1beta2: update with absolute address in comments\n\nPiperOrigin-RevId: 299147086\n\n7fca61292c11b4cd5b352cee1a50bf88819dd63b\npublish v1p2beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146903\n\n583b7321624736e2c490e328f4b1957335779295\npublish v1p3beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146674\n\n" } }, { diff --git a/packages/google-cloud-bigquery-storage/test/gapic-big_query_storage-v1beta1.ts b/packages/google-cloud-bigquery-storage/test/gapic-big_query_storage-v1beta1.ts index 4b9fa589b7a..28001512c10 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic-big_query_storage-v1beta1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic-big_query_storage-v1beta1.ts @@ -105,12 +105,30 @@ describe('v1beta1.BigQueryStorageClient', () => { }); assert(client); }); + it('has initialize method and supports deferred initialization', async () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.bigQueryStorageStub, undefined); + await client.initialize(); + assert(client.bigQueryStorageStub); + }); + it('has close method', () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); describe('createReadSession', () => { it('invokes createReadSession without error', done => { const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest = {}; request.tableReference = {}; @@ -137,6 +155,8 @@ describe('v1beta1.BigQueryStorageClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest = {}; request.tableReference = {}; @@ -165,6 +185,8 @@ describe('v1beta1.BigQueryStorageClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest = {}; request.session = {}; @@ -189,6 +211,8 @@ describe('v1beta1.BigQueryStorageClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest = {}; request.session = {}; @@ -218,6 +242,8 @@ describe('v1beta1.BigQueryStorageClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest = {}; request.stream = {}; @@ -242,6 +268,8 @@ describe('v1beta1.BigQueryStorageClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest = {}; request.stream = {}; @@ -268,6 +296,8 @@ describe('v1beta1.BigQueryStorageClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest = {}; request.originalStream = {}; @@ -292,6 +322,8 @@ describe('v1beta1.BigQueryStorageClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest = {}; request.originalStream = {}; @@ -318,6 +350,8 @@ describe('v1beta1.BigQueryStorageClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.bigquery.storage.v1beta1.IReadRowsRequest = {}; request.readPosition = {}; @@ -346,6 +380,8 @@ describe('v1beta1.BigQueryStorageClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.bigquery.storage.v1beta1.IReadRowsRequest = {}; request.readPosition = {}; From 9d03a655a9a5c0f02ca2e713d8e7e52be23cef17 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 5 Mar 2020 17:27:15 -0800 Subject: [PATCH 014/182] build: update linkinator config (#25) --- packages/google-cloud-bigquery-storage/linkinator.config.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/linkinator.config.json b/packages/google-cloud-bigquery-storage/linkinator.config.json index b555215ca02..29a223b6db6 100644 --- a/packages/google-cloud-bigquery-storage/linkinator.config.json +++ b/packages/google-cloud-bigquery-storage/linkinator.config.json @@ -4,5 +4,7 @@ "https://codecov.io/gh/googleapis/", "www.googleapis.com", "img.shields.io" - ] + ], + "silent": true, + "concurrency": 10 } From 412a74b1cb1549580ccf1b803811e2b2c364f82c Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 6 Mar 2020 15:00:29 -0800 Subject: [PATCH 015/182] build(tests): fix coveralls and enable build cop (#26) --- .../google-cloud-bigquery-storage/.mocharc.js | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 packages/google-cloud-bigquery-storage/.mocharc.js diff --git a/packages/google-cloud-bigquery-storage/.mocharc.js b/packages/google-cloud-bigquery-storage/.mocharc.js new file mode 100644 index 00000000000..ff7b34fa5d1 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/.mocharc.js @@ -0,0 +1,28 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config From cc63e7ac0c45c828ad6f1314956949439fe2d939 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2020 16:12:12 +0000 Subject: [PATCH 016/182] chore: release 1.1.0 (#24) :robot: I have created a release \*beep\* \*boop\* --- ## [1.1.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v1.0.0...v1.1.0) (2020-03-06) ### Features * deferred client initialization ([#23](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/23)) ([4741719](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/474171928bbdd5d0fb2eab7be868317f88cd18eb)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- packages/google-cloud-bigquery-storage/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-storage/package.json | 2 +- .../google-cloud-bigquery-storage/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md index 7d8184e95bc..fee320ce64d 100644 --- a/packages/google-cloud-bigquery-storage/CHANGELOG.md +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.1.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v1.0.0...v1.1.0) (2020-03-06) + + +### Features + +* deferred client initialization ([#23](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/23)) ([4741719](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/474171928bbdd5d0fb2eab7be868317f88cd18eb)) + ## 1.0.0 (2020-02-29) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 52262d0a14d..396ffa7ec1c 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "1.0.0", + "version": "1.1.0", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index 2fe5174035f..eb21017cf21 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^1.0.0", + "@google-cloud/bigquery-storage": "^1.1.0", "avsc": "^5.4.18", "snappy": "^6.2.3" }, From 33dba5574c65bc1a8f78a20f220272cab39a4890 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 18 Mar 2020 12:57:51 -0700 Subject: [PATCH 017/182] docs: mention templates in contributing section of README (#29) --- packages/google-cloud-bigquery-storage/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/google-cloud-bigquery-storage/README.md b/packages/google-cloud-bigquery-storage/README.md index 21c1c791ab3..1c239b6b589 100644 --- a/packages/google-cloud-bigquery-storage/README.md +++ b/packages/google-cloud-bigquery-storage/README.md @@ -213,6 +213,12 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-bigquery-storage/blob/master/CONTRIBUTING.md). +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its template in this +[directory](https://github.com/googleapis/synthtool/tree/master/synthtool/gcp/templates/node_library). + ## License Apache Version 2.0 From 19685329bdcfcad0dcc4691e5860393811b081df Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Thu, 19 Mar 2020 08:57:48 -0700 Subject: [PATCH 018/182] chore: remove snippet leading whitespace (#31) --- .../google-cloud-bigquery-storage/README.md | 234 +++++++++--------- 1 file changed, 117 insertions(+), 117 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/README.md b/packages/google-cloud-bigquery-storage/README.md index 1c239b6b589..ea3cd1c6216 100644 --- a/packages/google-cloud-bigquery-storage/README.md +++ b/packages/google-cloud-bigquery-storage/README.md @@ -56,125 +56,125 @@ npm install @google-cloud/bigquery-storage ```javascript - // The read stream contains blocks of Avro-encoded bytes. We use the - // 'avsc' library to decode these blocks. Install avsc with the following - // command: npm install avsc - const avro = require('avsc'); - - // See reference documentation at - // https://cloud.google.com/bigquery/docs/reference/storage - const bqStorage = require('@google-cloud/bigquery-storage').v1beta1 - .BigQueryStorageClient; - - const client = new bqStorage(); - - async function bigqueryStorageQuickstart() { - // Get current project ID. The read session is created in this project. - // This project can be different from that which contains the table. - const myProjectId = await client.getProjectId(); - - // This example reads baby name data from the public datasets. - const projectId = 'bigquery-public-data'; - const datasetId = 'usa_names'; - const tableId = 'usa_1910_current'; - - const tableReference = { - projectId, - datasetId, - tableId, - }; - - const parent = `projects/${myProjectId}`; - - /* We limit the output columns to a subset of those allowed in the table, - * and set a simple filter to only report names from the state of - * Washington (WA). - */ - const readOptions = { - selectedFields: ['name', 'number', 'state'], - rowRestriction: 'state = "WA"', - }; - - let tableModifiers = null; - const snapshotSeconds = 0; - - // Set a snapshot time if it's been specified. - if (snapshotSeconds > 0) { - tableModifiers = {snapshotTime: {seconds: snapshotSeconds}}; - } - - // API request. - const request = { - tableReference, - parent, - readOptions, - tableModifiers, - // This API can also deliver data serialized in Apache Arrow format. - // This example leverages Apache Avro. - format: 'AVRO', - /* We use a LIQUID strategy in this example because we only read from a - * single stream. Consider BALANCED if you're consuming multiple streams - * concurrently and want more consistent stream sizes. - */ - shardingStrategy: 'LIQUID', - }; - - const [session] = await client.createReadSession(request); - - const schema = JSON.parse(session.avroSchema.schema); - - const avroType = avro.Type.forSchema(schema); - - /* The offset requested must be less than the last - * row read from ReadRows. Requesting a larger offset is - * undefined. - */ - let offset = 0; - - const readRowsRequest = { - // Optional stream name or offset. Offset requested must be less than the last - // row read from readRows(). Requesting a larger offset is undefined. - readPosition: { - stream: session.streams[0], - offset, - }, - }; - - const names = new Set(); - const states = {}; - - /* We'll use only a single stream for reading data from the table. Because - * of dynamic sharding, this will yield all the rows in the table. However, - * if you wanted to fan out multiple readers you could do so by having a - * reader process each individual stream. +// The read stream contains blocks of Avro-encoded bytes. We use the +// 'avsc' library to decode these blocks. Install avsc with the following +// command: npm install avsc +const avro = require('avsc'); + +// See reference documentation at +// https://cloud.google.com/bigquery/docs/reference/storage +const bqStorage = require('@google-cloud/bigquery-storage').v1beta1 + .BigQueryStorageClient; + +const client = new bqStorage(); + +async function bigqueryStorageQuickstart() { + // Get current project ID. The read session is created in this project. + // This project can be different from that which contains the table. + const myProjectId = await client.getProjectId(); + + // This example reads baby name data from the public datasets. + const projectId = 'bigquery-public-data'; + const datasetId = 'usa_names'; + const tableId = 'usa_1910_current'; + + const tableReference = { + projectId, + datasetId, + tableId, + }; + + const parent = `projects/${myProjectId}`; + + /* We limit the output columns to a subset of those allowed in the table, + * and set a simple filter to only report names from the state of + * Washington (WA). + */ + const readOptions = { + selectedFields: ['name', 'number', 'state'], + rowRestriction: 'state = "WA"', + }; + + let tableModifiers = null; + const snapshotSeconds = 0; + + // Set a snapshot time if it's been specified. + if (snapshotSeconds > 0) { + tableModifiers = {snapshotTime: {seconds: snapshotSeconds}}; + } + + // API request. + const request = { + tableReference, + parent, + readOptions, + tableModifiers, + // This API can also deliver data serialized in Apache Arrow format. + // This example leverages Apache Avro. + format: 'AVRO', + /* We use a LIQUID strategy in this example because we only read from a + * single stream. Consider BALANCED if you're consuming multiple streams + * concurrently and want more consistent stream sizes. */ - client - .readRows(readRowsRequest) - .on('error', console.error) - .on('data', function(data) { - try { - const decodedData = avroType.decode( - data.avroRows.serializedBinaryRows - ); - - names.add(decodedData.value.name); - - if (!states[decodedData.value.state]) { - states[decodedData.value.state] = true; - } - - offset = decodedData.offset; - } catch (error) { - console.log(error); - } - }) - .on('end', function() { - console.log( - `Got ${names.size} unique names in states: ${Object.keys(states)}` + shardingStrategy: 'LIQUID', + }; + + const [session] = await client.createReadSession(request); + + const schema = JSON.parse(session.avroSchema.schema); + + const avroType = avro.Type.forSchema(schema); + + /* The offset requested must be less than the last + * row read from ReadRows. Requesting a larger offset is + * undefined. + */ + let offset = 0; + + const readRowsRequest = { + // Optional stream name or offset. Offset requested must be less than the last + // row read from readRows(). Requesting a larger offset is undefined. + readPosition: { + stream: session.streams[0], + offset, + }, + }; + + const names = new Set(); + const states = {}; + + /* We'll use only a single stream for reading data from the table. Because + * of dynamic sharding, this will yield all the rows in the table. However, + * if you wanted to fan out multiple readers you could do so by having a + * reader process each individual stream. + */ + client + .readRows(readRowsRequest) + .on('error', console.error) + .on('data', function(data) { + try { + const decodedData = avroType.decode( + data.avroRows.serializedBinaryRows ); - console.log(`Last offset: ${offset}`); - }); - } + + names.add(decodedData.value.name); + + if (!states[decodedData.value.state]) { + states[decodedData.value.state] = true; + } + + offset = decodedData.offset; + } catch (error) { + console.log(error); + } + }) + .on('end', function() { + console.log( + `Got ${names.size} unique names in states: ${Object.keys(states)}` + ); + console.log(`Last offset: ${offset}`); + }); +} ``` From 1c86fc69d18d390dc3d7c8fe5a304e79190107d7 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 23 Mar 2020 18:29:24 -0700 Subject: [PATCH 019/182] docs: document version support goals (#36) --- .../google-cloud-bigquery-storage/README.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/google-cloud-bigquery-storage/README.md b/packages/google-cloud-bigquery-storage/README.md index ea3cd1c6216..40069706e54 100644 --- a/packages/google-cloud-bigquery-storage/README.md +++ b/packages/google-cloud-bigquery-storage/README.md @@ -191,6 +191,27 @@ has instructions for running the samples. +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. + +Client libraries targetting some end-of-life versions of Node.js are available, and +can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. + +_Legacy Node.js versions are supported as a best effort:_ + +* Legacy versions will not be tested in continuous integration. +* Some security patches may not be able to be backported. +* Dependencies will not be kept up-to-date, and features will not be backported. + +#### Legacy tags available + +* `legacy-8`: install client libraries from this dist-tag for versions + compatible with Node.js 8. + ## Versioning This library follows [Semantic Versioning](http://semver.org/). From 5528a0400464ba28fca3137eb214dc6d8b4c273c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 25 Mar 2020 01:12:36 -0700 Subject: [PATCH 020/182] chore: regenerate the code (#35) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2020-03-22 05:01:05,430 synthtool > Executing /tmpfs/src/git/autosynth/working_repo/synth.py. 2020-03-22 05:01:05,486 synthtool > Ensuring dependencies. 2020-03-22 05:01:05,492 synthtool > Cloning googleapis. 2020-03-22 05:01:05,861 synthtool > Pulling Docker image: gapic-generator-typescript:latest latest: Pulling from gapic-images/gapic-generator-typescript Digest: sha256:3762b8bcba247ef4d020ffc7043e2881a20b5fab0ffd98d542f365d3f3a3829d Status: Image is up to date for gcr.io/gapic-images/gapic-generator-typescript:latest 2020-03-22 05:01:06,769 synthtool > Generating code for: google/cloud/bigquery/storage/v1beta1. 2020-03-22 05:01:07,962 synthtool > Generated code into /tmpfs/tmp/tmp1xyt53dg. .eslintignore .eslintrc.yml .github/ISSUE_TEMPLATE/bug_report.md .github/ISSUE_TEMPLATE/feature_request.md .github/ISSUE_TEMPLATE/support_request.md .github/PULL_REQUEST_TEMPLATE.md .github/publish.yml .github/release-please.yml .github/workflows/ci.yaml .kokoro/common.cfg .kokoro/continuous/node10/common.cfg .kokoro/continuous/node10/docs.cfg .kokoro/continuous/node10/lint.cfg .kokoro/continuous/node10/samples-test.cfg .kokoro/continuous/node10/system-test.cfg .kokoro/continuous/node10/test.cfg .kokoro/continuous/node12/common.cfg .kokoro/continuous/node12/test.cfg .kokoro/continuous/node8/common.cfg .kokoro/continuous/node8/test.cfg .kokoro/docs.sh .kokoro/lint.sh .kokoro/presubmit/node10/common.cfg .kokoro/presubmit/node10/docs.cfg .kokoro/presubmit/node10/lint.cfg .kokoro/presubmit/node10/samples-test.cfg .kokoro/presubmit/node10/system-test.cfg .kokoro/presubmit/node10/test.cfg .kokoro/presubmit/node12/common.cfg .kokoro/presubmit/node12/test.cfg .kokoro/presubmit/node8/common.cfg .kokoro/presubmit/node8/test.cfg .kokoro/presubmit/windows/common.cfg .kokoro/presubmit/windows/test.cfg .kokoro/publish.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 CODE_OF_CONDUCT.md CONTRIBUTING.md LICENSE README.md codecov.yaml renovate.json samples/README.md npm WARN npm npm does not support Node.js v12.16.1 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11. npm WARN npm You can find the latest version at https://nodejs.org/ > protobufjs@6.8.9 postinstall /tmpfs/src/git/autosynth/working_repo/node_modules/protobufjs > node scripts/postinstall > @google-cloud/bigquery-storage@1.1.0 prepare /tmpfs/src/git/autosynth/working_repo > npm run compile-protos && npm run compile npm WARN npm npm does not support Node.js v12.16.1 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11. npm WARN npm You can find the latest version at https://nodejs.org/ > @google-cloud/bigquery-storage@1.1.0 compile-protos /tmpfs/src/git/autosynth/working_repo > compileProtos src installing semver@^5.5.0 installing uglify-js@^3.3.25 installing espree@^3.5.4 installing escodegen@^1.9.1 npm WARN npm npm does not support Node.js v12.16.1 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11. npm WARN npm You can find the latest version at https://nodejs.org/ > @google-cloud/bigquery-storage@1.1.0 compile /tmpfs/src/git/autosynth/working_repo > tsc -p . && cp -r protos build/ npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.1 (node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/watchpack/node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.12: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: abbrev@1.1.1 (node_modules/watchpack/node_modules/fsevents/node_modules/abbrev): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/abbrev' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.abbrev.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ansi-regex@2.1.1 (node_modules/watchpack/node_modules/fsevents/node_modules/ansi-regex): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/ansi-regex' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.ansi-regex.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: aproba@1.2.0 (node_modules/watchpack/node_modules/fsevents/node_modules/aproba): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/aproba' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.aproba.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: balanced-match@1.0.0 (node_modules/watchpack/node_modules/fsevents/node_modules/balanced-match): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/balanced-match' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.balanced-match.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: chownr@1.1.4 (node_modules/watchpack/node_modules/fsevents/node_modules/chownr): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/chownr' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.chownr.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: code-point-at@1.1.0 (node_modules/watchpack/node_modules/fsevents/node_modules/code-point-at): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/code-point-at' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.code-point-at.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: concat-map@0.0.1 (node_modules/watchpack/node_modules/fsevents/node_modules/concat-map): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/concat-map' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.concat-map.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: console-control-strings@1.1.0 (node_modules/watchpack/node_modules/fsevents/node_modules/console-control-strings): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/console-control-strings' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.console-control-strings.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: core-util-is@1.0.2 (node_modules/watchpack/node_modules/fsevents/node_modules/core-util-is): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/core-util-is' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.core-util-is.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: deep-extend@0.6.0 (node_modules/watchpack/node_modules/fsevents/node_modules/deep-extend): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/deep-extend' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.deep-extend.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: delegates@1.0.0 (node_modules/watchpack/node_modules/fsevents/node_modules/delegates): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/delegates' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.delegates.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: detect-libc@1.0.3 (node_modules/watchpack/node_modules/fsevents/node_modules/detect-libc): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/detect-libc' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.detect-libc.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs.realpath@1.0.0 (node_modules/watchpack/node_modules/fsevents/node_modules/fs.realpath): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/fs.realpath' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.fs.realpath.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: has-unicode@2.0.1 (node_modules/watchpack/node_modules/fsevents/node_modules/has-unicode): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/has-unicode' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.has-unicode.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: inherits@2.0.4 (node_modules/watchpack/node_modules/fsevents/node_modules/inherits): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/inherits' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.inherits.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ini@1.3.5 (node_modules/watchpack/node_modules/fsevents/node_modules/ini): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/ini' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.ini.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: isarray@1.0.0 (node_modules/watchpack/node_modules/fsevents/node_modules/isarray): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/isarray' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.isarray.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: minimist@1.2.5 (node_modules/watchpack/node_modules/fsevents/node_modules/minimist): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/minimist' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.minimist.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ms@2.1.2 (node_modules/watchpack/node_modules/fsevents/node_modules/ms): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/ms' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.ms.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: npm-normalize-package-bin@1.0.1 (node_modules/watchpack/node_modules/fsevents/node_modules/npm-normalize-package-bin): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/npm-normalize-package-bin' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.npm-normalize-package-bin.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: number-is-nan@1.0.1 (node_modules/watchpack/node_modules/fsevents/node_modules/number-is-nan): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/number-is-nan' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.number-is-nan.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: object-assign@4.1.1 (node_modules/watchpack/node_modules/fsevents/node_modules/object-assign): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/object-assign' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.object-assign.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: os-homedir@1.0.2 (node_modules/watchpack/node_modules/fsevents/node_modules/os-homedir): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/os-homedir' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.os-homedir.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: os-tmpdir@1.0.2 (node_modules/watchpack/node_modules/fsevents/node_modules/os-tmpdir): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/os-tmpdir' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.os-tmpdir.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: path-is-absolute@1.0.1 (node_modules/watchpack/node_modules/fsevents/node_modules/path-is-absolute): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/path-is-absolute' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.path-is-absolute.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: process-nextick-args@2.0.1 (node_modules/watchpack/node_modules/fsevents/node_modules/process-nextick-args): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/process-nextick-args' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.process-nextick-args.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: safe-buffer@5.1.2 (node_modules/watchpack/node_modules/fsevents/node_modules/safe-buffer): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/safe-buffer' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.safe-buffer.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: safer-buffer@2.1.2 (node_modules/watchpack/node_modules/fsevents/node_modules/safer-buffer): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/safer-buffer' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.safer-buffer.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sax@1.2.4 (node_modules/watchpack/node_modules/fsevents/node_modules/sax): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/sax' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.sax.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: semver@5.7.1 (node_modules/watchpack/node_modules/fsevents/node_modules/semver): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/semver' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.semver.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: set-blocking@2.0.0 (node_modules/watchpack/node_modules/fsevents/node_modules/set-blocking): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/set-blocking' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.set-blocking.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: signal-exit@3.0.2 (node_modules/watchpack/node_modules/fsevents/node_modules/signal-exit): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/signal-exit' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.signal-exit.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: strip-json-comments@2.0.1 (node_modules/watchpack/node_modules/fsevents/node_modules/strip-json-comments): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/strip-json-comments' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.strip-json-comments.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: util-deprecate@1.0.2 (node_modules/watchpack/node_modules/fsevents/node_modules/util-deprecate): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/util-deprecate' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.util-deprecate.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: wrappy@1.0.2 (node_modules/watchpack/node_modules/fsevents/node_modules/wrappy): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/wrappy' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.wrappy.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: yallist@3.1.1 (node_modules/watchpack/node_modules/fsevents/node_modules/yallist): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/yallist' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.yallist.DELETE' added 966 packages from 454 contributors and audited 6746 packages in 28.411s found 0 vulnerabilities npm WARN npm npm does not support Node.js v12.16.1 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11. npm WARN npm You can find the latest version at https://nodejs.org/ > @google-cloud/bigquery-storage@1.1.0 fix /tmpfs/src/git/autosynth/working_repo > gts fix && eslint samples --fix /tmpfs/src/git/autosynth/working_repo/samples/quickstart.js 27:24 error "avsc" is not found node/no-missing-require 31:29 error "@google-cloud/bigquery-storage" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/quickstart.js 21:26 error "chai" is not found node/no-missing-require ✖ 3 problems (3 errors, 0 warnings) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @google-cloud/bigquery-storage@1.1.0 fix: `gts fix && eslint samples --fix` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @google-cloud/bigquery-storage@1.1.0 fix script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /home/kbuilder/.npm/_logs/2020-03-22T12_01_43_693Z-debug.log 2020-03-22 05:01:46,516 synthtool > Wrote metadata to synth.metadata. ```
--- packages/google-cloud-bigquery-storage/.jsdoc.js | 2 +- .../google-cloud-bigquery-storage/src/index.ts | 2 +- .../src/v1beta1/big_query_storage_client.ts | 12 +++++++++--- .../src/v1beta1/index.ts | 2 +- .../google-cloud-bigquery-storage/synth.metadata | 16 ++++++++-------- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- .../system-test/install.ts | 2 +- .../test/gapic-big_query_storage-v1beta1.ts | 2 +- .../webpack.config.js | 2 +- 10 files changed, 25 insertions(+), 19 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/.jsdoc.js b/packages/google-cloud-bigquery-storage/.jsdoc.js index 30eccb20f81..e8a4b174718 100644 --- a/packages/google-cloud-bigquery-storage/.jsdoc.js +++ b/packages/google-cloud-bigquery-storage/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-storage/src/index.ts b/packages/google-cloud-bigquery-storage/src/index.ts index b8de7b5c834..8c0e36d5f0a 100644 --- a/packages/google-cloud-bigquery-storage/src/index.ts +++ b/packages/google-cloud-bigquery-storage/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index e85d0072dc2..febe76cd7fa 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -39,7 +39,12 @@ const version = require('../../../package.json').version; * @memberof v1beta1 */ export class BigQueryStorageClient { - private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; @@ -223,7 +228,8 @@ export class BigQueryStorageClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error | null | undefined) => () => { throw err; diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/index.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/index.ts index 7346292b381..9b3c5a12d86 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/index.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 4d0b0a1a89b..d99e302fbd4 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -1,20 +1,20 @@ { - "updateTime": "2020-03-05T23:02:10.150448Z", + "updateTime": "2020-03-22T12:01:46.515920Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f0b581b5bdf803e45201ecdb3688b60e381628a8", - "internalRef": "299181282", - "log": "f0b581b5bdf803e45201ecdb3688b60e381628a8\nfix: recommendationengine/v1beta1 update some comments\n\nPiperOrigin-RevId: 299181282\n\n10e9a0a833dc85ff8f05b2c67ebe5ac785fe04ff\nbuild: add generated BUILD file for Routes Preferred API\n\nPiperOrigin-RevId: 299164808\n\n86738c956a8238d7c77f729be78b0ed887a6c913\npublish v1p1beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299152383\n\n73d9f2ad4591de45c2e1f352bc99d70cbd2a6d95\npublish v1: update with absolute address in comments\n\nPiperOrigin-RevId: 299147194\n\nd2158f24cb77b0b0ccfe68af784c6a628705e3c6\npublish v1beta2: update with absolute address in comments\n\nPiperOrigin-RevId: 299147086\n\n7fca61292c11b4cd5b352cee1a50bf88819dd63b\npublish v1p2beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146903\n\n583b7321624736e2c490e328f4b1957335779295\npublish v1p3beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146674\n\n" + "sha": "0be7105dc52590fa9a24e784052298ae37ce53aa", + "internalRef": "302154871", + "log": "0be7105dc52590fa9a24e784052298ae37ce53aa\nAdd BUILD.bazel file to asset/v1p1beta1\n\nPiperOrigin-RevId: 302154871\n\n6c248fd13e8543f8d22cbf118d978301a9fbe2a8\nAdd missing resource annotations and additional_bindings to dialogflow v2 API.\n\nPiperOrigin-RevId: 302063117\n\n9a3a7f33be9eeacf7b3e98435816b7022d206bd7\nChange the service name from \"chromeos-moblab.googleapis.com\" to \"chromeosmoblab.googleapis.com\"\n\nPiperOrigin-RevId: 302060989\n\n98a339237577e3de26cb4921f75fb5c57cc7a19f\nfeat: devtools/build/v1 publish client library config annotations\n\n* add details field to some of the BuildEvents\n* add final_invocation_id and build_tool_exit_code fields to BuildStatus\n\nPiperOrigin-RevId: 302044087\n\ncfabc98c6bbbb22d1aeaf7612179c0be193b3a13\nfeat: home/graph/v1 publish client library config annotations & comment updates\n\nThis change includes adding the client library configuration annotations, updated proto comments, and some client library configuration files.\n\nPiperOrigin-RevId: 302042647\n\nc8c8c0bd15d082db9546253dbaad1087c7a9782c\nchore: use latest gapic-generator in bazel WORKSPACE.\nincluding the following commits from gapic-generator:\n- feat: take source protos in all sub-packages (#3144)\n\nPiperOrigin-RevId: 301843591\n\ne4daf5202ea31cb2cb6916fdbfa9d6bd771aeb4c\nAdd bazel file for v1 client lib generation\n\nPiperOrigin-RevId: 301802926\n\n275fbcce2c900278d487c33293a3c7e1fbcd3a34\nfeat: pubsub/v1 add an experimental filter field to Subscription\n\nPiperOrigin-RevId: 301661567\n\nf2b18cec51d27c999ad30011dba17f3965677e9c\nFix: UpdateBackupRequest.backup is a resource, not a resource reference - remove annotation.\n\nPiperOrigin-RevId: 301636171\n\n800384063ac93a0cac3a510d41726fa4b2cd4a83\nCloud Billing Budget API v1beta1\nModified api documentation to include warnings about the new filter field.\n\nPiperOrigin-RevId: 301634389\n\n0cc6c146b660db21f04056c3d58a4b752ee445e3\nCloud Billing Budget API v1alpha1\nModified api documentation to include warnings about the new filter field.\n\nPiperOrigin-RevId: 301630018\n\nff2ea00f69065585c3ac0993c8b582af3b6fc215\nFix: Add resource definition for a parent of InspectTemplate which was otherwise missing.\n\nPiperOrigin-RevId: 301623052\n\n55fa441c9daf03173910760191646399338f2b7c\nAdd proto definition for AccessLevel, AccessPolicy, and ServicePerimeter.\n\nPiperOrigin-RevId: 301620844\n\ne7b10591c5408a67cf14ffafa267556f3290e262\nCloud Bigtable Managed Backup service and message proto files.\n\nPiperOrigin-RevId: 301585144\n\nd8e226f702f8ddf92915128c9f4693b63fb8685d\nfeat: Add time-to-live in a queue for builds\n\nPiperOrigin-RevId: 301579876\n\n430375af011f8c7a5174884f0d0e539c6ffa7675\ndocs: add missing closing backtick\n\nPiperOrigin-RevId: 301538851\n\n0e9f1f60ded9ad1c2e725e37719112f5b487ab65\nbazel: Use latest release of gax_java\n\nPiperOrigin-RevId: 301480457\n\n5058c1c96d0ece7f5301a154cf5a07b2ad03a571\nUpdate GAPIC v2 with batching parameters for Logging API\n\nPiperOrigin-RevId: 301443847\n\n64ab9744073de81fec1b3a6a931befc8a90edf90\nFix: Introduce location-based organization/folder/billing-account resources\nChore: Update copyright years\n\nPiperOrigin-RevId: 301373760\n\n23d5f09e670ebb0c1b36214acf78704e2ecfc2ac\nUpdate field_behavior annotations in V1 and V2.\n\nPiperOrigin-RevId: 301337970\n\nb2cf37e7fd62383a811aa4d54d013ecae638851d\nData Catalog V1 API\n\nPiperOrigin-RevId: 301282503\n\n1976b9981e2900c8172b7d34b4220bdb18c5db42\nCloud DLP api update. Adds missing fields to Finding and adds support for hybrid jobs.\n\nPiperOrigin-RevId: 301205325\n\nae78682c05e864d71223ce22532219813b0245ac\nfix: several sample code blocks in comments are now properly indented for markdown\n\nPiperOrigin-RevId: 301185150\n\ndcd171d04bda5b67db13049320f97eca3ace3731\nPublish Media Translation API V1Beta1\n\nPiperOrigin-RevId: 301180096\n\nff1713453b0fbc5a7544a1ef6828c26ad21a370e\nAdd protos and BUILD rules for v1 API.\n\nPiperOrigin-RevId: 301179394\n\n8386761d09819b665b6a6e1e6d6ff884bc8ff781\nfeat: chromeos/modlab publish protos and config for Chrome OS Moblab API.\n\nPiperOrigin-RevId: 300843960\n\nb2e2bc62fab90e6829e62d3d189906d9b79899e4\nUpdates to GCS gRPC API spec:\n\n1. Changed GetIamPolicy and TestBucketIamPermissions to use wrapper messages around google.iam.v1 IAM requests messages, and added CommonRequestParams. This lets us support RequesterPays buckets.\n2. Added a metadata field to GetObjectMediaResponse, to support resuming an object media read safely (by extracting the generation of the object being read, and using it in the resumed read request).\n\nPiperOrigin-RevId: 300817706\n\n7fd916ce12335cc9e784bb9452a8602d00b2516c\nAdd deprecated_collections field for backward-compatiblity in PHP and monolith-generated Python and Ruby clients.\n\nGenerate TopicName class in Java which covers the functionality of both ProjectTopicName and DeletedTopicName. Introduce breaking changes to be fixed by synth.py.\n\nDelete default retry parameters.\n\nRetry codes defs can be deleted once # https://github.com/googleapis/gapic-generator/issues/3137 is fixed.\n\nPiperOrigin-RevId: 300813135\n\n047d3a8ac7f75383855df0166144f891d7af08d9\nfix!: google/rpc refactor ErrorInfo.type to ErrorInfo.reason and comment updates.\n\nPiperOrigin-RevId: 300773211\n\nfae4bb6d5aac52aabe5f0bb4396466c2304ea6f6\nAdding RetryPolicy to pubsub.proto\n\nPiperOrigin-RevId: 300769420\n\n7d569be2928dbd72b4e261bf9e468f23afd2b950\nAdding additional protocol buffer annotations to v3.\n\nPiperOrigin-RevId: 300718800\n\n13942d1a85a337515040a03c5108993087dc0e4f\nAdd logging protos for Recommender v1.\n\nPiperOrigin-RevId: 300689896\n\na1a573c3eecfe2c404892bfa61a32dd0c9fb22b6\nfix: change go package to use cloud.google.com/go/maps\n\nPiperOrigin-RevId: 300661825\n\nc6fbac11afa0c7ab2972d9df181493875c566f77\nfeat: publish documentai/v1beta2 protos\n\nPiperOrigin-RevId: 300656808\n\n5202a9e0d9903f49e900f20fe5c7f4e42dd6588f\nProtos for v1beta1 release of Cloud Security Center Settings API\n\nPiperOrigin-RevId: 300580858\n\n83518e18655d9d4ac044acbda063cc6ecdb63ef8\nAdds gapic.yaml file and BUILD.bazel file.\n\nPiperOrigin-RevId: 300554200\n\n836c196dc8ef8354bbfb5f30696bd3477e8db5e2\nRegenerate recommender v1beta1 gRPC ServiceConfig file for Insights methods.\n\nPiperOrigin-RevId: 300549302\n\n34a5450c591b6be3d6566f25ac31caa5211b2f3f\nIncreases the default timeout from 20s to 30s for MetricService\n\nPiperOrigin-RevId: 300474272\n\n5d8bffe87cd01ba390c32f1714230e5a95d5991d\nfeat: use the latest gapic-generator in WORKSPACE for bazel build.\n\nPiperOrigin-RevId: 300461878\n\nd631c651e3bcfac5d371e8560c27648f7b3e2364\nUpdated the GAPIC configs to include parameters for Backups APIs.\n\nPiperOrigin-RevId: 300443402\n\n678afc7055c1adea9b7b54519f3bdb228013f918\nAdding Game Servers v1beta API.\n\nPiperOrigin-RevId: 300433218\n\n80d2bd2c652a5e213302041b0620aff423132589\nEnable proto annotation and gapic v2 for talent API.\n\nPiperOrigin-RevId: 300393997\n\n85e454be7a353f7fe1bf2b0affb753305785b872\ndocs(google/maps/roads): remove mention of nonexported api\n\nPiperOrigin-RevId: 300367734\n\nbf839ae632e0f263a729569e44be4b38b1c85f9c\nAdding protocol buffer annotations and updated config info for v1 and v2.\n\nPiperOrigin-RevId: 300276913\n\n309b899ca18a4c604bce63882a161d44854da549\nPublish `Backup` APIs and protos.\n\nPiperOrigin-RevId: 300246038\n\neced64c3f122421350b4aca68a28e89121d20db8\nadd PHP client libraries\n\nPiperOrigin-RevId: 300193634\n\n7727af0e39df1ae9ad715895c8576d7b65cf6c6d\nfeat: use the latest gapic-generator and protoc-java-resource-name-plugin in googleapis/WORKSPACE.\n\nPiperOrigin-RevId: 300188410\n\n2a25aa351dd5b5fe14895266aff5824d90ce757b\nBreaking change: remove the ProjectOrTenant resource and its references.\n\nPiperOrigin-RevId: 300182152\n\na499dbb28546379415f51803505cfb6123477e71\nUpdate web risk v1 gapic config and BUILD file.\n\nPiperOrigin-RevId: 300152177\n\n52701da10fec2a5f9796e8d12518c0fe574488fe\nFix: apply appropriate namespace/package options for C#, PHP and Ruby.\n\nPiperOrigin-RevId: 300123508\n\n365c029b8cdb63f7751b92ab490f1976e616105c\nAdd CC targets to the kms protos.\n\nThese are needed by go/tink.\n\nPiperOrigin-RevId: 300038469\n\n4ba9aa8a4a1413b88dca5a8fa931824ee9c284e6\nExpose logo recognition API proto for GA.\n\nPiperOrigin-RevId: 299971671\n\n1c9fc2c9e03dadf15f16b1c4f570955bdcebe00e\nAdding ruby_package option to accessapproval.proto for the Ruby client libraries generation.\n\nPiperOrigin-RevId: 299955924\n\n1cc6f0a7bfb147e6f2ede911d9b01e7a9923b719\nbuild(google/maps/routes): generate api clients\n\nPiperOrigin-RevId: 299955905\n\n29a47c965aac79e3fe8e3314482ca0b5967680f0\nIncrease timeout to 1hr for method `dropRange` in bigtable/admin/v2, which is\nsynced with the timeout setting in gapic_yaml.\n\nPiperOrigin-RevId: 299917154\n\n8f631c4c70a60a9c7da3749511ee4ad432b62898\nbuild(google/maps/roads/v1op): move go to monorepo pattern\n\nPiperOrigin-RevId: 299885195\n\nd66816518844ebbf63504c9e8dfc7133921dd2cd\nbuild(google/maps/roads/v1op): Add bazel build files to generate clients.\n\nPiperOrigin-RevId: 299851148\n\naf7dff701fabe029672168649c62356cf1bb43d0\nAdd LogPlayerReports and LogImpressions to Playable Locations service\n\nPiperOrigin-RevId: 299724050\n\nb6927fca808f38df32a642c560082f5bf6538ced\nUpdate BigQuery Connection API v1beta1 proto: added credential to CloudSqlProperties.\n\nPiperOrigin-RevId: 299503150\n\n91e1fb5ef9829c0c7a64bfa5bde330e6ed594378\nchore: update protobuf (protoc) version to 3.11.2\n\nPiperOrigin-RevId: 299404145\n\n30e36b4bee6749c4799f4fc1a51cc8f058ba167d\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 299399890\n\nffbb493674099f265693872ae250711b2238090c\nfeat: cloudbuild/v1 add new fields and annotate OUTPUT_OUT fields.\n\nPiperOrigin-RevId: 299397780\n\nbc973a15818e00c19e121959832676e9b7607456\nbazel: Fix broken common dependency\n\nPiperOrigin-RevId: 299397431\n\n71094a343e3b962e744aa49eb9338219537474e4\nchore: bigtable/admin/v2 publish retry config\n\nPiperOrigin-RevId: 299391875\n\n8f488efd7bda33885cb674ddd023b3678c40bd82\nfeat: Migrate logging to GAPIC v2; release new features.\n\nIMPORTANT: This is a breaking change for client libraries\nin all languages.\n\nCommitter: @lukesneeringer, @jskeet\nPiperOrigin-RevId: 299370279\n\n007605bf9ad3a1fd775014ebefbf7f1e6b31ee71\nUpdate API for bigqueryreservation v1beta1.\n- Adds flex capacity commitment plan to CapacityCommitment.\n- Adds methods for getting and updating BiReservations.\n- Adds methods for updating/splitting/merging CapacityCommitments.\n\nPiperOrigin-RevId: 299368059\n\n" } }, { - "template": { - "name": "node_library", - "origin": "synthtool.gcp", - "version": "2020.2.4" + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "7e98e1609c91082f4eeb63b530c6468aefd18cfd" } } ], diff --git a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js index e1637d5246a..72dceac69f8 100644 --- a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts index f0ce2eb8a76..c0e08eebba4 100644 --- a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-storage/system-test/install.ts b/packages/google-cloud-bigquery-storage/system-test/install.ts index c9aa74ec221..c4d80e9c0c8 100644 --- a/packages/google-cloud-bigquery-storage/system-test/install.ts +++ b/packages/google-cloud-bigquery-storage/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-storage/test/gapic-big_query_storage-v1beta1.ts b/packages/google-cloud-bigquery-storage/test/gapic-big_query_storage-v1beta1.ts index 28001512c10..8bc4a193677 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic-big_query_storage-v1beta1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic-big_query_storage-v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-storage/webpack.config.js b/packages/google-cloud-bigquery-storage/webpack.config.js index ad9db41c80c..b4d07b13300 100644 --- a/packages/google-cloud-bigquery-storage/webpack.config.js +++ b/packages/google-cloud-bigquery-storage/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From de00be36acf4c949b8ac378f7cff5b1c5e7ab2ec Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 31 Mar 2020 13:44:19 -0700 Subject: [PATCH 021/182] feat!: drop node8 support (#39) BREAKING CHANGE: The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. --- .../.eslintrc.json | 3 + .../.eslintrc.yml | 15 - .../google-cloud-bigquery-storage/.prettierrc | 8 - .../.prettierrc.js | 17 + .../package.json | 24 +- .../samples/quickstart.js | 4 +- .../samples/test/quickstart.js | 2 +- .../src/index.ts | 2 - .../src/v1beta1/big_query_storage_client.ts | 272 +++--- .../synth.metadata | 20 +- .../system-test/fixtures/sample/src/index.js | 1 - .../test/gapic-big_query_storage-v1beta1.ts | 410 --------- .../test/gapic_big_query_storage_v1beta1.ts | 865 ++++++++++++++++++ .../webpack.config.js | 12 +- 14 files changed, 1068 insertions(+), 587 deletions(-) create mode 100644 packages/google-cloud-bigquery-storage/.eslintrc.json delete mode 100644 packages/google-cloud-bigquery-storage/.eslintrc.yml delete mode 100644 packages/google-cloud-bigquery-storage/.prettierrc create mode 100644 packages/google-cloud-bigquery-storage/.prettierrc.js delete mode 100644 packages/google-cloud-bigquery-storage/test/gapic-big_query_storage-v1beta1.ts create mode 100644 packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts diff --git a/packages/google-cloud-bigquery-storage/.eslintrc.json b/packages/google-cloud-bigquery-storage/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-bigquery-storage/.eslintrc.yml b/packages/google-cloud-bigquery-storage/.eslintrc.yml deleted file mode 100644 index 73eeec27612..00000000000 --- a/packages/google-cloud-bigquery-storage/.eslintrc.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -extends: - - 'eslint:recommended' - - 'plugin:node/recommended' - - prettier -plugins: - - node - - prettier -rules: - prettier/prettier: error - block-scoped-var: error - eqeqeq: error - no-warning-comments: warn - no-var: error - prefer-const: error diff --git a/packages/google-cloud-bigquery-storage/.prettierrc b/packages/google-cloud-bigquery-storage/.prettierrc deleted file mode 100644 index df6eac07446..00000000000 --- a/packages/google-cloud-bigquery-storage/.prettierrc +++ /dev/null @@ -1,8 +0,0 @@ ---- -bracketSpacing: false -printWidth: 80 -semi: true -singleQuote: true -tabWidth: 2 -trailingComma: es5 -useTabs: false diff --git a/packages/google-cloud-bigquery-storage/.prettierrc.js b/packages/google-cloud-bigquery-storage/.prettierrc.js new file mode 100644 index 00000000000..08cba3775be --- /dev/null +++ b/packages/google-cloud-bigquery-storage/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 396ffa7ec1c..930799f438a 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -26,31 +26,33 @@ "samples-test": "cd samples/ && npm link ../ && npm test && cd ../" }, "dependencies": { - "google-gax": "^1.14.1" + "google-gax": "^2.0.1" }, "devDependencies": { "@types/mocha": "^7.0.1", "@types/node": "^13.7.1", + "@types/sinon": "^7.5.2", "c8": "^7.1.0", - "gts": "^1.1.2", + "eslint": "^6.8.0", + "eslint-config-prettier": "^6.10.0", + "eslint-plugin-node": "^11.0.0", + "eslint-plugin-prettier": "^3.1.2", + "gts": "2.0.0-alpha.9", "jsdoc": "^3.6.3", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", "linkinator": "^2.0.1", "mocha": "^7.0.1", - "pack-n-play": "^1.0.0-2", "null-loader": "^3.0.0", + "pack-n-play": "^1.0.0-2", + "prettier": "^1.19.1", + "sinon": "^9.0.1", "ts-loader": "^6.2.1", - "typescript": "~3.7.5", + "typescript": "^3.8.3", "webpack": "^4.41.6", - "webpack-cli": "^3.3.11", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.10.0", - "eslint-plugin-node": "^11.0.0", - "eslint-plugin-prettier": "^3.1.2", - "prettier": "^1.19.1" + "webpack-cli": "^3.3.11" }, "engines": { - "node": ">=8.13.0" + "node": ">=10" } } diff --git a/packages/google-cloud-bigquery-storage/samples/quickstart.js b/packages/google-cloud-bigquery-storage/samples/quickstart.js index 43054d2ff0c..daf4263c433 100644 --- a/packages/google-cloud-bigquery-storage/samples/quickstart.js +++ b/packages/google-cloud-bigquery-storage/samples/quickstart.js @@ -116,7 +116,7 @@ async function main() { client .readRows(readRowsRequest) .on('error', console.error) - .on('data', function(data) { + .on('data', data => { try { const decodedData = avroType.decode( data.avroRows.serializedBinaryRows @@ -133,7 +133,7 @@ async function main() { console.log(error); } }) - .on('end', function() { + .on('end', () => { console.log( `Got ${names.size} unique names in states: ${Object.keys(states)}` ); diff --git a/packages/google-cloud-bigquery-storage/samples/test/quickstart.js b/packages/google-cloud-bigquery-storage/samples/test/quickstart.js index 44c15b1bfdb..926b12c4b6a 100644 --- a/packages/google-cloud-bigquery-storage/samples/test/quickstart.js +++ b/packages/google-cloud-bigquery-storage/samples/test/quickstart.js @@ -26,7 +26,7 @@ const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); describe('Quickstart', () => { it('quickstart should create a dataset', async () => { - const output = execSync(`node quickstart`); + const output = execSync('node quickstart'); assert.match(output, /unique names in states/); assert.match(output, /Last offset:/); }); diff --git a/packages/google-cloud-bigquery-storage/src/index.ts b/packages/google-cloud-bigquery-storage/src/index.ts index 8c0e36d5f0a..a3e89d46812 100644 --- a/packages/google-cloud-bigquery-storage/src/index.ts +++ b/packages/google-cloud-bigquery-storage/src/index.ts @@ -19,8 +19,6 @@ import * as v1beta1 from './v1beta1'; const BigQueryStorageClient = v1beta1.BigQueryStorageClient; export {v1beta1, BigQueryStorageClient}; -// For compatibility with JavaScript libraries we need to provide this default export: -// tslint:disable-next-line no-default-export export default {v1beta1, BigQueryStorageClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index febe76cd7fa..98cac03fa98 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -18,7 +18,7 @@ import * as gax from 'google-gax'; import { - APICallback, + GaxCall, Callback, CallOptions, Descriptors, @@ -26,7 +26,7 @@ import { } from 'google-gax'; import * as path from 'path'; -import * as protosTypes from '../../protos/protos'; +import * as protos from '../../protos/protos'; import * as gapicConfig from './big_query_storage_client_config.json'; const version = require('../../../package.json').version; @@ -39,14 +39,6 @@ const version = require('../../../package.json').version; * @memberof v1beta1 */ export class BigQueryStorageClient { - private _descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - private _innerApiCalls: {[name: string]: Function}; - private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; private _opts: ClientOptions; private _gaxModule: typeof gax | typeof gax.fallback; @@ -54,6 +46,14 @@ export class BigQueryStorageClient { 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}; bigQueryStorageStub?: Promise<{[name: string]: Function}>; /** @@ -145,13 +145,16 @@ export class BigQueryStorageClient { 'protos.json' ); this._protos = this._gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. - this._pathTemplates = { + this.pathTemplates = { readSessionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/sessions/{session}' ), @@ -162,7 +165,7 @@ export class BigQueryStorageClient { // Some of the methods on this service provide streaming responses. // Provide descriptors for these. - this._descriptors.stream = { + this.descriptors.stream = { readRows: new this._gaxModule.StreamDescriptor( gax.StreamType.SERVER_STREAMING ), @@ -179,7 +182,7 @@ export class BigQueryStorageClient { // Set up a dictionary of "inner API calls"; the core implementation // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. - this._innerApiCalls = {}; + this.innerApiCalls = {}; } /** @@ -206,7 +209,7 @@ export class BigQueryStorageClient { ? (this._protos as protobuf.Root).lookupService( 'google.cloud.bigquery.storage.v1beta1.BigQueryStorage' ) - : // tslint:disable-next-line no-any + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.bigquery.storage.v1beta1 .BigQueryStorage, this._opts @@ -221,9 +224,8 @@ export class BigQueryStorageClient { 'finalizeStream', 'splitReadStream', ]; - for (const methodName of bigQueryStorageStubMethods) { - const innerCallPromise = this.bigQueryStorageStub.then( + const callPromise = this.bigQueryStorageStub.then( stub => (...args: Array<{}>) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); @@ -237,20 +239,14 @@ export class BigQueryStorageClient { ); const apiCall = this._gaxModule.createApiCall( - innerCallPromise, + callPromise, this._defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.stream[methodName] || - this._descriptors.longrunning[methodName] + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); - this._innerApiCalls[methodName] = ( - argument: {}, - callOptions?: CallOptions, - callback?: APICallback - ) => { - return apiCall(argument, callOptions, callback); - }; + this.innerApiCalls[methodName] = apiCall; } return this.bigQueryStorageStub; @@ -311,26 +307,37 @@ export class BigQueryStorageClient { // -- Service calls -- // ------------------- createReadSession( - request: protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, + request: protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.bigquery.storage.v1beta1.IReadSession, + protos.google.cloud.bigquery.storage.v1beta1.IReadSession, ( - | protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest + | protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest | undefined ), {} | undefined ] >; createReadSession( - request: protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, + request: protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.bigquery.storage.v1beta1.IReadSession, - | protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest + protos.google.cloud.bigquery.storage.v1beta1.IReadSession, + | protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + createReadSession( + request: protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, + callback: Callback< + protos.google.cloud.bigquery.storage.v1beta1.IReadSession, + | protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -379,26 +386,28 @@ export class BigQueryStorageClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ createReadSession( - request: protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, + request: protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.bigquery.storage.v1beta1.IReadSession, - | protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest + protos.google.cloud.bigquery.storage.v1beta1.IReadSession, + | protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.bigquery.storage.v1beta1.IReadSession, - | protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest + protos.google.cloud.bigquery.storage.v1beta1.IReadSession, + | protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.bigquery.storage.v1beta1.IReadSession, + protos.google.cloud.bigquery.storage.v1beta1.IReadSession, ( - | protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest + | protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest | undefined ), {} | undefined @@ -422,29 +431,40 @@ export class BigQueryStorageClient { 'table_reference.dataset_id': request.tableReference!.datasetId || '', }); this.initialize(); - return this._innerApiCalls.createReadSession(request, options, callback); + return this.innerApiCalls.createReadSession(request, options, callback); } batchCreateReadSessionStreams( - request: protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, + request: protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, + protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, ( - | protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest + | protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest | undefined ), {} | undefined ] >; batchCreateReadSessionStreams( - request: protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, + request: protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, - | protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest + protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, + | protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + batchCreateReadSessionStreams( + request: protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, + callback: Callback< + protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, + | protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -468,26 +488,28 @@ export class BigQueryStorageClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ batchCreateReadSessionStreams( - request: protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, + request: protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, - | protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest + protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, + | protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, - | protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest + protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, + | protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, + protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, ( - | protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest + | protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest | undefined ), {} | undefined @@ -510,33 +532,44 @@ export class BigQueryStorageClient { 'session.name': request.session!.name || '', }); this.initialize(); - return this._innerApiCalls.batchCreateReadSessionStreams( + return this.innerApiCalls.batchCreateReadSessionStreams( request, options, callback ); } finalizeStream( - request: protosTypes.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, + request: protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.protobuf.IEmpty, + protos.google.protobuf.IEmpty, ( - | protosTypes.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest + | protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest | undefined ), {} | undefined ] >; finalizeStream( - request: protosTypes.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, + request: protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.protobuf.IEmpty, - | protosTypes.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + finalizeStream( + request: protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -566,26 +599,28 @@ export class BigQueryStorageClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ finalizeStream( - request: protosTypes.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, + request: protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.protobuf.IEmpty, - | protosTypes.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.protobuf.IEmpty, - | protosTypes.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.protobuf.IEmpty, + protos.google.protobuf.IEmpty, ( - | protosTypes.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest + | protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest | undefined ), {} | undefined @@ -608,29 +643,40 @@ export class BigQueryStorageClient { 'stream.name': request.stream!.name || '', }); this.initialize(); - return this._innerApiCalls.finalizeStream(request, options, callback); + return this.innerApiCalls.finalizeStream(request, options, callback); } splitReadStream( - request: protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, + request: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, + protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, ( - | protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest + | protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest | undefined ), {} | undefined ] >; splitReadStream( - request: protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, + request: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, - | protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest + protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, + | protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + splitReadStream( + request: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, + callback: Callback< + protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, + | protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -667,26 +713,28 @@ export class BigQueryStorageClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ splitReadStream( - request: protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, + request: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, - | protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest + protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, + | protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, - | protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest + protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, + | protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, + protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, ( - | protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest + | protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest | undefined ), {} | undefined @@ -709,7 +757,7 @@ export class BigQueryStorageClient { 'original_stream.name': request.originalStream!.name || '', }); this.initialize(); - return this._innerApiCalls.splitReadStream(request, options, callback); + return this.innerApiCalls.splitReadStream(request, options, callback); } /** @@ -735,7 +783,7 @@ export class BigQueryStorageClient { * An object stream which emits [ReadRowsResponse]{@link google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} on 'data' event. */ readRows( - request?: protosTypes.google.cloud.bigquery.storage.v1beta1.IReadRowsRequest, + request?: protos.google.cloud.bigquery.storage.v1beta1.IReadRowsRequest, options?: gax.CallOptions ): gax.CancellableStream { request = request || {}; @@ -748,7 +796,7 @@ export class BigQueryStorageClient { 'read_position.stream.name': request.readPosition!.stream!.name || '', }); this.initialize(); - return this._innerApiCalls.readRows(request, options); + return this.innerApiCalls.readRows(request, options); } // -------------------- @@ -764,10 +812,10 @@ export class BigQueryStorageClient { * @returns {string} Resource name string. */ readSessionPath(project: string, location: string, session: string) { - return this._pathTemplates.readSessionPathTemplate.render({ - project, - location, - session, + return this.pathTemplates.readSessionPathTemplate.render({ + project: project, + location: location, + session: session, }); } @@ -779,7 +827,7 @@ export class BigQueryStorageClient { * @returns {string} A string representing the project. */ matchProjectFromReadSessionName(readSessionName: string) { - return this._pathTemplates.readSessionPathTemplate.match(readSessionName) + return this.pathTemplates.readSessionPathTemplate.match(readSessionName) .project; } @@ -791,7 +839,7 @@ export class BigQueryStorageClient { * @returns {string} A string representing the location. */ matchLocationFromReadSessionName(readSessionName: string) { - return this._pathTemplates.readSessionPathTemplate.match(readSessionName) + return this.pathTemplates.readSessionPathTemplate.match(readSessionName) .location; } @@ -803,7 +851,7 @@ export class BigQueryStorageClient { * @returns {string} A string representing the session. */ matchSessionFromReadSessionName(readSessionName: string) { - return this._pathTemplates.readSessionPathTemplate.match(readSessionName) + return this.pathTemplates.readSessionPathTemplate.match(readSessionName) .session; } @@ -816,10 +864,10 @@ export class BigQueryStorageClient { * @returns {string} Resource name string. */ streamPath(project: string, location: string, stream: string) { - return this._pathTemplates.streamPathTemplate.render({ - project, - location, - stream, + return this.pathTemplates.streamPathTemplate.render({ + project: project, + location: location, + stream: stream, }); } @@ -831,7 +879,7 @@ export class BigQueryStorageClient { * @returns {string} A string representing the project. */ matchProjectFromStreamName(streamName: string) { - return this._pathTemplates.streamPathTemplate.match(streamName).project; + return this.pathTemplates.streamPathTemplate.match(streamName).project; } /** @@ -842,7 +890,7 @@ export class BigQueryStorageClient { * @returns {string} A string representing the location. */ matchLocationFromStreamName(streamName: string) { - return this._pathTemplates.streamPathTemplate.match(streamName).location; + return this.pathTemplates.streamPathTemplate.match(streamName).location; } /** @@ -853,7 +901,7 @@ export class BigQueryStorageClient { * @returns {string} A string representing the stream. */ matchStreamFromStreamName(streamName: string) { - return this._pathTemplates.streamPathTemplate.match(streamName).stream; + return this.pathTemplates.streamPathTemplate.match(streamName).stream; } /** diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index d99e302fbd4..9a6620a3300 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -1,23 +1,5 @@ { - "updateTime": "2020-03-22T12:01:46.515920Z", - "sources": [ - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "0be7105dc52590fa9a24e784052298ae37ce53aa", - "internalRef": "302154871", - "log": "0be7105dc52590fa9a24e784052298ae37ce53aa\nAdd BUILD.bazel file to asset/v1p1beta1\n\nPiperOrigin-RevId: 302154871\n\n6c248fd13e8543f8d22cbf118d978301a9fbe2a8\nAdd missing resource annotations and additional_bindings to dialogflow v2 API.\n\nPiperOrigin-RevId: 302063117\n\n9a3a7f33be9eeacf7b3e98435816b7022d206bd7\nChange the service name from \"chromeos-moblab.googleapis.com\" to \"chromeosmoblab.googleapis.com\"\n\nPiperOrigin-RevId: 302060989\n\n98a339237577e3de26cb4921f75fb5c57cc7a19f\nfeat: devtools/build/v1 publish client library config annotations\n\n* add details field to some of the BuildEvents\n* add final_invocation_id and build_tool_exit_code fields to BuildStatus\n\nPiperOrigin-RevId: 302044087\n\ncfabc98c6bbbb22d1aeaf7612179c0be193b3a13\nfeat: home/graph/v1 publish client library config annotations & comment updates\n\nThis change includes adding the client library configuration annotations, updated proto comments, and some client library configuration files.\n\nPiperOrigin-RevId: 302042647\n\nc8c8c0bd15d082db9546253dbaad1087c7a9782c\nchore: use latest gapic-generator in bazel WORKSPACE.\nincluding the following commits from gapic-generator:\n- feat: take source protos in all sub-packages (#3144)\n\nPiperOrigin-RevId: 301843591\n\ne4daf5202ea31cb2cb6916fdbfa9d6bd771aeb4c\nAdd bazel file for v1 client lib generation\n\nPiperOrigin-RevId: 301802926\n\n275fbcce2c900278d487c33293a3c7e1fbcd3a34\nfeat: pubsub/v1 add an experimental filter field to Subscription\n\nPiperOrigin-RevId: 301661567\n\nf2b18cec51d27c999ad30011dba17f3965677e9c\nFix: UpdateBackupRequest.backup is a resource, not a resource reference - remove annotation.\n\nPiperOrigin-RevId: 301636171\n\n800384063ac93a0cac3a510d41726fa4b2cd4a83\nCloud Billing Budget API v1beta1\nModified api documentation to include warnings about the new filter field.\n\nPiperOrigin-RevId: 301634389\n\n0cc6c146b660db21f04056c3d58a4b752ee445e3\nCloud Billing Budget API v1alpha1\nModified api documentation to include warnings about the new filter field.\n\nPiperOrigin-RevId: 301630018\n\nff2ea00f69065585c3ac0993c8b582af3b6fc215\nFix: Add resource definition for a parent of InspectTemplate which was otherwise missing.\n\nPiperOrigin-RevId: 301623052\n\n55fa441c9daf03173910760191646399338f2b7c\nAdd proto definition for AccessLevel, AccessPolicy, and ServicePerimeter.\n\nPiperOrigin-RevId: 301620844\n\ne7b10591c5408a67cf14ffafa267556f3290e262\nCloud Bigtable Managed Backup service and message proto files.\n\nPiperOrigin-RevId: 301585144\n\nd8e226f702f8ddf92915128c9f4693b63fb8685d\nfeat: Add time-to-live in a queue for builds\n\nPiperOrigin-RevId: 301579876\n\n430375af011f8c7a5174884f0d0e539c6ffa7675\ndocs: add missing closing backtick\n\nPiperOrigin-RevId: 301538851\n\n0e9f1f60ded9ad1c2e725e37719112f5b487ab65\nbazel: Use latest release of gax_java\n\nPiperOrigin-RevId: 301480457\n\n5058c1c96d0ece7f5301a154cf5a07b2ad03a571\nUpdate GAPIC v2 with batching parameters for Logging API\n\nPiperOrigin-RevId: 301443847\n\n64ab9744073de81fec1b3a6a931befc8a90edf90\nFix: Introduce location-based organization/folder/billing-account resources\nChore: Update copyright years\n\nPiperOrigin-RevId: 301373760\n\n23d5f09e670ebb0c1b36214acf78704e2ecfc2ac\nUpdate field_behavior annotations in V1 and V2.\n\nPiperOrigin-RevId: 301337970\n\nb2cf37e7fd62383a811aa4d54d013ecae638851d\nData Catalog V1 API\n\nPiperOrigin-RevId: 301282503\n\n1976b9981e2900c8172b7d34b4220bdb18c5db42\nCloud DLP api update. Adds missing fields to Finding and adds support for hybrid jobs.\n\nPiperOrigin-RevId: 301205325\n\nae78682c05e864d71223ce22532219813b0245ac\nfix: several sample code blocks in comments are now properly indented for markdown\n\nPiperOrigin-RevId: 301185150\n\ndcd171d04bda5b67db13049320f97eca3ace3731\nPublish Media Translation API V1Beta1\n\nPiperOrigin-RevId: 301180096\n\nff1713453b0fbc5a7544a1ef6828c26ad21a370e\nAdd protos and BUILD rules for v1 API.\n\nPiperOrigin-RevId: 301179394\n\n8386761d09819b665b6a6e1e6d6ff884bc8ff781\nfeat: chromeos/modlab publish protos and config for Chrome OS Moblab API.\n\nPiperOrigin-RevId: 300843960\n\nb2e2bc62fab90e6829e62d3d189906d9b79899e4\nUpdates to GCS gRPC API spec:\n\n1. Changed GetIamPolicy and TestBucketIamPermissions to use wrapper messages around google.iam.v1 IAM requests messages, and added CommonRequestParams. This lets us support RequesterPays buckets.\n2. Added a metadata field to GetObjectMediaResponse, to support resuming an object media read safely (by extracting the generation of the object being read, and using it in the resumed read request).\n\nPiperOrigin-RevId: 300817706\n\n7fd916ce12335cc9e784bb9452a8602d00b2516c\nAdd deprecated_collections field for backward-compatiblity in PHP and monolith-generated Python and Ruby clients.\n\nGenerate TopicName class in Java which covers the functionality of both ProjectTopicName and DeletedTopicName. Introduce breaking changes to be fixed by synth.py.\n\nDelete default retry parameters.\n\nRetry codes defs can be deleted once # https://github.com/googleapis/gapic-generator/issues/3137 is fixed.\n\nPiperOrigin-RevId: 300813135\n\n047d3a8ac7f75383855df0166144f891d7af08d9\nfix!: google/rpc refactor ErrorInfo.type to ErrorInfo.reason and comment updates.\n\nPiperOrigin-RevId: 300773211\n\nfae4bb6d5aac52aabe5f0bb4396466c2304ea6f6\nAdding RetryPolicy to pubsub.proto\n\nPiperOrigin-RevId: 300769420\n\n7d569be2928dbd72b4e261bf9e468f23afd2b950\nAdding additional protocol buffer annotations to v3.\n\nPiperOrigin-RevId: 300718800\n\n13942d1a85a337515040a03c5108993087dc0e4f\nAdd logging protos for Recommender v1.\n\nPiperOrigin-RevId: 300689896\n\na1a573c3eecfe2c404892bfa61a32dd0c9fb22b6\nfix: change go package to use cloud.google.com/go/maps\n\nPiperOrigin-RevId: 300661825\n\nc6fbac11afa0c7ab2972d9df181493875c566f77\nfeat: publish documentai/v1beta2 protos\n\nPiperOrigin-RevId: 300656808\n\n5202a9e0d9903f49e900f20fe5c7f4e42dd6588f\nProtos for v1beta1 release of Cloud Security Center Settings API\n\nPiperOrigin-RevId: 300580858\n\n83518e18655d9d4ac044acbda063cc6ecdb63ef8\nAdds gapic.yaml file and BUILD.bazel file.\n\nPiperOrigin-RevId: 300554200\n\n836c196dc8ef8354bbfb5f30696bd3477e8db5e2\nRegenerate recommender v1beta1 gRPC ServiceConfig file for Insights methods.\n\nPiperOrigin-RevId: 300549302\n\n34a5450c591b6be3d6566f25ac31caa5211b2f3f\nIncreases the default timeout from 20s to 30s for MetricService\n\nPiperOrigin-RevId: 300474272\n\n5d8bffe87cd01ba390c32f1714230e5a95d5991d\nfeat: use the latest gapic-generator in WORKSPACE for bazel build.\n\nPiperOrigin-RevId: 300461878\n\nd631c651e3bcfac5d371e8560c27648f7b3e2364\nUpdated the GAPIC configs to include parameters for Backups APIs.\n\nPiperOrigin-RevId: 300443402\n\n678afc7055c1adea9b7b54519f3bdb228013f918\nAdding Game Servers v1beta API.\n\nPiperOrigin-RevId: 300433218\n\n80d2bd2c652a5e213302041b0620aff423132589\nEnable proto annotation and gapic v2 for talent API.\n\nPiperOrigin-RevId: 300393997\n\n85e454be7a353f7fe1bf2b0affb753305785b872\ndocs(google/maps/roads): remove mention of nonexported api\n\nPiperOrigin-RevId: 300367734\n\nbf839ae632e0f263a729569e44be4b38b1c85f9c\nAdding protocol buffer annotations and updated config info for v1 and v2.\n\nPiperOrigin-RevId: 300276913\n\n309b899ca18a4c604bce63882a161d44854da549\nPublish `Backup` APIs and protos.\n\nPiperOrigin-RevId: 300246038\n\neced64c3f122421350b4aca68a28e89121d20db8\nadd PHP client libraries\n\nPiperOrigin-RevId: 300193634\n\n7727af0e39df1ae9ad715895c8576d7b65cf6c6d\nfeat: use the latest gapic-generator and protoc-java-resource-name-plugin in googleapis/WORKSPACE.\n\nPiperOrigin-RevId: 300188410\n\n2a25aa351dd5b5fe14895266aff5824d90ce757b\nBreaking change: remove the ProjectOrTenant resource and its references.\n\nPiperOrigin-RevId: 300182152\n\na499dbb28546379415f51803505cfb6123477e71\nUpdate web risk v1 gapic config and BUILD file.\n\nPiperOrigin-RevId: 300152177\n\n52701da10fec2a5f9796e8d12518c0fe574488fe\nFix: apply appropriate namespace/package options for C#, PHP and Ruby.\n\nPiperOrigin-RevId: 300123508\n\n365c029b8cdb63f7751b92ab490f1976e616105c\nAdd CC targets to the kms protos.\n\nThese are needed by go/tink.\n\nPiperOrigin-RevId: 300038469\n\n4ba9aa8a4a1413b88dca5a8fa931824ee9c284e6\nExpose logo recognition API proto for GA.\n\nPiperOrigin-RevId: 299971671\n\n1c9fc2c9e03dadf15f16b1c4f570955bdcebe00e\nAdding ruby_package option to accessapproval.proto for the Ruby client libraries generation.\n\nPiperOrigin-RevId: 299955924\n\n1cc6f0a7bfb147e6f2ede911d9b01e7a9923b719\nbuild(google/maps/routes): generate api clients\n\nPiperOrigin-RevId: 299955905\n\n29a47c965aac79e3fe8e3314482ca0b5967680f0\nIncrease timeout to 1hr for method `dropRange` in bigtable/admin/v2, which is\nsynced with the timeout setting in gapic_yaml.\n\nPiperOrigin-RevId: 299917154\n\n8f631c4c70a60a9c7da3749511ee4ad432b62898\nbuild(google/maps/roads/v1op): move go to monorepo pattern\n\nPiperOrigin-RevId: 299885195\n\nd66816518844ebbf63504c9e8dfc7133921dd2cd\nbuild(google/maps/roads/v1op): Add bazel build files to generate clients.\n\nPiperOrigin-RevId: 299851148\n\naf7dff701fabe029672168649c62356cf1bb43d0\nAdd LogPlayerReports and LogImpressions to Playable Locations service\n\nPiperOrigin-RevId: 299724050\n\nb6927fca808f38df32a642c560082f5bf6538ced\nUpdate BigQuery Connection API v1beta1 proto: added credential to CloudSqlProperties.\n\nPiperOrigin-RevId: 299503150\n\n91e1fb5ef9829c0c7a64bfa5bde330e6ed594378\nchore: update protobuf (protoc) version to 3.11.2\n\nPiperOrigin-RevId: 299404145\n\n30e36b4bee6749c4799f4fc1a51cc8f058ba167d\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 299399890\n\nffbb493674099f265693872ae250711b2238090c\nfeat: cloudbuild/v1 add new fields and annotate OUTPUT_OUT fields.\n\nPiperOrigin-RevId: 299397780\n\nbc973a15818e00c19e121959832676e9b7607456\nbazel: Fix broken common dependency\n\nPiperOrigin-RevId: 299397431\n\n71094a343e3b962e744aa49eb9338219537474e4\nchore: bigtable/admin/v2 publish retry config\n\nPiperOrigin-RevId: 299391875\n\n8f488efd7bda33885cb674ddd023b3678c40bd82\nfeat: Migrate logging to GAPIC v2; release new features.\n\nIMPORTANT: This is a breaking change for client libraries\nin all languages.\n\nCommitter: @lukesneeringer, @jskeet\nPiperOrigin-RevId: 299370279\n\n007605bf9ad3a1fd775014ebefbf7f1e6b31ee71\nUpdate API for bigqueryreservation v1beta1.\n- Adds flex capacity commitment plan to CapacityCommitment.\n- Adds methods for getting and updating BiReservations.\n- Adds methods for updating/splitting/merging CapacityCommitments.\n\nPiperOrigin-RevId: 299368059\n\n" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "7e98e1609c91082f4eeb63b530c6468aefd18cfd" - } - } - ], + "updateTime": "2020-03-31T19:15:42.799551Z", "destinations": [ { "client": { diff --git a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js index 72dceac69f8..1f6ab3784e4 100644 --- a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js @@ -16,7 +16,6 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** - /* eslint-disable node/no-missing-require, no-unused-vars */ const storage = require('@google-cloud/bigquery-storage'); diff --git a/packages/google-cloud-bigquery-storage/test/gapic-big_query_storage-v1beta1.ts b/packages/google-cloud-bigquery-storage/test/gapic-big_query_storage-v1beta1.ts deleted file mode 100644 index 8bc4a193677..00000000000 --- a/packages/google-cloud-bigquery-storage/test/gapic-big_query_storage-v1beta1.ts +++ /dev/null @@ -1,410 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protosTypes from '../protos/protos'; -import * as assert from 'assert'; -import {describe, it} from 'mocha'; -const bigquerystorageModule = require('../src'); - -import {PassThrough} from 'stream'; - -const FAKE_STATUS_CODE = 1; -class FakeError { - name: string; - message: string; - code: number; - constructor(n: number) { - this.name = 'fakeName'; - this.message = 'fake message'; - this.code = n; - } -} -const error = new FakeError(FAKE_STATUS_CODE); -export interface Callback { - (err: FakeError | null, response?: {} | null): void; -} - -export class Operation { - constructor() {} - promise() {} -} -function mockSimpleGrpcMethod( - expectedRequest: {}, - response: {} | null, - error: FakeError | null -) { - return (actualRequest: {}, options: {}, callback: Callback) => { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} -function mockServerStreamingGrpcMethod( - expectedRequest: {}, - response: {} | null, - error: FakeError | null -) { - return (actualRequest: {}) => { - assert.deepStrictEqual(actualRequest, expectedRequest); - const mockStream = new PassThrough({ - objectMode: true, - transform: (chunk: {}, enc: {}, callback: Callback) => { - if (error) { - callback(error); - } else { - callback(null, response); - } - }, - }); - return mockStream; - }; -} -describe('v1beta1.BigQueryStorageClient', () => { - it('has servicePath', () => { - const servicePath = - bigquerystorageModule.v1beta1.BigQueryStorageClient.servicePath; - assert(servicePath); - }); - it('has apiEndpoint', () => { - const apiEndpoint = - bigquerystorageModule.v1beta1.BigQueryStorageClient.apiEndpoint; - assert(apiEndpoint); - }); - it('has port', () => { - const port = bigquerystorageModule.v1beta1.BigQueryStorageClient.port; - assert(port); - assert(typeof port === 'number'); - }); - it('should create a client with no option', () => { - const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient(); - assert(client); - }); - it('should create a client with gRPC fallback', () => { - const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ - fallback: true, - }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.bigQueryStorageStub, undefined); - await client.initialize(); - assert(client.bigQueryStorageStub); - }); - it('has close method', () => { - const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.close(); - }); - describe('createReadSession', () => { - it('invokes createReadSession without error', done => { - const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest = {}; - request.tableReference = {}; - request.tableReference.projectId = ''; - request.tableReference = {}; - request.tableReference.datasetId = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createReadSession = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.createReadSession(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createReadSession with error', done => { - const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest = {}; - request.tableReference = {}; - request.tableReference.projectId = ''; - request.tableReference = {}; - request.tableReference.datasetId = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createReadSession = mockSimpleGrpcMethod( - request, - null, - error - ); - client.createReadSession(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('batchCreateReadSessionStreams', () => { - it('invokes batchCreateReadSessionStreams without error', done => { - const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest = {}; - request.session = {}; - request.session.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.batchCreateReadSessionStreams = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.batchCreateReadSessionStreams(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes batchCreateReadSessionStreams with error', done => { - const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest = {}; - request.session = {}; - request.session.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.batchCreateReadSessionStreams = mockSimpleGrpcMethod( - request, - null, - error - ); - client.batchCreateReadSessionStreams( - request, - (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - } - ); - }); - }); - describe('finalizeStream', () => { - it('invokes finalizeStream without error', done => { - const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest = {}; - request.stream = {}; - request.stream.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.finalizeStream = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.finalizeStream(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes finalizeStream with error', done => { - const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest = {}; - request.stream = {}; - request.stream.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.finalizeStream = mockSimpleGrpcMethod( - request, - null, - error - ); - client.finalizeStream(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('splitReadStream', () => { - it('invokes splitReadStream without error', done => { - const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest = {}; - request.originalStream = {}; - request.originalStream.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.splitReadStream = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.splitReadStream(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes splitReadStream with error', done => { - const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest = {}; - request.originalStream = {}; - request.originalStream.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.splitReadStream = mockSimpleGrpcMethod( - request, - null, - error - ); - client.splitReadStream(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('readRows', () => { - it('invokes readRows without error', done => { - const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.bigquery.storage.v1beta1.IReadRowsRequest = {}; - request.readPosition = {}; - request.readPosition.stream = {}; - request.readPosition.stream.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.readRows = mockServerStreamingGrpcMethod( - request, - expectedResponse, - null - ); - const stream = client.readRows(request); - stream.on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - stream.on('error', (err: FakeError) => { - done(err); - }); - stream.write(); - }); - it('invokes readRows with error', done => { - const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.bigquery.storage.v1beta1.IReadRowsRequest = {}; - request.readPosition = {}; - request.readPosition.stream = {}; - request.readPosition.stream.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.readRows = mockServerStreamingGrpcMethod( - request, - null, - error - ); - const stream = client.readRows(request); - stream.on('data', () => { - assert.fail(); - }); - stream.on('error', (err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - stream.write(); - }); - }); -}); diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts new file mode 100644 index 00000000000..47eca9a12c9 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts @@ -0,0 +1,865 @@ +// 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 bigquerystorageModule 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 stubServerStreamingCall( + response?: ResponseType, + error?: Error +) { + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // write something to the stream to trigger transformStub and send the response back to the client + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + return sinon.stub().returns(mockStream); +} + +describe('v1beta1.BigQueryStorageClient', () => { + it('has servicePath', () => { + const servicePath = + bigquerystorageModule.v1beta1.BigQueryStorageClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + bigquerystorageModule.v1beta1.BigQueryStorageClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = bigquerystorageModule.v1beta1.BigQueryStorageClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.bigQueryStorageStub, undefined); + await client.initialize(); + assert(client.bigQueryStorageStub); + }); + + it('has close method', () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + 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 bigquerystorageModule.v1beta1.BigQueryStorageClient({ + 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('createReadSession', () => { + it('invokes createReadSession without error', async () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest() + ); + request.tableReference = {}; + request.tableReference.projectId = ''; + request.tableReference = {}; + request.tableReference.datasetId = ''; + const expectedHeaderRequestParams = + 'table_reference.project_id=&table_reference.dataset_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.ReadSession() + ); + client.innerApiCalls.createReadSession = stubSimpleCall(expectedResponse); + const [response] = await client.createReadSession(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createReadSession as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createReadSession without error using callback', async () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest() + ); + request.tableReference = {}; + request.tableReference.projectId = ''; + request.tableReference = {}; + request.tableReference.datasetId = ''; + const expectedHeaderRequestParams = + 'table_reference.project_id=&table_reference.dataset_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.ReadSession() + ); + client.innerApiCalls.createReadSession = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createReadSession( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.storage.v1beta1.IReadSession | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createReadSession as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createReadSession with error', async () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest() + ); + request.tableReference = {}; + request.tableReference.projectId = ''; + request.tableReference = {}; + request.tableReference.datasetId = ''; + const expectedHeaderRequestParams = + 'table_reference.project_id=&table_reference.dataset_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createReadSession = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.createReadSession(request); + }, expectedError); + assert( + (client.innerApiCalls.createReadSession as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('batchCreateReadSessionStreams', () => { + it('invokes batchCreateReadSessionStreams without error', async () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest() + ); + request.session = {}; + request.session.name = ''; + const expectedHeaderRequestParams = 'session.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse() + ); + client.innerApiCalls.batchCreateReadSessionStreams = stubSimpleCall( + expectedResponse + ); + const [response] = await client.batchCreateReadSessionStreams(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchCreateReadSessionStreams as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes batchCreateReadSessionStreams without error using callback', async () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest() + ); + request.session = {}; + request.session.name = ''; + const expectedHeaderRequestParams = 'session.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse() + ); + client.innerApiCalls.batchCreateReadSessionStreams = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.batchCreateReadSessionStreams( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchCreateReadSessionStreams as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes batchCreateReadSessionStreams with error', async () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest() + ); + request.session = {}; + request.session.name = ''; + const expectedHeaderRequestParams = 'session.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateReadSessionStreams = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.batchCreateReadSessionStreams(request); + }, expectedError); + assert( + (client.innerApiCalls.batchCreateReadSessionStreams as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('finalizeStream', () => { + it('invokes finalizeStream without error', async () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest() + ); + request.stream = {}; + request.stream.name = ''; + const expectedHeaderRequestParams = 'stream.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.finalizeStream = stubSimpleCall(expectedResponse); + const [response] = await client.finalizeStream(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.finalizeStream as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes finalizeStream without error using callback', async () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest() + ); + request.stream = {}; + request.stream.name = ''; + const expectedHeaderRequestParams = 'stream.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.finalizeStream = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.finalizeStream( + 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.finalizeStream as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes finalizeStream with error', async () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest() + ); + request.stream = {}; + request.stream.name = ''; + const expectedHeaderRequestParams = 'stream.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.finalizeStream = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.finalizeStream(request); + }, expectedError); + assert( + (client.innerApiCalls.finalizeStream as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('splitReadStream', () => { + it('invokes splitReadStream without error', async () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest() + ); + request.originalStream = {}; + request.originalStream.name = ''; + const expectedHeaderRequestParams = 'original_stream.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse() + ); + client.innerApiCalls.splitReadStream = stubSimpleCall(expectedResponse); + const [response] = await client.splitReadStream(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.splitReadStream as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes splitReadStream without error using callback', async () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest() + ); + request.originalStream = {}; + request.originalStream.name = ''; + const expectedHeaderRequestParams = 'original_stream.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse() + ); + client.innerApiCalls.splitReadStream = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.splitReadStream( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.splitReadStream as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes splitReadStream with error', async () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest() + ); + request.originalStream = {}; + request.originalStream.name = ''; + const expectedHeaderRequestParams = 'original_stream.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.splitReadStream = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.splitReadStream(request); + }, expectedError); + assert( + (client.innerApiCalls.splitReadStream as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('readRows', () => { + it('invokes readRows without error', async () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest() + ); + request.readPosition = {}; + request.readPosition.stream = {}; + request.readPosition.stream.name = ''; + const expectedHeaderRequestParams = 'read_position.stream.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.ReadRowsResponse() + ); + client.innerApiCalls.readRows = stubServerStreamingCall(expectedResponse); + const stream = client.readRows(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.readRows as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions) + ); + }); + + it('invokes readRows with error', async () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest() + ); + request.readPosition = {}; + request.readPosition.stream = {}; + request.readPosition.stream.name = ''; + const expectedHeaderRequestParams = 'read_position.stream.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.readRows = stubServerStreamingCall( + undefined, + expectedError + ); + const stream = client.readRows(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.innerApiCalls.readRows as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions) + ); + }); + }); + + describe('Path templates', () => { + describe('readSession', () => { + const fakePath = '/rendered/path/readSession'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + }; + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.readSessionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.readSessionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('readSessionPath', () => { + const result = client.readSessionPath( + 'projectValue', + 'locationValue', + 'sessionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.readSessionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReadSessionName', () => { + const result = client.matchProjectFromReadSessionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.readSessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReadSessionName', () => { + const result = client.matchLocationFromReadSessionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.readSessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromReadSessionName', () => { + const result = client.matchSessionFromReadSessionName(fakePath); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.readSessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('stream', () => { + const fakePath = '/rendered/path/stream'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + stream: 'streamValue', + }; + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.streamPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.streamPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('streamPath', () => { + const result = client.streamPath( + 'projectValue', + 'locationValue', + 'streamValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.streamPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromStreamName', () => { + const result = client.matchProjectFromStreamName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.streamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromStreamName', () => { + const result = client.matchLocationFromStreamName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.streamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchStreamFromStreamName', () => { + const result = client.matchStreamFromStreamName(fakePath); + assert.strictEqual(result, 'streamValue'); + assert( + (client.pathTemplates.streamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-bigquery-storage/webpack.config.js b/packages/google-cloud-bigquery-storage/webpack.config.js index b4d07b13300..683c6ec0233 100644 --- a/packages/google-cloud-bigquery-storage/webpack.config.js +++ b/packages/google-cloud-bigquery-storage/webpack.config.js @@ -36,27 +36,27 @@ module.exports = { { test: /\.tsx?$/, use: 'ts-loader', - exclude: /node_modules/ + exclude: /node_modules/, }, { test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]grpc/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]retry-request/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]gtoken/, - use: 'null-loader' + use: 'null-loader', }, ], }, From 2adbcb7dbe485c3671c5dff74eb64ab2f4e5ec3c Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 31 Mar 2020 18:41:38 -0700 Subject: [PATCH 022/182] build: set AUTOSYNTH_MULTIPLE_COMMITS=true for context aware commits (#41) --- packages/google-cloud-bigquery-storage/synth.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/google-cloud-bigquery-storage/synth.py b/packages/google-cloud-bigquery-storage/synth.py index ec0cb3d4f47..564adc79dcb 100644 --- a/packages/google-cloud-bigquery-storage/synth.py +++ b/packages/google-cloud-bigquery-storage/synth.py @@ -17,6 +17,9 @@ import subprocess import logging logging.basicConfig(level=logging.DEBUG) + +AUTOSYNTH_MULTIPLE_COMMITS = True + # Run the gapic generator gapic = gcp.GAPICMicrogenerator() name = 'bigquerystorage' From 1bf9895e1b3e6f6c83f364a41ceb0aa1d25fb8ae Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 1 Apr 2020 23:39:05 +0200 Subject: [PATCH 023/182] chore(deps): update dependency @types/sinon to v9 (#42) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@types/sinon](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | devDependencies | major | [`^7.5.2` -> `^9.0.0`](https://renovatebot.com/diffs/npm/@types%2fsinon/7.5.2/9.0.0) | --- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-bigquery-storage). --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 930799f438a..d3919de0baf 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -31,7 +31,7 @@ "devDependencies": { "@types/mocha": "^7.0.1", "@types/node": "^13.7.1", - "@types/sinon": "^7.5.2", + "@types/sinon": "^9.0.0", "c8": "^7.1.0", "eslint": "^6.8.0", "eslint-config-prettier": "^6.10.0", From 72a394a8ef14b37fea88e0521e75bcad7e1cfbd7 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 2 Apr 2020 13:00:43 -0700 Subject: [PATCH 024/182] chore: linting (#44) --- .../google-cloud-bigquery-storage/README.md | 4 ++-- .../src/v1beta1/big_query_storage_client.ts | 8 +------- .../synth.metadata | 19 ++++++++++++++++++- .../system-test/fixtures/sample/src/index.ts | 2 +- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/README.md b/packages/google-cloud-bigquery-storage/README.md index 40069706e54..cbd319b1dc1 100644 --- a/packages/google-cloud-bigquery-storage/README.md +++ b/packages/google-cloud-bigquery-storage/README.md @@ -151,7 +151,7 @@ async function bigqueryStorageQuickstart() { client .readRows(readRowsRequest) .on('error', console.error) - .on('data', function(data) { + .on('data', data => { try { const decodedData = avroType.decode( data.avroRows.serializedBinaryRows @@ -168,7 +168,7 @@ async function bigqueryStorageQuickstart() { console.log(error); } }) - .on('end', function() { + .on('end', () => { console.log( `Got ${names.size} unique names in states: ${Object.keys(states)}` ); diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index 98cac03fa98..89d815f9e06 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -17,13 +17,7 @@ // ** All changes to this file may be overwritten. ** import * as gax from 'google-gax'; -import { - GaxCall, - Callback, - CallOptions, - Descriptors, - ClientOptions, -} from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; import * as path from 'path'; import * as protos from '../../protos/protos'; diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 9a6620a3300..2c96de14d13 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -1,5 +1,22 @@ { - "updateTime": "2020-03-31T19:15:42.799551Z", + "updateTime": "2020-04-02T12:08:46.500507Z", + "sources": [ + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "75047719f704d61f405cac6d7439637ab36c1232", + "internalRef": "304305096" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "99820243d348191bc9c634f2b48ddf65096285ed" + } + } + ], "destinations": [ { "client": { diff --git a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts index c0e08eebba4..d53a99905ac 100644 --- a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts @@ -19,7 +19,7 @@ import {BigQueryStorageClient} from '@google-cloud/bigquery-storage'; function main() { - const bigQueryStorageClient = new BigQueryStorageClient(); + new BigQueryStorageClient(); } main(); From f0a298878e425bcead366344f3a8d08baab4f203 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sun, 5 Apr 2020 12:51:03 -0700 Subject: [PATCH 025/182] chore: remove duplicate mocha config (#46) --- packages/google-cloud-bigquery-storage/.mocharc.json | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 packages/google-cloud-bigquery-storage/.mocharc.json diff --git a/packages/google-cloud-bigquery-storage/.mocharc.json b/packages/google-cloud-bigquery-storage/.mocharc.json deleted file mode 100644 index 670c5e2c24b..00000000000 --- a/packages/google-cloud-bigquery-storage/.mocharc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} From 4221b527ea67306494d81ab7bf9816e8be8c0cab Mon Sep 17 00:00:00 2001 From: Steffany Brown <30247553+steffnay@users.noreply.github.com> Date: Mon, 6 Apr 2020 22:47:41 -0700 Subject: [PATCH 026/182] feat: add V1 client (#28) * feat: generate v1 * chore: update exports and excludes * style: linted * chore: updates exports * chore: linted Co-authored-by: Benjamin E. Coe --- .../cloud/bigquery/storage/v1/arrow.proto | 45 + .../cloud/bigquery/storage/v1/avro.proto | 41 + .../cloud/bigquery/storage/v1/storage.proto | 236 + .../cloud/bigquery/storage/v1/stream.proto | 137 + .../protos/protos.d.ts | 1676 +++++++ .../protos/protos.js | 3889 +++++++++++++++++ .../protos/protos.json | 342 ++ .../samples/quickstart.js | 5 +- .../samples/test/quickstart.js | 2 +- .../src/index.ts | 8 +- .../src/v1/big_query_read_client.ts | 698 +++ .../src/v1/big_query_read_client_config.json | 44 + .../src/v1/big_query_read_proto_list.json | 6 + .../src/v1/index.ts | 19 + .../src/v1beta1/big_query_storage_client.ts | 12 +- .../synth.metadata | 24 +- .../google-cloud-bigquery-storage/synth.py | 4 +- .../system-test/fixtures/sample/src/index.js | 4 +- .../system-test/fixtures/sample/src/index.ts | 5 +- .../test/gapic-big_query_read-v1.ts | 288 ++ .../webpack.config.js | 4 +- 21 files changed, 7462 insertions(+), 27 deletions(-) create mode 100644 packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/arrow.proto create mode 100644 packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/avro.proto create mode 100644 packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto create mode 100644 packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto create mode 100644 packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts create mode 100644 packages/google-cloud-bigquery-storage/src/v1/big_query_read_client_config.json create mode 100644 packages/google-cloud-bigquery-storage/src/v1/big_query_read_proto_list.json create mode 100644 packages/google-cloud-bigquery-storage/src/v1/index.ts create mode 100644 packages/google-cloud-bigquery-storage/test/gapic-big_query_read-v1.ts diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/arrow.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/arrow.proto new file mode 100644 index 00000000000..90add9780e1 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/arrow.proto @@ -0,0 +1,45 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.bigquery.storage.v1; + +option csharp_namespace = "Google.Cloud.BigQuery.Storage.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1;storage"; +option java_multiple_files = true; +option java_outer_classname = "ArrowProto"; +option java_package = "com.google.cloud.bigquery.storage.v1"; +option php_namespace = "Google\\Cloud\\BigQuery\\Storage\\V1"; + +// Arrow schema as specified in +// https://arrow.apache.org/docs/python/api/datatypes.html +// and serialized to bytes using IPC: +// https://arrow.apache.org/docs/ipc.html. +// +// See code samples on how this message can be deserialized. +message ArrowSchema { + // IPC serialized Arrow schema. + bytes serialized_schema = 1; +} + +// Arrow RecordBatch. +message ArrowRecordBatch { + // IPC-serialized Arrow RecordBatch. + bytes serialized_record_batch = 1; + + // The count of rows in `serialized_record_batch`. + int64 row_count = 2; +} diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/avro.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/avro.proto new file mode 100644 index 00000000000..9a064447b9f --- /dev/null +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/avro.proto @@ -0,0 +1,41 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.bigquery.storage.v1; + +option csharp_namespace = "Google.Cloud.BigQuery.Storage.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1;storage"; +option java_multiple_files = true; +option java_outer_classname = "AvroProto"; +option java_package = "com.google.cloud.bigquery.storage.v1"; +option php_namespace = "Google\\Cloud\\BigQuery\\Storage\\V1"; + +// Avro schema. +message AvroSchema { + // Json serialized schema, as described at + // https://avro.apache.org/docs/1.8.1/spec.html. + string schema = 1; +} + +// Avro rows. +message AvroRows { + // Binary serialized rows in a block. + bytes serialized_binary_rows = 1; + + // The count of rows in the returning block. + int64 row_count = 2; +} diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto new file mode 100644 index 00000000000..26fcd6ac25c --- /dev/null +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto @@ -0,0 +1,236 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.bigquery.storage.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/bigquery/storage/v1/arrow.proto"; +import "google/cloud/bigquery/storage/v1/avro.proto"; +import "google/cloud/bigquery/storage/v1/stream.proto"; + +option csharp_namespace = "Google.Cloud.BigQuery.Storage.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1;storage"; +option java_multiple_files = true; +option java_outer_classname = "StorageProto"; +option java_package = "com.google.cloud.bigquery.storage.v1"; +option php_namespace = "Google\\Cloud\\BigQuery\\Storage\\V1"; +option (google.api.resource_definition) = { + type: "bigquery.googleapis.com/Table" + pattern: "projects/{project}/datasets/{dataset}/tables/{table}" +}; + +// BigQuery Read API. +// +// The Read API can be used to read data from BigQuery. +service BigQueryRead { + option (google.api.default_host) = "bigquerystorage.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigquery," + "https://www.googleapis.com/auth/bigquery.readonly," + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a new read session. A read session divides the contents of a + // BigQuery table into one or more streams, which can then be used to read + // data from the table. The read session also specifies properties of the + // data to be read, such as a list of columns or a push-down filter describing + // the rows to be returned. + // + // A particular row can be read by at most one stream. When the caller has + // reached the end of each stream in the session, then all the data in the + // table has been read. + // + // Data is assigned to each stream such that roughly the same number of + // rows can be read from each stream. Because the server-side unit for + // assigning data is collections of rows, the API does not guarantee that + // each stream will return the same number or rows. Additionally, the + // limits are enforced based on the number of pre-filtered rows, so some + // filters can lead to lopsided assignments. + // + // Read sessions automatically expire 24 hours after they are created and do + // not require manual clean-up by the caller. + rpc CreateReadSession(CreateReadSessionRequest) returns (ReadSession) { + option (google.api.http) = { + post: "/v1/{read_session.table=projects/*/datasets/*/tables/*}" + body: "*" + }; + option (google.api.method_signature) = "parent,read_session,max_stream_count"; + } + + // Reads rows from the stream in the format prescribed by the ReadSession. + // Each response contains one or more table rows, up to a maximum of 100 MiB + // per response; read requests which attempt to read individual rows larger + // than 100 MiB will fail. + // + // Each request also returns a set of stream statistics reflecting the current + // state of the stream. + rpc ReadRows(ReadRowsRequest) returns (stream ReadRowsResponse) { + option (google.api.http) = { + get: "/v1/{read_stream=projects/*/locations/*/sessions/*/streams/*}" + }; + option (google.api.method_signature) = "read_stream,offset"; + } + + // Splits a given `ReadStream` into two `ReadStream` objects. These + // `ReadStream` objects are referred to as the primary and the residual + // streams of the split. The original `ReadStream` can still be read from in + // the same manner as before. Both of the returned `ReadStream` objects can + // also be read from, and the rows returned by both child streams will be + // the same as the rows read from the original stream. + // + // Moreover, the two child streams will be allocated back-to-back in the + // original `ReadStream`. Concretely, it is guaranteed that for streams + // original, primary, and residual, that original[0-j] = primary[0-j] and + // original[j-n] = residual[0-m] once the streams have been read to + // completion. + rpc SplitReadStream(SplitReadStreamRequest) returns (SplitReadStreamResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/sessions/*/streams/*}" + }; + } +} + +// Request message for `CreateReadSession`. +message CreateReadSessionRequest { + // Required. The request project that owns the session, in the form of + // `projects/{project_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. Session to be created. + ReadSession read_session = 2 [(google.api.field_behavior) = REQUIRED]; + + // Max initial number of streams. If unset or zero, the server will + // provide a value of streams so as to produce reasonable throughput. Must be + // non-negative. The number of streams may be lower than the requested number, + // depending on the amount parallelism that is reasonable for the table. Error + // will be returned if the max count is greater than the current system + // max limit of 1,000. + // + // Streams must be read starting from offset 0. + int32 max_stream_count = 3; +} + +// Request message for `ReadRows`. +message ReadRowsRequest { + // Required. Stream to read rows from. + string read_stream = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerystorage.googleapis.com/ReadStream" + } + ]; + + // The offset requested must be less than the last row read from Read. + // Requesting a larger offset is undefined. If not specified, start reading + // from offset zero. + int64 offset = 2; +} + +// Information on if the current connection is being throttled. +message ThrottleState { + // How much this connection is being throttled. Zero means no throttling, + // 100 means fully throttled. + int32 throttle_percent = 1; +} + +// Estimated stream statistics for a given Stream. +message StreamStats { + message Progress { + // The fraction of rows assigned to the stream that have been processed by + // the server so far, not including the rows in the current response + // message. + // + // This value, along with `at_response_end`, can be used to interpolate + // the progress made as the rows in the message are being processed using + // the following formula: `at_response_start + (at_response_end - + // at_response_start) * rows_processed_from_response / rows_in_response`. + // + // Note that if a filter is provided, the `at_response_end` value of the + // previous response may not necessarily be equal to the + // `at_response_start` value of the current response. + double at_response_start = 1; + + // Similar to `at_response_start`, except that this value includes the + // rows in the current response. + double at_response_end = 2; + } + + // Represents the progress of the current stream. + Progress progress = 2; +} + +// Response from calling `ReadRows` may include row data, progress and +// throttling information. +message ReadRowsResponse { + // Row data is returned in format specified during session creation. + oneof rows { + // Serialized row data in AVRO format. + AvroRows avro_rows = 3; + + // Serialized row data in Arrow RecordBatch format. + ArrowRecordBatch arrow_record_batch = 4; + } + + // Number of serialized rows in the rows block. + int64 row_count = 6; + + // Statistics for the stream. + StreamStats stats = 2; + + // Throttling state. If unset, the latest response still describes + // the current throttling status. + ThrottleState throttle_state = 5; +} + +// Request message for `SplitReadStream`. +message SplitReadStreamRequest { + // Required. Name of the stream to split. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerystorage.googleapis.com/ReadStream" + } + ]; + + // A value in the range (0.0, 1.0) that specifies the fractional point at + // which the original stream should be split. The actual split point is + // evaluated on pre-filtered rows, so if a filter is provided, then there is + // no guarantee that the division of the rows between the new child streams + // will be proportional to this fractional value. Additionally, because the + // server-side unit for assigning data is collections of rows, this fraction + // will always map to a data storage boundary on the server side. + double fraction = 2; +} + +// Response message for `SplitReadStream`. +message SplitReadStreamResponse { + // Primary stream, which contains the beginning portion of + // |original_stream|. An empty value indicates that the original stream can no + // longer be split. + ReadStream primary_stream = 1; + + // Remainder stream, which contains the tail of |original_stream|. An empty + // value indicates that the original stream can no longer be split. + ReadStream remainder_stream = 2; +} diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto new file mode 100644 index 00000000000..19d4231da5b --- /dev/null +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto @@ -0,0 +1,137 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.storage.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/bigquery/storage/v1/arrow.proto"; +import "google/cloud/bigquery/storage/v1/avro.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.BigQuery.Storage.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1;storage"; +option java_multiple_files = true; +option java_outer_classname = "StreamProto"; +option java_package = "com.google.cloud.bigquery.storage.v1"; +option php_namespace = "Google\\Cloud\\BigQuery\\Storage\\V1"; + +// Data format for input or output data. +enum DataFormat { + DATA_FORMAT_UNSPECIFIED = 0; + + // Avro is a standard open source row based file format. + // See https://avro.apache.org/ for more details. + AVRO = 1; + + // Arrow is a standard open source column-based message format. + // See https://arrow.apache.org/ for more details. + ARROW = 2; +} + +// Information about the ReadSession. +message ReadSession { + option (google.api.resource) = { + type: "bigquerystorage.googleapis.com/ReadSession" + pattern: "projects/{project}/locations/{location}/sessions/{session}" + }; + + // Additional attributes when reading a table. + message TableModifiers { + // The snapshot time of the table. If not set, interpreted as now. + google.protobuf.Timestamp snapshot_time = 1; + } + + // Options dictating how we read a table. + message TableReadOptions { + // Names of the fields in the table that should be read. If empty, all + // fields will be read. If the specified field is a nested field, all + // the sub-fields in the field will be selected. The output field order is + // unrelated to the order of fields in selected_fields. + repeated string selected_fields = 1; + + // SQL text filtering statement, similar to a WHERE clause in a query. + // Aggregates are not supported. + // + // Examples: "int_field > 5" + // "date_field = CAST('2014-9-27' as DATE)" + // "nullable_field is not NULL" + // "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))" + // "numeric_field BETWEEN 1.0 AND 5.0" + string row_restriction = 2; + } + + // Output only. Unique identifier for the session, in the form + // `projects/{project_id}/locations/{location}/sessions/{session_id}`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the session becomes invalid. After this time, subsequent + // requests to read this Session will return errors. The expire_time is + // automatically assigned and currently cannot be specified or updated. + google.protobuf.Timestamp expire_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. Data format of the output data. + DataFormat data_format = 3 [(google.api.field_behavior) = IMMUTABLE]; + + // The schema for the read. If read_options.selected_fields is set, the + // schema may be different from the table schema as it will only contain + // the selected fields. + oneof schema { + // Output only. Avro schema. + AvroSchema avro_schema = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Arrow schema. + ArrowSchema arrow_schema = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Immutable. Table that this ReadSession is reading from, in the form + // `projects/{project_id}/datasets/{dataset_id}/tables/{table_id} + string table = 6 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "bigquery.googleapis.com/Table" + } + ]; + + // Optional. Any modifiers which are applied when reading from the specified table. + TableModifiers table_modifiers = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Read options for this session (e.g. column selection, filters). + TableReadOptions read_options = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. A list of streams created with the session. + // + // At least one stream is created with the session. In the future, larger + // request_stream_count values *may* result in this list being unpopulated, + // in that case, the user will need to use a List method to get the streams + // instead, which is not yet available. + repeated ReadStream streams = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Information about a single stream that gets data out of the storage system. +// Most of the information about `ReadStream` instances is aggregated, making +// `ReadStream` lightweight. +message ReadStream { + option (google.api.resource) = { + type: "bigquerystorage.googleapis.com/ReadStream" + pattern: "projects/{project}/locations/{location}/sessions/{session}/streams/{stream}" + }; + + // Output only. Name of the stream, in the form + // `projects/{project_id}/locations/{location}/sessions/{session_id}/streams/{stream_id}`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-bigquery-storage/protos/protos.d.ts b/packages/google-cloud-bigquery-storage/protos/protos.d.ts index a0b708af703..33f0b578737 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-storage/protos/protos.d.ts @@ -26,6 +26,1682 @@ export namespace google { /** Namespace storage. */ namespace storage { + /** Namespace v1. */ + namespace v1 { + + /** Properties of an ArrowSchema. */ + interface IArrowSchema { + + /** ArrowSchema serializedSchema */ + serializedSchema?: (Uint8Array|string|null); + } + + /** Represents an ArrowSchema. */ + class ArrowSchema implements IArrowSchema { + + /** + * Constructs a new ArrowSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.IArrowSchema); + + /** ArrowSchema serializedSchema. */ + public serializedSchema: (Uint8Array|string); + + /** + * Creates a new ArrowSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns ArrowSchema instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.IArrowSchema): google.cloud.bigquery.storage.v1.ArrowSchema; + + /** + * Encodes the specified ArrowSchema message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ArrowSchema.verify|verify} messages. + * @param message ArrowSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.IArrowSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ArrowSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ArrowSchema.verify|verify} messages. + * @param message ArrowSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IArrowSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ArrowSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ArrowSchema + * @throws {Error} If the payload is not a 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.storage.v1.ArrowSchema; + + /** + * Decodes an ArrowSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ArrowSchema + * @throws {Error} If the payload is 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.storage.v1.ArrowSchema; + + /** + * Verifies an ArrowSchema message. + * @param message Plain 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 ArrowSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ArrowSchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.ArrowSchema; + + /** + * Creates a plain object from an ArrowSchema message. Also converts values to other types if specified. + * @param message ArrowSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.ArrowSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ArrowSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ArrowRecordBatch. */ + interface IArrowRecordBatch { + + /** ArrowRecordBatch serializedRecordBatch */ + serializedRecordBatch?: (Uint8Array|string|null); + + /** ArrowRecordBatch rowCount */ + rowCount?: (number|Long|string|null); + } + + /** Represents an ArrowRecordBatch. */ + class ArrowRecordBatch implements IArrowRecordBatch { + + /** + * Constructs a new ArrowRecordBatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.IArrowRecordBatch); + + /** ArrowRecordBatch serializedRecordBatch. */ + public serializedRecordBatch: (Uint8Array|string); + + /** ArrowRecordBatch rowCount. */ + public rowCount: (number|Long|string); + + /** + * Creates a new ArrowRecordBatch instance using the specified properties. + * @param [properties] Properties to set + * @returns ArrowRecordBatch instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.IArrowRecordBatch): google.cloud.bigquery.storage.v1.ArrowRecordBatch; + + /** + * Encodes the specified ArrowRecordBatch message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ArrowRecordBatch.verify|verify} messages. + * @param message ArrowRecordBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.IArrowRecordBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ArrowRecordBatch message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ArrowRecordBatch.verify|verify} messages. + * @param message ArrowRecordBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IArrowRecordBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ArrowRecordBatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ArrowRecordBatch + * @throws {Error} If the payload is not a 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.storage.v1.ArrowRecordBatch; + + /** + * Decodes an ArrowRecordBatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ArrowRecordBatch + * @throws {Error} If the payload is 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.storage.v1.ArrowRecordBatch; + + /** + * Verifies an ArrowRecordBatch message. + * @param message Plain 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 ArrowRecordBatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ArrowRecordBatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.ArrowRecordBatch; + + /** + * Creates a plain object from an ArrowRecordBatch message. Also converts values to other types if specified. + * @param message ArrowRecordBatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.ArrowRecordBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ArrowRecordBatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AvroSchema. */ + interface IAvroSchema { + + /** AvroSchema schema */ + schema?: (string|null); + } + + /** Represents an AvroSchema. */ + class AvroSchema implements IAvroSchema { + + /** + * Constructs a new AvroSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.IAvroSchema); + + /** AvroSchema schema. */ + public schema: string; + + /** + * Creates a new AvroSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns AvroSchema instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.IAvroSchema): google.cloud.bigquery.storage.v1.AvroSchema; + + /** + * Encodes the specified AvroSchema message. Does not implicitly {@link google.cloud.bigquery.storage.v1.AvroSchema.verify|verify} messages. + * @param message AvroSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.IAvroSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AvroSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.AvroSchema.verify|verify} messages. + * @param message AvroSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IAvroSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AvroSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AvroSchema + * @throws {Error} If the payload is not a 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.storage.v1.AvroSchema; + + /** + * Decodes an AvroSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AvroSchema + * @throws {Error} If the payload is 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.storage.v1.AvroSchema; + + /** + * Verifies an AvroSchema message. + * @param message Plain 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 AvroSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AvroSchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.AvroSchema; + + /** + * Creates a plain object from an AvroSchema message. Also converts values to other types if specified. + * @param message AvroSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.AvroSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AvroSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AvroRows. */ + interface IAvroRows { + + /** AvroRows serializedBinaryRows */ + serializedBinaryRows?: (Uint8Array|string|null); + + /** AvroRows rowCount */ + rowCount?: (number|Long|string|null); + } + + /** Represents an AvroRows. */ + class AvroRows implements IAvroRows { + + /** + * Constructs a new AvroRows. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.IAvroRows); + + /** AvroRows serializedBinaryRows. */ + public serializedBinaryRows: (Uint8Array|string); + + /** AvroRows rowCount. */ + public rowCount: (number|Long|string); + + /** + * Creates a new AvroRows instance using the specified properties. + * @param [properties] Properties to set + * @returns AvroRows instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.IAvroRows): google.cloud.bigquery.storage.v1.AvroRows; + + /** + * Encodes the specified AvroRows message. Does not implicitly {@link google.cloud.bigquery.storage.v1.AvroRows.verify|verify} messages. + * @param message AvroRows message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.IAvroRows, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AvroRows message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.AvroRows.verify|verify} messages. + * @param message AvroRows message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IAvroRows, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AvroRows message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AvroRows + * @throws {Error} If the payload is not a 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.storage.v1.AvroRows; + + /** + * Decodes an AvroRows message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AvroRows + * @throws {Error} If the payload is 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.storage.v1.AvroRows; + + /** + * Verifies an AvroRows message. + * @param message Plain 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 AvroRows message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AvroRows + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.AvroRows; + + /** + * Creates a plain object from an AvroRows message. Also converts values to other types if specified. + * @param message AvroRows + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.AvroRows, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AvroRows to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Represents a BigQueryRead */ + class BigQueryRead extends $protobuf.rpc.Service { + + /** + * Constructs a new BigQueryRead 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 BigQueryRead 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): BigQueryRead; + + /** + * Calls CreateReadSession. + * @param request CreateReadSessionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReadSession + */ + public createReadSession(request: google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, callback: google.cloud.bigquery.storage.v1.BigQueryRead.CreateReadSessionCallback): void; + + /** + * Calls CreateReadSession. + * @param request CreateReadSessionRequest message or plain object + * @returns Promise + */ + public createReadSession(request: google.cloud.bigquery.storage.v1.ICreateReadSessionRequest): Promise; + + /** + * Calls ReadRows. + * @param request ReadRowsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReadRowsResponse + */ + public readRows(request: google.cloud.bigquery.storage.v1.IReadRowsRequest, callback: google.cloud.bigquery.storage.v1.BigQueryRead.ReadRowsCallback): void; + + /** + * Calls ReadRows. + * @param request ReadRowsRequest message or plain object + * @returns Promise + */ + public readRows(request: google.cloud.bigquery.storage.v1.IReadRowsRequest): Promise; + + /** + * Calls SplitReadStream. + * @param request SplitReadStreamRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SplitReadStreamResponse + */ + public splitReadStream(request: google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, callback: google.cloud.bigquery.storage.v1.BigQueryRead.SplitReadStreamCallback): void; + + /** + * Calls SplitReadStream. + * @param request SplitReadStreamRequest message or plain object + * @returns Promise + */ + public splitReadStream(request: google.cloud.bigquery.storage.v1.ISplitReadStreamRequest): Promise; + } + + namespace BigQueryRead { + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryRead#createReadSession}. + * @param error Error, if any + * @param [response] ReadSession + */ + type CreateReadSessionCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1.ReadSession) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryRead#readRows}. + * @param error Error, if any + * @param [response] ReadRowsResponse + */ + type ReadRowsCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1.ReadRowsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryRead#splitReadStream}. + * @param error Error, if any + * @param [response] SplitReadStreamResponse + */ + type SplitReadStreamCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1.SplitReadStreamResponse) => void; + } + + /** Properties of a CreateReadSessionRequest. */ + interface ICreateReadSessionRequest { + + /** CreateReadSessionRequest parent */ + parent?: (string|null); + + /** CreateReadSessionRequest readSession */ + readSession?: (google.cloud.bigquery.storage.v1.IReadSession|null); + + /** CreateReadSessionRequest maxStreamCount */ + maxStreamCount?: (number|null); + } + + /** Represents a CreateReadSessionRequest. */ + class CreateReadSessionRequest implements ICreateReadSessionRequest { + + /** + * Constructs a new CreateReadSessionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.ICreateReadSessionRequest); + + /** CreateReadSessionRequest parent. */ + public parent: string; + + /** CreateReadSessionRequest readSession. */ + public readSession?: (google.cloud.bigquery.storage.v1.IReadSession|null); + + /** CreateReadSessionRequest maxStreamCount. */ + public maxStreamCount: number; + + /** + * Creates a new CreateReadSessionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateReadSessionRequest instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.ICreateReadSessionRequest): google.cloud.bigquery.storage.v1.CreateReadSessionRequest; + + /** + * Encodes the specified CreateReadSessionRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1.CreateReadSessionRequest.verify|verify} messages. + * @param message CreateReadSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateReadSessionRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.CreateReadSessionRequest.verify|verify} messages. + * @param message CreateReadSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateReadSessionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateReadSessionRequest + * @throws {Error} If the payload is not a 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.storage.v1.CreateReadSessionRequest; + + /** + * Decodes a CreateReadSessionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateReadSessionRequest + * @throws {Error} If the payload is 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.storage.v1.CreateReadSessionRequest; + + /** + * Verifies a CreateReadSessionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateReadSessionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateReadSessionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.CreateReadSessionRequest; + + /** + * Creates a plain object from a CreateReadSessionRequest message. Also converts values to other types if specified. + * @param message CreateReadSessionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.CreateReadSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateReadSessionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReadRowsRequest. */ + interface IReadRowsRequest { + + /** ReadRowsRequest readStream */ + readStream?: (string|null); + + /** ReadRowsRequest offset */ + offset?: (number|Long|string|null); + } + + /** Represents a ReadRowsRequest. */ + class ReadRowsRequest implements IReadRowsRequest { + + /** + * Constructs a new ReadRowsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.IReadRowsRequest); + + /** ReadRowsRequest readStream. */ + public readStream: string; + + /** ReadRowsRequest offset. */ + public offset: (number|Long|string); + + /** + * Creates a new ReadRowsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadRowsRequest instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.IReadRowsRequest): google.cloud.bigquery.storage.v1.ReadRowsRequest; + + /** + * Encodes the specified ReadRowsRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadRowsRequest.verify|verify} messages. + * @param message ReadRowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.IReadRowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadRowsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadRowsRequest.verify|verify} messages. + * @param message ReadRowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IReadRowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadRowsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadRowsRequest + * @throws {Error} If the payload is not a 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.storage.v1.ReadRowsRequest; + + /** + * Decodes a ReadRowsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadRowsRequest + * @throws {Error} If the payload is 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.storage.v1.ReadRowsRequest; + + /** + * Verifies a ReadRowsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadRowsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadRowsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.ReadRowsRequest; + + /** + * Creates a plain object from a ReadRowsRequest message. Also converts values to other types if specified. + * @param message ReadRowsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.ReadRowsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadRowsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ThrottleState. */ + interface IThrottleState { + + /** ThrottleState throttlePercent */ + throttlePercent?: (number|null); + } + + /** Represents a ThrottleState. */ + class ThrottleState implements IThrottleState { + + /** + * Constructs a new ThrottleState. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.IThrottleState); + + /** ThrottleState throttlePercent. */ + public throttlePercent: number; + + /** + * Creates a new ThrottleState instance using the specified properties. + * @param [properties] Properties to set + * @returns ThrottleState instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.IThrottleState): google.cloud.bigquery.storage.v1.ThrottleState; + + /** + * Encodes the specified ThrottleState message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ThrottleState.verify|verify} messages. + * @param message ThrottleState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.IThrottleState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ThrottleState message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ThrottleState.verify|verify} messages. + * @param message ThrottleState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IThrottleState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThrottleState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ThrottleState + * @throws {Error} If the payload is not a 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.storage.v1.ThrottleState; + + /** + * Decodes a ThrottleState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ThrottleState + * @throws {Error} If the payload is 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.storage.v1.ThrottleState; + + /** + * Verifies a ThrottleState message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ThrottleState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ThrottleState + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.ThrottleState; + + /** + * Creates a plain object from a ThrottleState message. Also converts values to other types if specified. + * @param message ThrottleState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.ThrottleState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ThrottleState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StreamStats. */ + interface IStreamStats { + + /** StreamStats progress */ + progress?: (google.cloud.bigquery.storage.v1.StreamStats.IProgress|null); + } + + /** Represents a StreamStats. */ + class StreamStats implements IStreamStats { + + /** + * Constructs a new StreamStats. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.IStreamStats); + + /** StreamStats progress. */ + public progress?: (google.cloud.bigquery.storage.v1.StreamStats.IProgress|null); + + /** + * Creates a new StreamStats instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamStats instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.IStreamStats): google.cloud.bigquery.storage.v1.StreamStats; + + /** + * Encodes the specified StreamStats message. Does not implicitly {@link google.cloud.bigquery.storage.v1.StreamStats.verify|verify} messages. + * @param message StreamStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.IStreamStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamStats message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.StreamStats.verify|verify} messages. + * @param message StreamStats message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IStreamStats, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamStats message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamStats + * @throws {Error} If the payload is not a 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.storage.v1.StreamStats; + + /** + * Decodes a StreamStats message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamStats + * @throws {Error} If the payload is 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.storage.v1.StreamStats; + + /** + * Verifies a StreamStats message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamStats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamStats + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.StreamStats; + + /** + * Creates a plain object from a StreamStats message. Also converts values to other types if specified. + * @param message StreamStats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.StreamStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamStats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace StreamStats { + + /** Properties of a Progress. */ + interface IProgress { + + /** Progress atResponseStart */ + atResponseStart?: (number|null); + + /** Progress atResponseEnd */ + atResponseEnd?: (number|null); + } + + /** Represents a Progress. */ + class Progress implements IProgress { + + /** + * Constructs a new Progress. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.StreamStats.IProgress); + + /** Progress atResponseStart. */ + public atResponseStart: number; + + /** Progress atResponseEnd. */ + public atResponseEnd: number; + + /** + * Creates a new Progress instance using the specified properties. + * @param [properties] Properties to set + * @returns Progress instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.StreamStats.IProgress): google.cloud.bigquery.storage.v1.StreamStats.Progress; + + /** + * Encodes the specified Progress message. Does not implicitly {@link google.cloud.bigquery.storage.v1.StreamStats.Progress.verify|verify} messages. + * @param message Progress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.StreamStats.IProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Progress message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.StreamStats.Progress.verify|verify} messages. + * @param message Progress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.StreamStats.IProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Progress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Progress + * @throws {Error} If the payload is not a 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.storage.v1.StreamStats.Progress; + + /** + * Decodes a Progress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Progress + * @throws {Error} If the payload is 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.storage.v1.StreamStats.Progress; + + /** + * Verifies a Progress message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Progress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Progress + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.StreamStats.Progress; + + /** + * Creates a plain object from a Progress message. Also converts values to other types if specified. + * @param message Progress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.StreamStats.Progress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Progress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a ReadRowsResponse. */ + interface IReadRowsResponse { + + /** ReadRowsResponse avroRows */ + avroRows?: (google.cloud.bigquery.storage.v1.IAvroRows|null); + + /** ReadRowsResponse arrowRecordBatch */ + arrowRecordBatch?: (google.cloud.bigquery.storage.v1.IArrowRecordBatch|null); + + /** ReadRowsResponse rowCount */ + rowCount?: (number|Long|string|null); + + /** ReadRowsResponse stats */ + stats?: (google.cloud.bigquery.storage.v1.IStreamStats|null); + + /** ReadRowsResponse throttleState */ + throttleState?: (google.cloud.bigquery.storage.v1.IThrottleState|null); + } + + /** Represents a ReadRowsResponse. */ + class ReadRowsResponse implements IReadRowsResponse { + + /** + * Constructs a new ReadRowsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.IReadRowsResponse); + + /** ReadRowsResponse avroRows. */ + public avroRows?: (google.cloud.bigquery.storage.v1.IAvroRows|null); + + /** ReadRowsResponse arrowRecordBatch. */ + public arrowRecordBatch?: (google.cloud.bigquery.storage.v1.IArrowRecordBatch|null); + + /** ReadRowsResponse rowCount. */ + public rowCount: (number|Long|string); + + /** ReadRowsResponse stats. */ + public stats?: (google.cloud.bigquery.storage.v1.IStreamStats|null); + + /** ReadRowsResponse throttleState. */ + public throttleState?: (google.cloud.bigquery.storage.v1.IThrottleState|null); + + /** ReadRowsResponse rows. */ + public rows?: ("avroRows"|"arrowRecordBatch"); + + /** + * Creates a new ReadRowsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadRowsResponse instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.IReadRowsResponse): google.cloud.bigquery.storage.v1.ReadRowsResponse; + + /** + * Encodes the specified ReadRowsResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadRowsResponse.verify|verify} messages. + * @param message ReadRowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.IReadRowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadRowsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadRowsResponse.verify|verify} messages. + * @param message ReadRowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IReadRowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadRowsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadRowsResponse + * @throws {Error} If the payload is not a 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.storage.v1.ReadRowsResponse; + + /** + * Decodes a ReadRowsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadRowsResponse + * @throws {Error} If the payload is 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.storage.v1.ReadRowsResponse; + + /** + * Verifies a ReadRowsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadRowsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadRowsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.ReadRowsResponse; + + /** + * Creates a plain object from a ReadRowsResponse message. Also converts values to other types if specified. + * @param message ReadRowsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.ReadRowsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadRowsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SplitReadStreamRequest. */ + interface ISplitReadStreamRequest { + + /** SplitReadStreamRequest name */ + name?: (string|null); + + /** SplitReadStreamRequest fraction */ + fraction?: (number|null); + } + + /** Represents a SplitReadStreamRequest. */ + class SplitReadStreamRequest implements ISplitReadStreamRequest { + + /** + * Constructs a new SplitReadStreamRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.ISplitReadStreamRequest); + + /** SplitReadStreamRequest name. */ + public name: string; + + /** SplitReadStreamRequest fraction. */ + public fraction: number; + + /** + * Creates a new SplitReadStreamRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SplitReadStreamRequest instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.ISplitReadStreamRequest): google.cloud.bigquery.storage.v1.SplitReadStreamRequest; + + /** + * Encodes the specified SplitReadStreamRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1.SplitReadStreamRequest.verify|verify} messages. + * @param message SplitReadStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SplitReadStreamRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.SplitReadStreamRequest.verify|verify} messages. + * @param message SplitReadStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SplitReadStreamRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SplitReadStreamRequest + * @throws {Error} If the payload is not a 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.storage.v1.SplitReadStreamRequest; + + /** + * Decodes a SplitReadStreamRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SplitReadStreamRequest + * @throws {Error} If the payload is 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.storage.v1.SplitReadStreamRequest; + + /** + * Verifies a SplitReadStreamRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SplitReadStreamRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SplitReadStreamRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.SplitReadStreamRequest; + + /** + * Creates a plain object from a SplitReadStreamRequest message. Also converts values to other types if specified. + * @param message SplitReadStreamRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.SplitReadStreamRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SplitReadStreamRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SplitReadStreamResponse. */ + interface ISplitReadStreamResponse { + + /** SplitReadStreamResponse primaryStream */ + primaryStream?: (google.cloud.bigquery.storage.v1.IReadStream|null); + + /** SplitReadStreamResponse remainderStream */ + remainderStream?: (google.cloud.bigquery.storage.v1.IReadStream|null); + } + + /** Represents a SplitReadStreamResponse. */ + class SplitReadStreamResponse implements ISplitReadStreamResponse { + + /** + * Constructs a new SplitReadStreamResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.ISplitReadStreamResponse); + + /** SplitReadStreamResponse primaryStream. */ + public primaryStream?: (google.cloud.bigquery.storage.v1.IReadStream|null); + + /** SplitReadStreamResponse remainderStream. */ + public remainderStream?: (google.cloud.bigquery.storage.v1.IReadStream|null); + + /** + * Creates a new SplitReadStreamResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SplitReadStreamResponse instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.ISplitReadStreamResponse): google.cloud.bigquery.storage.v1.SplitReadStreamResponse; + + /** + * Encodes the specified SplitReadStreamResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1.SplitReadStreamResponse.verify|verify} messages. + * @param message SplitReadStreamResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SplitReadStreamResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.SplitReadStreamResponse.verify|verify} messages. + * @param message SplitReadStreamResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SplitReadStreamResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SplitReadStreamResponse + * @throws {Error} If the payload is not a 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.storage.v1.SplitReadStreamResponse; + + /** + * Decodes a SplitReadStreamResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SplitReadStreamResponse + * @throws {Error} If the payload is 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.storage.v1.SplitReadStreamResponse; + + /** + * Verifies a SplitReadStreamResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SplitReadStreamResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SplitReadStreamResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.SplitReadStreamResponse; + + /** + * Creates a plain object from a SplitReadStreamResponse message. Also converts values to other types if specified. + * @param message SplitReadStreamResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.SplitReadStreamResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SplitReadStreamResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** DataFormat enum. */ + enum DataFormat { + DATA_FORMAT_UNSPECIFIED = 0, + AVRO = 1, + ARROW = 2 + } + + /** Properties of a ReadSession. */ + interface IReadSession { + + /** ReadSession name */ + name?: (string|null); + + /** ReadSession expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** ReadSession dataFormat */ + dataFormat?: (google.cloud.bigquery.storage.v1.DataFormat|keyof typeof google.cloud.bigquery.storage.v1.DataFormat|null); + + /** ReadSession avroSchema */ + avroSchema?: (google.cloud.bigquery.storage.v1.IAvroSchema|null); + + /** ReadSession arrowSchema */ + arrowSchema?: (google.cloud.bigquery.storage.v1.IArrowSchema|null); + + /** ReadSession table */ + table?: (string|null); + + /** ReadSession tableModifiers */ + tableModifiers?: (google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers|null); + + /** ReadSession readOptions */ + readOptions?: (google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions|null); + + /** ReadSession streams */ + streams?: (google.cloud.bigquery.storage.v1.IReadStream[]|null); + } + + /** Represents a ReadSession. */ + class ReadSession implements IReadSession { + + /** + * Constructs a new ReadSession. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.IReadSession); + + /** ReadSession name. */ + public name: string; + + /** ReadSession expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** ReadSession dataFormat. */ + public dataFormat: (google.cloud.bigquery.storage.v1.DataFormat|keyof typeof google.cloud.bigquery.storage.v1.DataFormat); + + /** ReadSession avroSchema. */ + public avroSchema?: (google.cloud.bigquery.storage.v1.IAvroSchema|null); + + /** ReadSession arrowSchema. */ + public arrowSchema?: (google.cloud.bigquery.storage.v1.IArrowSchema|null); + + /** ReadSession table. */ + public table: string; + + /** ReadSession tableModifiers. */ + public tableModifiers?: (google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers|null); + + /** ReadSession readOptions. */ + public readOptions?: (google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions|null); + + /** ReadSession streams. */ + public streams: google.cloud.bigquery.storage.v1.IReadStream[]; + + /** ReadSession schema. */ + public schema?: ("avroSchema"|"arrowSchema"); + + /** + * Creates a new ReadSession instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadSession instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.IReadSession): google.cloud.bigquery.storage.v1.ReadSession; + + /** + * Encodes the specified ReadSession message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.verify|verify} messages. + * @param message ReadSession message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.IReadSession, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadSession message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.verify|verify} messages. + * @param message ReadSession message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IReadSession, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadSession message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadSession + * @throws {Error} If the payload is not a 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.storage.v1.ReadSession; + + /** + * Decodes a ReadSession message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadSession + * @throws {Error} If the payload is 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.storage.v1.ReadSession; + + /** + * Verifies a ReadSession message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadSession message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadSession + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.ReadSession; + + /** + * Creates a plain object from a ReadSession message. Also converts values to other types if specified. + * @param message ReadSession + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.ReadSession, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadSession to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ReadSession { + + /** Properties of a TableModifiers. */ + interface ITableModifiers { + + /** TableModifiers snapshotTime */ + snapshotTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TableModifiers. */ + class TableModifiers implements ITableModifiers { + + /** + * Constructs a new TableModifiers. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers); + + /** TableModifiers snapshotTime. */ + public snapshotTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TableModifiers instance using the specified properties. + * @param [properties] Properties to set + * @returns TableModifiers instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers): google.cloud.bigquery.storage.v1.ReadSession.TableModifiers; + + /** + * Encodes the specified TableModifiers message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.verify|verify} messages. + * @param message TableModifiers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableModifiers message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.verify|verify} messages. + * @param message TableModifiers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableModifiers message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableModifiers + * @throws {Error} If the payload is not a 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.storage.v1.ReadSession.TableModifiers; + + /** + * Decodes a TableModifiers message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableModifiers + * @throws {Error} If the payload is 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.storage.v1.ReadSession.TableModifiers; + + /** + * Verifies a TableModifiers message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableModifiers message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableModifiers + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.ReadSession.TableModifiers; + + /** + * Creates a plain object from a TableModifiers message. Also converts values to other types if specified. + * @param message TableModifiers + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.ReadSession.TableModifiers, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableModifiers to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TableReadOptions. */ + interface ITableReadOptions { + + /** TableReadOptions selectedFields */ + selectedFields?: (string[]|null); + + /** TableReadOptions rowRestriction */ + rowRestriction?: (string|null); + } + + /** Represents a TableReadOptions. */ + class TableReadOptions implements ITableReadOptions { + + /** + * Constructs a new TableReadOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions); + + /** TableReadOptions selectedFields. */ + public selectedFields: string[]; + + /** TableReadOptions rowRestriction. */ + public rowRestriction: string; + + /** + * Creates a new TableReadOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns TableReadOptions instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions): google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions; + + /** + * Encodes the specified TableReadOptions message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.verify|verify} messages. + * @param message TableReadOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableReadOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.verify|verify} messages. + * @param message TableReadOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableReadOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableReadOptions + * @throws {Error} If the payload is not a 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.storage.v1.ReadSession.TableReadOptions; + + /** + * Decodes a TableReadOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableReadOptions + * @throws {Error} If the payload is 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.storage.v1.ReadSession.TableReadOptions; + + /** + * Verifies a TableReadOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableReadOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableReadOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions; + + /** + * Creates a plain object from a TableReadOptions message. Also converts values to other types if specified. + * @param message TableReadOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableReadOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a ReadStream. */ + interface IReadStream { + + /** ReadStream name */ + name?: (string|null); + } + + /** Represents a ReadStream. */ + class ReadStream implements IReadStream { + + /** + * Constructs a new ReadStream. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.IReadStream); + + /** ReadStream name. */ + public name: string; + + /** + * Creates a new ReadStream instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadStream instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.IReadStream): google.cloud.bigquery.storage.v1.ReadStream; + + /** + * Encodes the specified ReadStream message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadStream.verify|verify} messages. + * @param message ReadStream message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.IReadStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadStream message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadStream.verify|verify} messages. + * @param message ReadStream message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IReadStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadStream message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadStream + * @throws {Error} If the payload is not a 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.storage.v1.ReadStream; + + /** + * Decodes a ReadStream message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadStream + * @throws {Error} If the payload is 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.storage.v1.ReadStream; + + /** + * Verifies a ReadStream message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadStream message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadStream + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.ReadStream; + + /** + * Creates a plain object from a ReadStream message. Also converts values to other types if specified. + * @param message ReadStream + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.ReadStream, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadStream to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + /** Namespace v1beta1. */ namespace v1beta1 { diff --git a/packages/google-cloud-bigquery-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index 8da21884529..911efd69b28 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/protos/protos.js @@ -66,6 +66,3895 @@ */ var storage = {}; + storage.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.bigquery.storage + * @namespace + */ + var v1 = {}; + + v1.ArrowSchema = (function() { + + /** + * Properties of an ArrowSchema. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IArrowSchema + * @property {Uint8Array|null} [serializedSchema] ArrowSchema serializedSchema + */ + + /** + * Constructs a new ArrowSchema. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents an ArrowSchema. + * @implements IArrowSchema + * @constructor + * @param {google.cloud.bigquery.storage.v1.IArrowSchema=} [properties] Properties to set + */ + function ArrowSchema(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ArrowSchema serializedSchema. + * @member {Uint8Array} serializedSchema + * @memberof google.cloud.bigquery.storage.v1.ArrowSchema + * @instance + */ + ArrowSchema.prototype.serializedSchema = $util.newBuffer([]); + + /** + * Creates a new ArrowSchema instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.ArrowSchema + * @static + * @param {google.cloud.bigquery.storage.v1.IArrowSchema=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.ArrowSchema} ArrowSchema instance + */ + ArrowSchema.create = function create(properties) { + return new ArrowSchema(properties); + }; + + /** + * Encodes the specified ArrowSchema message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ArrowSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.ArrowSchema + * @static + * @param {google.cloud.bigquery.storage.v1.IArrowSchema} message ArrowSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrowSchema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serializedSchema != null && message.hasOwnProperty("serializedSchema")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.serializedSchema); + return writer; + }; + + /** + * Encodes the specified ArrowSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ArrowSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ArrowSchema + * @static + * @param {google.cloud.bigquery.storage.v1.IArrowSchema} message ArrowSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrowSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ArrowSchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.ArrowSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.ArrowSchema} ArrowSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrowSchema.decode = function decode(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.storage.v1.ArrowSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serializedSchema = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ArrowSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ArrowSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.ArrowSchema} ArrowSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrowSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArrowSchema message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.ArrowSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArrowSchema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serializedSchema != null && message.hasOwnProperty("serializedSchema")) + if (!(message.serializedSchema && typeof message.serializedSchema.length === "number" || $util.isString(message.serializedSchema))) + return "serializedSchema: buffer expected"; + return null; + }; + + /** + * Creates an ArrowSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.ArrowSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.ArrowSchema} ArrowSchema + */ + ArrowSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.ArrowSchema) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.ArrowSchema(); + if (object.serializedSchema != null) + if (typeof object.serializedSchema === "string") + $util.base64.decode(object.serializedSchema, message.serializedSchema = $util.newBuffer($util.base64.length(object.serializedSchema)), 0); + else if (object.serializedSchema.length) + message.serializedSchema = object.serializedSchema; + return message; + }; + + /** + * Creates a plain object from an ArrowSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.ArrowSchema + * @static + * @param {google.cloud.bigquery.storage.v1.ArrowSchema} message ArrowSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArrowSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.serializedSchema = ""; + else { + object.serializedSchema = []; + if (options.bytes !== Array) + object.serializedSchema = $util.newBuffer(object.serializedSchema); + } + if (message.serializedSchema != null && message.hasOwnProperty("serializedSchema")) + object.serializedSchema = options.bytes === String ? $util.base64.encode(message.serializedSchema, 0, message.serializedSchema.length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedSchema) : message.serializedSchema; + return object; + }; + + /** + * Converts this ArrowSchema to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.ArrowSchema + * @instance + * @returns {Object.} JSON object + */ + ArrowSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ArrowSchema; + })(); + + v1.ArrowRecordBatch = (function() { + + /** + * Properties of an ArrowRecordBatch. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IArrowRecordBatch + * @property {Uint8Array|null} [serializedRecordBatch] ArrowRecordBatch serializedRecordBatch + * @property {number|Long|null} [rowCount] ArrowRecordBatch rowCount + */ + + /** + * Constructs a new ArrowRecordBatch. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents an ArrowRecordBatch. + * @implements IArrowRecordBatch + * @constructor + * @param {google.cloud.bigquery.storage.v1.IArrowRecordBatch=} [properties] Properties to set + */ + function ArrowRecordBatch(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ArrowRecordBatch serializedRecordBatch. + * @member {Uint8Array} serializedRecordBatch + * @memberof google.cloud.bigquery.storage.v1.ArrowRecordBatch + * @instance + */ + ArrowRecordBatch.prototype.serializedRecordBatch = $util.newBuffer([]); + + /** + * ArrowRecordBatch rowCount. + * @member {number|Long} rowCount + * @memberof google.cloud.bigquery.storage.v1.ArrowRecordBatch + * @instance + */ + ArrowRecordBatch.prototype.rowCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ArrowRecordBatch instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.ArrowRecordBatch + * @static + * @param {google.cloud.bigquery.storage.v1.IArrowRecordBatch=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.ArrowRecordBatch} ArrowRecordBatch instance + */ + ArrowRecordBatch.create = function create(properties) { + return new ArrowRecordBatch(properties); + }; + + /** + * Encodes the specified ArrowRecordBatch message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ArrowRecordBatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.ArrowRecordBatch + * @static + * @param {google.cloud.bigquery.storage.v1.IArrowRecordBatch} message ArrowRecordBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrowRecordBatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serializedRecordBatch != null && message.hasOwnProperty("serializedRecordBatch")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.serializedRecordBatch); + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.rowCount); + return writer; + }; + + /** + * Encodes the specified ArrowRecordBatch message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ArrowRecordBatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ArrowRecordBatch + * @static + * @param {google.cloud.bigquery.storage.v1.IArrowRecordBatch} message ArrowRecordBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrowRecordBatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ArrowRecordBatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.ArrowRecordBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.ArrowRecordBatch} ArrowRecordBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrowRecordBatch.decode = function decode(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.storage.v1.ArrowRecordBatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serializedRecordBatch = reader.bytes(); + break; + case 2: + message.rowCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ArrowRecordBatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ArrowRecordBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.ArrowRecordBatch} ArrowRecordBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrowRecordBatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArrowRecordBatch message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.ArrowRecordBatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArrowRecordBatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serializedRecordBatch != null && message.hasOwnProperty("serializedRecordBatch")) + if (!(message.serializedRecordBatch && typeof message.serializedRecordBatch.length === "number" || $util.isString(message.serializedRecordBatch))) + return "serializedRecordBatch: buffer expected"; + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (!$util.isInteger(message.rowCount) && !(message.rowCount && $util.isInteger(message.rowCount.low) && $util.isInteger(message.rowCount.high))) + return "rowCount: integer|Long expected"; + return null; + }; + + /** + * Creates an ArrowRecordBatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.ArrowRecordBatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.ArrowRecordBatch} ArrowRecordBatch + */ + ArrowRecordBatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.ArrowRecordBatch) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.ArrowRecordBatch(); + if (object.serializedRecordBatch != null) + if (typeof object.serializedRecordBatch === "string") + $util.base64.decode(object.serializedRecordBatch, message.serializedRecordBatch = $util.newBuffer($util.base64.length(object.serializedRecordBatch)), 0); + else if (object.serializedRecordBatch.length) + message.serializedRecordBatch = object.serializedRecordBatch; + if (object.rowCount != null) + if ($util.Long) + (message.rowCount = $util.Long.fromValue(object.rowCount)).unsigned = false; + else if (typeof object.rowCount === "string") + message.rowCount = parseInt(object.rowCount, 10); + else if (typeof object.rowCount === "number") + message.rowCount = object.rowCount; + else if (typeof object.rowCount === "object") + message.rowCount = new $util.LongBits(object.rowCount.low >>> 0, object.rowCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an ArrowRecordBatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.ArrowRecordBatch + * @static + * @param {google.cloud.bigquery.storage.v1.ArrowRecordBatch} message ArrowRecordBatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArrowRecordBatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.serializedRecordBatch = ""; + else { + object.serializedRecordBatch = []; + if (options.bytes !== Array) + object.serializedRecordBatch = $util.newBuffer(object.serializedRecordBatch); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rowCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowCount = options.longs === String ? "0" : 0; + } + if (message.serializedRecordBatch != null && message.hasOwnProperty("serializedRecordBatch")) + object.serializedRecordBatch = options.bytes === String ? $util.base64.encode(message.serializedRecordBatch, 0, message.serializedRecordBatch.length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedRecordBatch) : message.serializedRecordBatch; + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (typeof message.rowCount === "number") + object.rowCount = options.longs === String ? String(message.rowCount) : message.rowCount; + else + object.rowCount = options.longs === String ? $util.Long.prototype.toString.call(message.rowCount) : options.longs === Number ? new $util.LongBits(message.rowCount.low >>> 0, message.rowCount.high >>> 0).toNumber() : message.rowCount; + return object; + }; + + /** + * Converts this ArrowRecordBatch to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.ArrowRecordBatch + * @instance + * @returns {Object.} JSON object + */ + ArrowRecordBatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ArrowRecordBatch; + })(); + + v1.AvroSchema = (function() { + + /** + * Properties of an AvroSchema. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IAvroSchema + * @property {string|null} [schema] AvroSchema schema + */ + + /** + * Constructs a new AvroSchema. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents an AvroSchema. + * @implements IAvroSchema + * @constructor + * @param {google.cloud.bigquery.storage.v1.IAvroSchema=} [properties] Properties to set + */ + function AvroSchema(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AvroSchema schema. + * @member {string} schema + * @memberof google.cloud.bigquery.storage.v1.AvroSchema + * @instance + */ + AvroSchema.prototype.schema = ""; + + /** + * Creates a new AvroSchema instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.AvroSchema + * @static + * @param {google.cloud.bigquery.storage.v1.IAvroSchema=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.AvroSchema} AvroSchema instance + */ + AvroSchema.create = function create(properties) { + return new AvroSchema(properties); + }; + + /** + * Encodes the specified AvroSchema message. Does not implicitly {@link google.cloud.bigquery.storage.v1.AvroSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.AvroSchema + * @static + * @param {google.cloud.bigquery.storage.v1.IAvroSchema} message AvroSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvroSchema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schema != null && message.hasOwnProperty("schema")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.schema); + return writer; + }; + + /** + * Encodes the specified AvroSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.AvroSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.AvroSchema + * @static + * @param {google.cloud.bigquery.storage.v1.IAvroSchema} message AvroSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvroSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AvroSchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.AvroSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.AvroSchema} AvroSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvroSchema.decode = function decode(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.storage.v1.AvroSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.schema = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AvroSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.AvroSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.AvroSchema} AvroSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvroSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AvroSchema message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.AvroSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AvroSchema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schema != null && message.hasOwnProperty("schema")) + if (!$util.isString(message.schema)) + return "schema: string expected"; + return null; + }; + + /** + * Creates an AvroSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.AvroSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.AvroSchema} AvroSchema + */ + AvroSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.AvroSchema) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.AvroSchema(); + if (object.schema != null) + message.schema = String(object.schema); + return message; + }; + + /** + * Creates a plain object from an AvroSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.AvroSchema + * @static + * @param {google.cloud.bigquery.storage.v1.AvroSchema} message AvroSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AvroSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.schema = ""; + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = message.schema; + return object; + }; + + /** + * Converts this AvroSchema to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.AvroSchema + * @instance + * @returns {Object.} JSON object + */ + AvroSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AvroSchema; + })(); + + v1.AvroRows = (function() { + + /** + * Properties of an AvroRows. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IAvroRows + * @property {Uint8Array|null} [serializedBinaryRows] AvroRows serializedBinaryRows + * @property {number|Long|null} [rowCount] AvroRows rowCount + */ + + /** + * Constructs a new AvroRows. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents an AvroRows. + * @implements IAvroRows + * @constructor + * @param {google.cloud.bigquery.storage.v1.IAvroRows=} [properties] Properties to set + */ + function AvroRows(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AvroRows serializedBinaryRows. + * @member {Uint8Array} serializedBinaryRows + * @memberof google.cloud.bigquery.storage.v1.AvroRows + * @instance + */ + AvroRows.prototype.serializedBinaryRows = $util.newBuffer([]); + + /** + * AvroRows rowCount. + * @member {number|Long} rowCount + * @memberof google.cloud.bigquery.storage.v1.AvroRows + * @instance + */ + AvroRows.prototype.rowCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new AvroRows instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.AvroRows + * @static + * @param {google.cloud.bigquery.storage.v1.IAvroRows=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.AvroRows} AvroRows instance + */ + AvroRows.create = function create(properties) { + return new AvroRows(properties); + }; + + /** + * Encodes the specified AvroRows message. Does not implicitly {@link google.cloud.bigquery.storage.v1.AvroRows.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.AvroRows + * @static + * @param {google.cloud.bigquery.storage.v1.IAvroRows} message AvroRows message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvroRows.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serializedBinaryRows != null && message.hasOwnProperty("serializedBinaryRows")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.serializedBinaryRows); + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.rowCount); + return writer; + }; + + /** + * Encodes the specified AvroRows message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.AvroRows.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.AvroRows + * @static + * @param {google.cloud.bigquery.storage.v1.IAvroRows} message AvroRows message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvroRows.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AvroRows message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.AvroRows + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.AvroRows} AvroRows + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvroRows.decode = function decode(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.storage.v1.AvroRows(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serializedBinaryRows = reader.bytes(); + break; + case 2: + message.rowCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AvroRows message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.AvroRows + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.AvroRows} AvroRows + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvroRows.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AvroRows message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.AvroRows + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AvroRows.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serializedBinaryRows != null && message.hasOwnProperty("serializedBinaryRows")) + if (!(message.serializedBinaryRows && typeof message.serializedBinaryRows.length === "number" || $util.isString(message.serializedBinaryRows))) + return "serializedBinaryRows: buffer expected"; + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (!$util.isInteger(message.rowCount) && !(message.rowCount && $util.isInteger(message.rowCount.low) && $util.isInteger(message.rowCount.high))) + return "rowCount: integer|Long expected"; + return null; + }; + + /** + * Creates an AvroRows message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.AvroRows + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.AvroRows} AvroRows + */ + AvroRows.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.AvroRows) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.AvroRows(); + if (object.serializedBinaryRows != null) + if (typeof object.serializedBinaryRows === "string") + $util.base64.decode(object.serializedBinaryRows, message.serializedBinaryRows = $util.newBuffer($util.base64.length(object.serializedBinaryRows)), 0); + else if (object.serializedBinaryRows.length) + message.serializedBinaryRows = object.serializedBinaryRows; + if (object.rowCount != null) + if ($util.Long) + (message.rowCount = $util.Long.fromValue(object.rowCount)).unsigned = false; + else if (typeof object.rowCount === "string") + message.rowCount = parseInt(object.rowCount, 10); + else if (typeof object.rowCount === "number") + message.rowCount = object.rowCount; + else if (typeof object.rowCount === "object") + message.rowCount = new $util.LongBits(object.rowCount.low >>> 0, object.rowCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an AvroRows message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.AvroRows + * @static + * @param {google.cloud.bigquery.storage.v1.AvroRows} message AvroRows + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AvroRows.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.serializedBinaryRows = ""; + else { + object.serializedBinaryRows = []; + if (options.bytes !== Array) + object.serializedBinaryRows = $util.newBuffer(object.serializedBinaryRows); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rowCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowCount = options.longs === String ? "0" : 0; + } + if (message.serializedBinaryRows != null && message.hasOwnProperty("serializedBinaryRows")) + object.serializedBinaryRows = options.bytes === String ? $util.base64.encode(message.serializedBinaryRows, 0, message.serializedBinaryRows.length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedBinaryRows) : message.serializedBinaryRows; + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (typeof message.rowCount === "number") + object.rowCount = options.longs === String ? String(message.rowCount) : message.rowCount; + else + object.rowCount = options.longs === String ? $util.Long.prototype.toString.call(message.rowCount) : options.longs === Number ? new $util.LongBits(message.rowCount.low >>> 0, message.rowCount.high >>> 0).toNumber() : message.rowCount; + return object; + }; + + /** + * Converts this AvroRows to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.AvroRows + * @instance + * @returns {Object.} JSON object + */ + AvroRows.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AvroRows; + })(); + + v1.BigQueryRead = (function() { + + /** + * Constructs a new BigQueryRead service. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a BigQueryRead + * @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 BigQueryRead(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (BigQueryRead.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BigQueryRead; + + /** + * Creates new BigQueryRead service using the specified rpc implementation. + * @function create + * @memberof google.cloud.bigquery.storage.v1.BigQueryRead + * @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 {BigQueryRead} RPC service. Useful where requests and/or responses are streamed. + */ + BigQueryRead.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryRead#createReadSession}. + * @memberof google.cloud.bigquery.storage.v1.BigQueryRead + * @typedef CreateReadSessionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.storage.v1.ReadSession} [response] ReadSession + */ + + /** + * Calls CreateReadSession. + * @function createReadSession + * @memberof google.cloud.bigquery.storage.v1.BigQueryRead + * @instance + * @param {google.cloud.bigquery.storage.v1.ICreateReadSessionRequest} request CreateReadSessionRequest message or plain object + * @param {google.cloud.bigquery.storage.v1.BigQueryRead.CreateReadSessionCallback} callback Node-style callback called with the error, if any, and ReadSession + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigQueryRead.prototype.createReadSession = function createReadSession(request, callback) { + return this.rpcCall(createReadSession, $root.google.cloud.bigquery.storage.v1.CreateReadSessionRequest, $root.google.cloud.bigquery.storage.v1.ReadSession, request, callback); + }, "name", { value: "CreateReadSession" }); + + /** + * Calls CreateReadSession. + * @function createReadSession + * @memberof google.cloud.bigquery.storage.v1.BigQueryRead + * @instance + * @param {google.cloud.bigquery.storage.v1.ICreateReadSessionRequest} request CreateReadSessionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryRead#readRows}. + * @memberof google.cloud.bigquery.storage.v1.BigQueryRead + * @typedef ReadRowsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.storage.v1.ReadRowsResponse} [response] ReadRowsResponse + */ + + /** + * Calls ReadRows. + * @function readRows + * @memberof google.cloud.bigquery.storage.v1.BigQueryRead + * @instance + * @param {google.cloud.bigquery.storage.v1.IReadRowsRequest} request ReadRowsRequest message or plain object + * @param {google.cloud.bigquery.storage.v1.BigQueryRead.ReadRowsCallback} callback Node-style callback called with the error, if any, and ReadRowsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigQueryRead.prototype.readRows = function readRows(request, callback) { + return this.rpcCall(readRows, $root.google.cloud.bigquery.storage.v1.ReadRowsRequest, $root.google.cloud.bigquery.storage.v1.ReadRowsResponse, request, callback); + }, "name", { value: "ReadRows" }); + + /** + * Calls ReadRows. + * @function readRows + * @memberof google.cloud.bigquery.storage.v1.BigQueryRead + * @instance + * @param {google.cloud.bigquery.storage.v1.IReadRowsRequest} request ReadRowsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryRead#splitReadStream}. + * @memberof google.cloud.bigquery.storage.v1.BigQueryRead + * @typedef SplitReadStreamCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.storage.v1.SplitReadStreamResponse} [response] SplitReadStreamResponse + */ + + /** + * Calls SplitReadStream. + * @function splitReadStream + * @memberof google.cloud.bigquery.storage.v1.BigQueryRead + * @instance + * @param {google.cloud.bigquery.storage.v1.ISplitReadStreamRequest} request SplitReadStreamRequest message or plain object + * @param {google.cloud.bigquery.storage.v1.BigQueryRead.SplitReadStreamCallback} callback Node-style callback called with the error, if any, and SplitReadStreamResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigQueryRead.prototype.splitReadStream = function splitReadStream(request, callback) { + return this.rpcCall(splitReadStream, $root.google.cloud.bigquery.storage.v1.SplitReadStreamRequest, $root.google.cloud.bigquery.storage.v1.SplitReadStreamResponse, request, callback); + }, "name", { value: "SplitReadStream" }); + + /** + * Calls SplitReadStream. + * @function splitReadStream + * @memberof google.cloud.bigquery.storage.v1.BigQueryRead + * @instance + * @param {google.cloud.bigquery.storage.v1.ISplitReadStreamRequest} request SplitReadStreamRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return BigQueryRead; + })(); + + v1.CreateReadSessionRequest = (function() { + + /** + * Properties of a CreateReadSessionRequest. + * @memberof google.cloud.bigquery.storage.v1 + * @interface ICreateReadSessionRequest + * @property {string|null} [parent] CreateReadSessionRequest parent + * @property {google.cloud.bigquery.storage.v1.IReadSession|null} [readSession] CreateReadSessionRequest readSession + * @property {number|null} [maxStreamCount] CreateReadSessionRequest maxStreamCount + */ + + /** + * Constructs a new CreateReadSessionRequest. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a CreateReadSessionRequest. + * @implements ICreateReadSessionRequest + * @constructor + * @param {google.cloud.bigquery.storage.v1.ICreateReadSessionRequest=} [properties] Properties to set + */ + function CreateReadSessionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateReadSessionRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.storage.v1.CreateReadSessionRequest + * @instance + */ + CreateReadSessionRequest.prototype.parent = ""; + + /** + * CreateReadSessionRequest readSession. + * @member {google.cloud.bigquery.storage.v1.IReadSession|null|undefined} readSession + * @memberof google.cloud.bigquery.storage.v1.CreateReadSessionRequest + * @instance + */ + CreateReadSessionRequest.prototype.readSession = null; + + /** + * CreateReadSessionRequest maxStreamCount. + * @member {number} maxStreamCount + * @memberof google.cloud.bigquery.storage.v1.CreateReadSessionRequest + * @instance + */ + CreateReadSessionRequest.prototype.maxStreamCount = 0; + + /** + * Creates a new CreateReadSessionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.CreateReadSessionRequest + * @static + * @param {google.cloud.bigquery.storage.v1.ICreateReadSessionRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.CreateReadSessionRequest} CreateReadSessionRequest instance + */ + CreateReadSessionRequest.create = function create(properties) { + return new CreateReadSessionRequest(properties); + }; + + /** + * Encodes the specified CreateReadSessionRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1.CreateReadSessionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.CreateReadSessionRequest + * @static + * @param {google.cloud.bigquery.storage.v1.ICreateReadSessionRequest} message CreateReadSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateReadSessionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.readSession != null && message.hasOwnProperty("readSession")) + $root.google.cloud.bigquery.storage.v1.ReadSession.encode(message.readSession, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.maxStreamCount != null && message.hasOwnProperty("maxStreamCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxStreamCount); + return writer; + }; + + /** + * Encodes the specified CreateReadSessionRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.CreateReadSessionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.CreateReadSessionRequest + * @static + * @param {google.cloud.bigquery.storage.v1.ICreateReadSessionRequest} message CreateReadSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateReadSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateReadSessionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.CreateReadSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.CreateReadSessionRequest} CreateReadSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateReadSessionRequest.decode = function decode(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.storage.v1.CreateReadSessionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.readSession = $root.google.cloud.bigquery.storage.v1.ReadSession.decode(reader, reader.uint32()); + break; + case 3: + message.maxStreamCount = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateReadSessionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.CreateReadSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.CreateReadSessionRequest} CreateReadSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateReadSessionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateReadSessionRequest message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.CreateReadSessionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateReadSessionRequest.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.readSession != null && message.hasOwnProperty("readSession")) { + var error = $root.google.cloud.bigquery.storage.v1.ReadSession.verify(message.readSession); + if (error) + return "readSession." + error; + } + if (message.maxStreamCount != null && message.hasOwnProperty("maxStreamCount")) + if (!$util.isInteger(message.maxStreamCount)) + return "maxStreamCount: integer expected"; + return null; + }; + + /** + * Creates a CreateReadSessionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.CreateReadSessionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.CreateReadSessionRequest} CreateReadSessionRequest + */ + CreateReadSessionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.CreateReadSessionRequest) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.CreateReadSessionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.readSession != null) { + if (typeof object.readSession !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.CreateReadSessionRequest.readSession: object expected"); + message.readSession = $root.google.cloud.bigquery.storage.v1.ReadSession.fromObject(object.readSession); + } + if (object.maxStreamCount != null) + message.maxStreamCount = object.maxStreamCount | 0; + return message; + }; + + /** + * Creates a plain object from a CreateReadSessionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.CreateReadSessionRequest + * @static + * @param {google.cloud.bigquery.storage.v1.CreateReadSessionRequest} message CreateReadSessionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateReadSessionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.readSession = null; + object.maxStreamCount = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.readSession != null && message.hasOwnProperty("readSession")) + object.readSession = $root.google.cloud.bigquery.storage.v1.ReadSession.toObject(message.readSession, options); + if (message.maxStreamCount != null && message.hasOwnProperty("maxStreamCount")) + object.maxStreamCount = message.maxStreamCount; + return object; + }; + + /** + * Converts this CreateReadSessionRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.CreateReadSessionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateReadSessionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateReadSessionRequest; + })(); + + v1.ReadRowsRequest = (function() { + + /** + * Properties of a ReadRowsRequest. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IReadRowsRequest + * @property {string|null} [readStream] ReadRowsRequest readStream + * @property {number|Long|null} [offset] ReadRowsRequest offset + */ + + /** + * Constructs a new ReadRowsRequest. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a ReadRowsRequest. + * @implements IReadRowsRequest + * @constructor + * @param {google.cloud.bigquery.storage.v1.IReadRowsRequest=} [properties] Properties to set + */ + function ReadRowsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadRowsRequest readStream. + * @member {string} readStream + * @memberof google.cloud.bigquery.storage.v1.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.readStream = ""; + + /** + * ReadRowsRequest offset. + * @member {number|Long} offset + * @memberof google.cloud.bigquery.storage.v1.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.offset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ReadRowsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.ReadRowsRequest + * @static + * @param {google.cloud.bigquery.storage.v1.IReadRowsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.ReadRowsRequest} ReadRowsRequest instance + */ + ReadRowsRequest.create = function create(properties) { + return new ReadRowsRequest(properties); + }; + + /** + * Encodes the specified ReadRowsRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadRowsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.ReadRowsRequest + * @static + * @param {google.cloud.bigquery.storage.v1.IReadRowsRequest} message ReadRowsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadRowsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readStream != null && message.hasOwnProperty("readStream")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.readStream); + if (message.offset != null && message.hasOwnProperty("offset")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.offset); + return writer; + }; + + /** + * Encodes the specified ReadRowsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadRowsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ReadRowsRequest + * @static + * @param {google.cloud.bigquery.storage.v1.IReadRowsRequest} message ReadRowsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadRowsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadRowsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.ReadRowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.ReadRowsRequest} ReadRowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadRowsRequest.decode = function decode(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.storage.v1.ReadRowsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.readStream = reader.string(); + break; + case 2: + message.offset = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadRowsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ReadRowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.ReadRowsRequest} ReadRowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadRowsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadRowsRequest message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.ReadRowsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadRowsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readStream != null && message.hasOwnProperty("readStream")) + if (!$util.isString(message.readStream)) + return "readStream: string expected"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset) && !(message.offset && $util.isInteger(message.offset.low) && $util.isInteger(message.offset.high))) + return "offset: integer|Long expected"; + return null; + }; + + /** + * Creates a ReadRowsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.ReadRowsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.ReadRowsRequest} ReadRowsRequest + */ + ReadRowsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.ReadRowsRequest) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.ReadRowsRequest(); + if (object.readStream != null) + message.readStream = String(object.readStream); + if (object.offset != null) + if ($util.Long) + (message.offset = $util.Long.fromValue(object.offset)).unsigned = false; + else if (typeof object.offset === "string") + message.offset = parseInt(object.offset, 10); + else if (typeof object.offset === "number") + message.offset = object.offset; + else if (typeof object.offset === "object") + message.offset = new $util.LongBits(object.offset.low >>> 0, object.offset.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ReadRowsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.ReadRowsRequest + * @static + * @param {google.cloud.bigquery.storage.v1.ReadRowsRequest} message ReadRowsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadRowsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.readStream = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.offset = options.longs === String ? "0" : 0; + } + if (message.readStream != null && message.hasOwnProperty("readStream")) + object.readStream = message.readStream; + if (message.offset != null && message.hasOwnProperty("offset")) + if (typeof message.offset === "number") + object.offset = options.longs === String ? String(message.offset) : message.offset; + else + object.offset = options.longs === String ? $util.Long.prototype.toString.call(message.offset) : options.longs === Number ? new $util.LongBits(message.offset.low >>> 0, message.offset.high >>> 0).toNumber() : message.offset; + return object; + }; + + /** + * Converts this ReadRowsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.ReadRowsRequest + * @instance + * @returns {Object.} JSON object + */ + ReadRowsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReadRowsRequest; + })(); + + v1.ThrottleState = (function() { + + /** + * Properties of a ThrottleState. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IThrottleState + * @property {number|null} [throttlePercent] ThrottleState throttlePercent + */ + + /** + * Constructs a new ThrottleState. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a ThrottleState. + * @implements IThrottleState + * @constructor + * @param {google.cloud.bigquery.storage.v1.IThrottleState=} [properties] Properties to set + */ + function ThrottleState(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ThrottleState throttlePercent. + * @member {number} throttlePercent + * @memberof google.cloud.bigquery.storage.v1.ThrottleState + * @instance + */ + ThrottleState.prototype.throttlePercent = 0; + + /** + * Creates a new ThrottleState instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.ThrottleState + * @static + * @param {google.cloud.bigquery.storage.v1.IThrottleState=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.ThrottleState} ThrottleState instance + */ + ThrottleState.create = function create(properties) { + return new ThrottleState(properties); + }; + + /** + * Encodes the specified ThrottleState message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ThrottleState.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.ThrottleState + * @static + * @param {google.cloud.bigquery.storage.v1.IThrottleState} message ThrottleState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThrottleState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.throttlePercent != null && message.hasOwnProperty("throttlePercent")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.throttlePercent); + return writer; + }; + + /** + * Encodes the specified ThrottleState message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ThrottleState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ThrottleState + * @static + * @param {google.cloud.bigquery.storage.v1.IThrottleState} message ThrottleState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThrottleState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ThrottleState message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.ThrottleState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.ThrottleState} ThrottleState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThrottleState.decode = function decode(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.storage.v1.ThrottleState(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.throttlePercent = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ThrottleState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ThrottleState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.ThrottleState} ThrottleState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThrottleState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ThrottleState message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.ThrottleState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ThrottleState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.throttlePercent != null && message.hasOwnProperty("throttlePercent")) + if (!$util.isInteger(message.throttlePercent)) + return "throttlePercent: integer expected"; + return null; + }; + + /** + * Creates a ThrottleState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.ThrottleState + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.ThrottleState} ThrottleState + */ + ThrottleState.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.ThrottleState) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.ThrottleState(); + if (object.throttlePercent != null) + message.throttlePercent = object.throttlePercent | 0; + return message; + }; + + /** + * Creates a plain object from a ThrottleState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.ThrottleState + * @static + * @param {google.cloud.bigquery.storage.v1.ThrottleState} message ThrottleState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ThrottleState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.throttlePercent = 0; + if (message.throttlePercent != null && message.hasOwnProperty("throttlePercent")) + object.throttlePercent = message.throttlePercent; + return object; + }; + + /** + * Converts this ThrottleState to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.ThrottleState + * @instance + * @returns {Object.} JSON object + */ + ThrottleState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ThrottleState; + })(); + + v1.StreamStats = (function() { + + /** + * Properties of a StreamStats. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IStreamStats + * @property {google.cloud.bigquery.storage.v1.StreamStats.IProgress|null} [progress] StreamStats progress + */ + + /** + * Constructs a new StreamStats. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a StreamStats. + * @implements IStreamStats + * @constructor + * @param {google.cloud.bigquery.storage.v1.IStreamStats=} [properties] Properties to set + */ + function StreamStats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamStats progress. + * @member {google.cloud.bigquery.storage.v1.StreamStats.IProgress|null|undefined} progress + * @memberof google.cloud.bigquery.storage.v1.StreamStats + * @instance + */ + StreamStats.prototype.progress = null; + + /** + * Creates a new StreamStats instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.StreamStats + * @static + * @param {google.cloud.bigquery.storage.v1.IStreamStats=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.StreamStats} StreamStats instance + */ + StreamStats.create = function create(properties) { + return new StreamStats(properties); + }; + + /** + * Encodes the specified StreamStats message. Does not implicitly {@link google.cloud.bigquery.storage.v1.StreamStats.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.StreamStats + * @static + * @param {google.cloud.bigquery.storage.v1.IStreamStats} message StreamStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamStats.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.progress != null && message.hasOwnProperty("progress")) + $root.google.cloud.bigquery.storage.v1.StreamStats.Progress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamStats message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.StreamStats.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.StreamStats + * @static + * @param {google.cloud.bigquery.storage.v1.IStreamStats} message StreamStats message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamStats.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamStats message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.StreamStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.StreamStats} StreamStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamStats.decode = function decode(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.storage.v1.StreamStats(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.progress = $root.google.cloud.bigquery.storage.v1.StreamStats.Progress.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamStats message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.StreamStats + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.StreamStats} StreamStats + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamStats.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamStats message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.StreamStats + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamStats.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.cloud.bigquery.storage.v1.StreamStats.Progress.verify(message.progress); + if (error) + return "progress." + error; + } + return null; + }; + + /** + * Creates a StreamStats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.StreamStats + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.StreamStats} StreamStats + */ + StreamStats.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.StreamStats) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.StreamStats(); + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.StreamStats.progress: object expected"); + message.progress = $root.google.cloud.bigquery.storage.v1.StreamStats.Progress.fromObject(object.progress); + } + return message; + }; + + /** + * Creates a plain object from a StreamStats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.StreamStats + * @static + * @param {google.cloud.bigquery.storage.v1.StreamStats} message StreamStats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamStats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.progress = null; + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.cloud.bigquery.storage.v1.StreamStats.Progress.toObject(message.progress, options); + return object; + }; + + /** + * Converts this StreamStats to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.StreamStats + * @instance + * @returns {Object.} JSON object + */ + StreamStats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + StreamStats.Progress = (function() { + + /** + * Properties of a Progress. + * @memberof google.cloud.bigquery.storage.v1.StreamStats + * @interface IProgress + * @property {number|null} [atResponseStart] Progress atResponseStart + * @property {number|null} [atResponseEnd] Progress atResponseEnd + */ + + /** + * Constructs a new Progress. + * @memberof google.cloud.bigquery.storage.v1.StreamStats + * @classdesc Represents a Progress. + * @implements IProgress + * @constructor + * @param {google.cloud.bigquery.storage.v1.StreamStats.IProgress=} [properties] Properties to set + */ + function Progress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Progress atResponseStart. + * @member {number} atResponseStart + * @memberof google.cloud.bigquery.storage.v1.StreamStats.Progress + * @instance + */ + Progress.prototype.atResponseStart = 0; + + /** + * Progress atResponseEnd. + * @member {number} atResponseEnd + * @memberof google.cloud.bigquery.storage.v1.StreamStats.Progress + * @instance + */ + Progress.prototype.atResponseEnd = 0; + + /** + * Creates a new Progress instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.StreamStats.Progress + * @static + * @param {google.cloud.bigquery.storage.v1.StreamStats.IProgress=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.StreamStats.Progress} Progress instance + */ + Progress.create = function create(properties) { + return new Progress(properties); + }; + + /** + * Encodes the specified Progress message. Does not implicitly {@link google.cloud.bigquery.storage.v1.StreamStats.Progress.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.StreamStats.Progress + * @static + * @param {google.cloud.bigquery.storage.v1.StreamStats.IProgress} message Progress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Progress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.atResponseStart != null && message.hasOwnProperty("atResponseStart")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.atResponseStart); + if (message.atResponseEnd != null && message.hasOwnProperty("atResponseEnd")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.atResponseEnd); + return writer; + }; + + /** + * Encodes the specified Progress message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.StreamStats.Progress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.StreamStats.Progress + * @static + * @param {google.cloud.bigquery.storage.v1.StreamStats.IProgress} message Progress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Progress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Progress message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.StreamStats.Progress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.StreamStats.Progress} Progress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Progress.decode = function decode(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.storage.v1.StreamStats.Progress(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.atResponseStart = reader.double(); + break; + case 2: + message.atResponseEnd = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Progress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.StreamStats.Progress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.StreamStats.Progress} Progress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Progress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Progress message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.StreamStats.Progress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Progress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.atResponseStart != null && message.hasOwnProperty("atResponseStart")) + if (typeof message.atResponseStart !== "number") + return "atResponseStart: number expected"; + if (message.atResponseEnd != null && message.hasOwnProperty("atResponseEnd")) + if (typeof message.atResponseEnd !== "number") + return "atResponseEnd: number expected"; + return null; + }; + + /** + * Creates a Progress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.StreamStats.Progress + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.StreamStats.Progress} Progress + */ + Progress.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.StreamStats.Progress) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.StreamStats.Progress(); + if (object.atResponseStart != null) + message.atResponseStart = Number(object.atResponseStart); + if (object.atResponseEnd != null) + message.atResponseEnd = Number(object.atResponseEnd); + return message; + }; + + /** + * Creates a plain object from a Progress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.StreamStats.Progress + * @static + * @param {google.cloud.bigquery.storage.v1.StreamStats.Progress} message Progress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Progress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.atResponseStart = 0; + object.atResponseEnd = 0; + } + if (message.atResponseStart != null && message.hasOwnProperty("atResponseStart")) + object.atResponseStart = options.json && !isFinite(message.atResponseStart) ? String(message.atResponseStart) : message.atResponseStart; + if (message.atResponseEnd != null && message.hasOwnProperty("atResponseEnd")) + object.atResponseEnd = options.json && !isFinite(message.atResponseEnd) ? String(message.atResponseEnd) : message.atResponseEnd; + return object; + }; + + /** + * Converts this Progress to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.StreamStats.Progress + * @instance + * @returns {Object.} JSON object + */ + Progress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Progress; + })(); + + return StreamStats; + })(); + + v1.ReadRowsResponse = (function() { + + /** + * Properties of a ReadRowsResponse. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IReadRowsResponse + * @property {google.cloud.bigquery.storage.v1.IAvroRows|null} [avroRows] ReadRowsResponse avroRows + * @property {google.cloud.bigquery.storage.v1.IArrowRecordBatch|null} [arrowRecordBatch] ReadRowsResponse arrowRecordBatch + * @property {number|Long|null} [rowCount] ReadRowsResponse rowCount + * @property {google.cloud.bigquery.storage.v1.IStreamStats|null} [stats] ReadRowsResponse stats + * @property {google.cloud.bigquery.storage.v1.IThrottleState|null} [throttleState] ReadRowsResponse throttleState + */ + + /** + * Constructs a new ReadRowsResponse. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a ReadRowsResponse. + * @implements IReadRowsResponse + * @constructor + * @param {google.cloud.bigquery.storage.v1.IReadRowsResponse=} [properties] Properties to set + */ + function ReadRowsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadRowsResponse avroRows. + * @member {google.cloud.bigquery.storage.v1.IAvroRows|null|undefined} avroRows + * @memberof google.cloud.bigquery.storage.v1.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.avroRows = null; + + /** + * ReadRowsResponse arrowRecordBatch. + * @member {google.cloud.bigquery.storage.v1.IArrowRecordBatch|null|undefined} arrowRecordBatch + * @memberof google.cloud.bigquery.storage.v1.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.arrowRecordBatch = null; + + /** + * ReadRowsResponse rowCount. + * @member {number|Long} rowCount + * @memberof google.cloud.bigquery.storage.v1.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.rowCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReadRowsResponse stats. + * @member {google.cloud.bigquery.storage.v1.IStreamStats|null|undefined} stats + * @memberof google.cloud.bigquery.storage.v1.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.stats = null; + + /** + * ReadRowsResponse throttleState. + * @member {google.cloud.bigquery.storage.v1.IThrottleState|null|undefined} throttleState + * @memberof google.cloud.bigquery.storage.v1.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.throttleState = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReadRowsResponse rows. + * @member {"avroRows"|"arrowRecordBatch"|undefined} rows + * @memberof google.cloud.bigquery.storage.v1.ReadRowsResponse + * @instance + */ + Object.defineProperty(ReadRowsResponse.prototype, "rows", { + get: $util.oneOfGetter($oneOfFields = ["avroRows", "arrowRecordBatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReadRowsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.ReadRowsResponse + * @static + * @param {google.cloud.bigquery.storage.v1.IReadRowsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.ReadRowsResponse} ReadRowsResponse instance + */ + ReadRowsResponse.create = function create(properties) { + return new ReadRowsResponse(properties); + }; + + /** + * Encodes the specified ReadRowsResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadRowsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.ReadRowsResponse + * @static + * @param {google.cloud.bigquery.storage.v1.IReadRowsResponse} message ReadRowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadRowsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stats != null && message.hasOwnProperty("stats")) + $root.google.cloud.bigquery.storage.v1.StreamStats.encode(message.stats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.avroRows != null && message.hasOwnProperty("avroRows")) + $root.google.cloud.bigquery.storage.v1.AvroRows.encode(message.avroRows, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.arrowRecordBatch != null && message.hasOwnProperty("arrowRecordBatch")) + $root.google.cloud.bigquery.storage.v1.ArrowRecordBatch.encode(message.arrowRecordBatch, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.throttleState != null && message.hasOwnProperty("throttleState")) + $root.google.cloud.bigquery.storage.v1.ThrottleState.encode(message.throttleState, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.rowCount); + return writer; + }; + + /** + * Encodes the specified ReadRowsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadRowsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ReadRowsResponse + * @static + * @param {google.cloud.bigquery.storage.v1.IReadRowsResponse} message ReadRowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadRowsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadRowsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.ReadRowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.ReadRowsResponse} ReadRowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadRowsResponse.decode = function decode(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.storage.v1.ReadRowsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.avroRows = $root.google.cloud.bigquery.storage.v1.AvroRows.decode(reader, reader.uint32()); + break; + case 4: + message.arrowRecordBatch = $root.google.cloud.bigquery.storage.v1.ArrowRecordBatch.decode(reader, reader.uint32()); + break; + case 6: + message.rowCount = reader.int64(); + break; + case 2: + message.stats = $root.google.cloud.bigquery.storage.v1.StreamStats.decode(reader, reader.uint32()); + break; + case 5: + message.throttleState = $root.google.cloud.bigquery.storage.v1.ThrottleState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadRowsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ReadRowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.ReadRowsResponse} ReadRowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadRowsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadRowsResponse message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.ReadRowsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadRowsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.avroRows != null && message.hasOwnProperty("avroRows")) { + properties.rows = 1; + { + var error = $root.google.cloud.bigquery.storage.v1.AvroRows.verify(message.avroRows); + if (error) + return "avroRows." + error; + } + } + if (message.arrowRecordBatch != null && message.hasOwnProperty("arrowRecordBatch")) { + if (properties.rows === 1) + return "rows: multiple values"; + properties.rows = 1; + { + var error = $root.google.cloud.bigquery.storage.v1.ArrowRecordBatch.verify(message.arrowRecordBatch); + if (error) + return "arrowRecordBatch." + error; + } + } + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (!$util.isInteger(message.rowCount) && !(message.rowCount && $util.isInteger(message.rowCount.low) && $util.isInteger(message.rowCount.high))) + return "rowCount: integer|Long expected"; + if (message.stats != null && message.hasOwnProperty("stats")) { + var error = $root.google.cloud.bigquery.storage.v1.StreamStats.verify(message.stats); + if (error) + return "stats." + error; + } + if (message.throttleState != null && message.hasOwnProperty("throttleState")) { + var error = $root.google.cloud.bigquery.storage.v1.ThrottleState.verify(message.throttleState); + if (error) + return "throttleState." + error; + } + return null; + }; + + /** + * Creates a ReadRowsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.ReadRowsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.ReadRowsResponse} ReadRowsResponse + */ + ReadRowsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.ReadRowsResponse) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.ReadRowsResponse(); + if (object.avroRows != null) { + if (typeof object.avroRows !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ReadRowsResponse.avroRows: object expected"); + message.avroRows = $root.google.cloud.bigquery.storage.v1.AvroRows.fromObject(object.avroRows); + } + if (object.arrowRecordBatch != null) { + if (typeof object.arrowRecordBatch !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ReadRowsResponse.arrowRecordBatch: object expected"); + message.arrowRecordBatch = $root.google.cloud.bigquery.storage.v1.ArrowRecordBatch.fromObject(object.arrowRecordBatch); + } + if (object.rowCount != null) + if ($util.Long) + (message.rowCount = $util.Long.fromValue(object.rowCount)).unsigned = false; + else if (typeof object.rowCount === "string") + message.rowCount = parseInt(object.rowCount, 10); + else if (typeof object.rowCount === "number") + message.rowCount = object.rowCount; + else if (typeof object.rowCount === "object") + message.rowCount = new $util.LongBits(object.rowCount.low >>> 0, object.rowCount.high >>> 0).toNumber(); + if (object.stats != null) { + if (typeof object.stats !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ReadRowsResponse.stats: object expected"); + message.stats = $root.google.cloud.bigquery.storage.v1.StreamStats.fromObject(object.stats); + } + if (object.throttleState != null) { + if (typeof object.throttleState !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ReadRowsResponse.throttleState: object expected"); + message.throttleState = $root.google.cloud.bigquery.storage.v1.ThrottleState.fromObject(object.throttleState); + } + return message; + }; + + /** + * Creates a plain object from a ReadRowsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.ReadRowsResponse + * @static + * @param {google.cloud.bigquery.storage.v1.ReadRowsResponse} message ReadRowsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadRowsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.stats = null; + object.throttleState = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rowCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowCount = options.longs === String ? "0" : 0; + } + if (message.stats != null && message.hasOwnProperty("stats")) + object.stats = $root.google.cloud.bigquery.storage.v1.StreamStats.toObject(message.stats, options); + if (message.avroRows != null && message.hasOwnProperty("avroRows")) { + object.avroRows = $root.google.cloud.bigquery.storage.v1.AvroRows.toObject(message.avroRows, options); + if (options.oneofs) + object.rows = "avroRows"; + } + if (message.arrowRecordBatch != null && message.hasOwnProperty("arrowRecordBatch")) { + object.arrowRecordBatch = $root.google.cloud.bigquery.storage.v1.ArrowRecordBatch.toObject(message.arrowRecordBatch, options); + if (options.oneofs) + object.rows = "arrowRecordBatch"; + } + if (message.throttleState != null && message.hasOwnProperty("throttleState")) + object.throttleState = $root.google.cloud.bigquery.storage.v1.ThrottleState.toObject(message.throttleState, options); + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (typeof message.rowCount === "number") + object.rowCount = options.longs === String ? String(message.rowCount) : message.rowCount; + else + object.rowCount = options.longs === String ? $util.Long.prototype.toString.call(message.rowCount) : options.longs === Number ? new $util.LongBits(message.rowCount.low >>> 0, message.rowCount.high >>> 0).toNumber() : message.rowCount; + return object; + }; + + /** + * Converts this ReadRowsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.ReadRowsResponse + * @instance + * @returns {Object.} JSON object + */ + ReadRowsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReadRowsResponse; + })(); + + v1.SplitReadStreamRequest = (function() { + + /** + * Properties of a SplitReadStreamRequest. + * @memberof google.cloud.bigquery.storage.v1 + * @interface ISplitReadStreamRequest + * @property {string|null} [name] SplitReadStreamRequest name + * @property {number|null} [fraction] SplitReadStreamRequest fraction + */ + + /** + * Constructs a new SplitReadStreamRequest. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a SplitReadStreamRequest. + * @implements ISplitReadStreamRequest + * @constructor + * @param {google.cloud.bigquery.storage.v1.ISplitReadStreamRequest=} [properties] Properties to set + */ + function SplitReadStreamRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SplitReadStreamRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamRequest + * @instance + */ + SplitReadStreamRequest.prototype.name = ""; + + /** + * SplitReadStreamRequest fraction. + * @member {number} fraction + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamRequest + * @instance + */ + SplitReadStreamRequest.prototype.fraction = 0; + + /** + * Creates a new SplitReadStreamRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1.ISplitReadStreamRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.SplitReadStreamRequest} SplitReadStreamRequest instance + */ + SplitReadStreamRequest.create = function create(properties) { + return new SplitReadStreamRequest(properties); + }; + + /** + * Encodes the specified SplitReadStreamRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1.SplitReadStreamRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1.ISplitReadStreamRequest} message SplitReadStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitReadStreamRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.fraction != null && message.hasOwnProperty("fraction")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.fraction); + return writer; + }; + + /** + * Encodes the specified SplitReadStreamRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.SplitReadStreamRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1.ISplitReadStreamRequest} message SplitReadStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitReadStreamRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SplitReadStreamRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.SplitReadStreamRequest} SplitReadStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitReadStreamRequest.decode = function decode(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.storage.v1.SplitReadStreamRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.fraction = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SplitReadStreamRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.SplitReadStreamRequest} SplitReadStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitReadStreamRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SplitReadStreamRequest message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SplitReadStreamRequest.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.fraction != null && message.hasOwnProperty("fraction")) + if (typeof message.fraction !== "number") + return "fraction: number expected"; + return null; + }; + + /** + * Creates a SplitReadStreamRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.SplitReadStreamRequest} SplitReadStreamRequest + */ + SplitReadStreamRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.SplitReadStreamRequest) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.SplitReadStreamRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.fraction != null) + message.fraction = Number(object.fraction); + return message; + }; + + /** + * Creates a plain object from a SplitReadStreamRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1.SplitReadStreamRequest} message SplitReadStreamRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SplitReadStreamRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.fraction = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.fraction != null && message.hasOwnProperty("fraction")) + object.fraction = options.json && !isFinite(message.fraction) ? String(message.fraction) : message.fraction; + return object; + }; + + /** + * Converts this SplitReadStreamRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamRequest + * @instance + * @returns {Object.} JSON object + */ + SplitReadStreamRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SplitReadStreamRequest; + })(); + + v1.SplitReadStreamResponse = (function() { + + /** + * Properties of a SplitReadStreamResponse. + * @memberof google.cloud.bigquery.storage.v1 + * @interface ISplitReadStreamResponse + * @property {google.cloud.bigquery.storage.v1.IReadStream|null} [primaryStream] SplitReadStreamResponse primaryStream + * @property {google.cloud.bigquery.storage.v1.IReadStream|null} [remainderStream] SplitReadStreamResponse remainderStream + */ + + /** + * Constructs a new SplitReadStreamResponse. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a SplitReadStreamResponse. + * @implements ISplitReadStreamResponse + * @constructor + * @param {google.cloud.bigquery.storage.v1.ISplitReadStreamResponse=} [properties] Properties to set + */ + function SplitReadStreamResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SplitReadStreamResponse primaryStream. + * @member {google.cloud.bigquery.storage.v1.IReadStream|null|undefined} primaryStream + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamResponse + * @instance + */ + SplitReadStreamResponse.prototype.primaryStream = null; + + /** + * SplitReadStreamResponse remainderStream. + * @member {google.cloud.bigquery.storage.v1.IReadStream|null|undefined} remainderStream + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamResponse + * @instance + */ + SplitReadStreamResponse.prototype.remainderStream = null; + + /** + * Creates a new SplitReadStreamResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamResponse + * @static + * @param {google.cloud.bigquery.storage.v1.ISplitReadStreamResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.SplitReadStreamResponse} SplitReadStreamResponse instance + */ + SplitReadStreamResponse.create = function create(properties) { + return new SplitReadStreamResponse(properties); + }; + + /** + * Encodes the specified SplitReadStreamResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1.SplitReadStreamResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamResponse + * @static + * @param {google.cloud.bigquery.storage.v1.ISplitReadStreamResponse} message SplitReadStreamResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitReadStreamResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.primaryStream != null && message.hasOwnProperty("primaryStream")) + $root.google.cloud.bigquery.storage.v1.ReadStream.encode(message.primaryStream, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.remainderStream != null && message.hasOwnProperty("remainderStream")) + $root.google.cloud.bigquery.storage.v1.ReadStream.encode(message.remainderStream, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SplitReadStreamResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.SplitReadStreamResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamResponse + * @static + * @param {google.cloud.bigquery.storage.v1.ISplitReadStreamResponse} message SplitReadStreamResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitReadStreamResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SplitReadStreamResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.SplitReadStreamResponse} SplitReadStreamResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitReadStreamResponse.decode = function decode(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.storage.v1.SplitReadStreamResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.primaryStream = $root.google.cloud.bigquery.storage.v1.ReadStream.decode(reader, reader.uint32()); + break; + case 2: + message.remainderStream = $root.google.cloud.bigquery.storage.v1.ReadStream.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SplitReadStreamResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.SplitReadStreamResponse} SplitReadStreamResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitReadStreamResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SplitReadStreamResponse message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SplitReadStreamResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.primaryStream != null && message.hasOwnProperty("primaryStream")) { + var error = $root.google.cloud.bigquery.storage.v1.ReadStream.verify(message.primaryStream); + if (error) + return "primaryStream." + error; + } + if (message.remainderStream != null && message.hasOwnProperty("remainderStream")) { + var error = $root.google.cloud.bigquery.storage.v1.ReadStream.verify(message.remainderStream); + if (error) + return "remainderStream." + error; + } + return null; + }; + + /** + * Creates a SplitReadStreamResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.SplitReadStreamResponse} SplitReadStreamResponse + */ + SplitReadStreamResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.SplitReadStreamResponse) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.SplitReadStreamResponse(); + if (object.primaryStream != null) { + if (typeof object.primaryStream !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.SplitReadStreamResponse.primaryStream: object expected"); + message.primaryStream = $root.google.cloud.bigquery.storage.v1.ReadStream.fromObject(object.primaryStream); + } + if (object.remainderStream != null) { + if (typeof object.remainderStream !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.SplitReadStreamResponse.remainderStream: object expected"); + message.remainderStream = $root.google.cloud.bigquery.storage.v1.ReadStream.fromObject(object.remainderStream); + } + return message; + }; + + /** + * Creates a plain object from a SplitReadStreamResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamResponse + * @static + * @param {google.cloud.bigquery.storage.v1.SplitReadStreamResponse} message SplitReadStreamResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SplitReadStreamResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.primaryStream = null; + object.remainderStream = null; + } + if (message.primaryStream != null && message.hasOwnProperty("primaryStream")) + object.primaryStream = $root.google.cloud.bigquery.storage.v1.ReadStream.toObject(message.primaryStream, options); + if (message.remainderStream != null && message.hasOwnProperty("remainderStream")) + object.remainderStream = $root.google.cloud.bigquery.storage.v1.ReadStream.toObject(message.remainderStream, options); + return object; + }; + + /** + * Converts this SplitReadStreamResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamResponse + * @instance + * @returns {Object.} JSON object + */ + SplitReadStreamResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SplitReadStreamResponse; + })(); + + /** + * DataFormat enum. + * @name google.cloud.bigquery.storage.v1.DataFormat + * @enum {string} + * @property {number} DATA_FORMAT_UNSPECIFIED=0 DATA_FORMAT_UNSPECIFIED value + * @property {number} AVRO=1 AVRO value + * @property {number} ARROW=2 ARROW value + */ + v1.DataFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "AVRO"] = 1; + values[valuesById[2] = "ARROW"] = 2; + return values; + })(); + + v1.ReadSession = (function() { + + /** + * Properties of a ReadSession. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IReadSession + * @property {string|null} [name] ReadSession name + * @property {google.protobuf.ITimestamp|null} [expireTime] ReadSession expireTime + * @property {google.cloud.bigquery.storage.v1.DataFormat|null} [dataFormat] ReadSession dataFormat + * @property {google.cloud.bigquery.storage.v1.IAvroSchema|null} [avroSchema] ReadSession avroSchema + * @property {google.cloud.bigquery.storage.v1.IArrowSchema|null} [arrowSchema] ReadSession arrowSchema + * @property {string|null} [table] ReadSession table + * @property {google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers|null} [tableModifiers] ReadSession tableModifiers + * @property {google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions|null} [readOptions] ReadSession readOptions + * @property {Array.|null} [streams] ReadSession streams + */ + + /** + * Constructs a new ReadSession. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a ReadSession. + * @implements IReadSession + * @constructor + * @param {google.cloud.bigquery.storage.v1.IReadSession=} [properties] Properties to set + */ + function ReadSession(properties) { + this.streams = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadSession name. + * @member {string} name + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @instance + */ + ReadSession.prototype.name = ""; + + /** + * ReadSession expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @instance + */ + ReadSession.prototype.expireTime = null; + + /** + * ReadSession dataFormat. + * @member {google.cloud.bigquery.storage.v1.DataFormat} dataFormat + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @instance + */ + ReadSession.prototype.dataFormat = 0; + + /** + * ReadSession avroSchema. + * @member {google.cloud.bigquery.storage.v1.IAvroSchema|null|undefined} avroSchema + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @instance + */ + ReadSession.prototype.avroSchema = null; + + /** + * ReadSession arrowSchema. + * @member {google.cloud.bigquery.storage.v1.IArrowSchema|null|undefined} arrowSchema + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @instance + */ + ReadSession.prototype.arrowSchema = null; + + /** + * ReadSession table. + * @member {string} table + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @instance + */ + ReadSession.prototype.table = ""; + + /** + * ReadSession tableModifiers. + * @member {google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers|null|undefined} tableModifiers + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @instance + */ + ReadSession.prototype.tableModifiers = null; + + /** + * ReadSession readOptions. + * @member {google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions|null|undefined} readOptions + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @instance + */ + ReadSession.prototype.readOptions = null; + + /** + * ReadSession streams. + * @member {Array.} streams + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @instance + */ + ReadSession.prototype.streams = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReadSession schema. + * @member {"avroSchema"|"arrowSchema"|undefined} schema + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @instance + */ + Object.defineProperty(ReadSession.prototype, "schema", { + get: $util.oneOfGetter($oneOfFields = ["avroSchema", "arrowSchema"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReadSession instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @static + * @param {google.cloud.bigquery.storage.v1.IReadSession=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.ReadSession} ReadSession instance + */ + ReadSession.create = function create(properties) { + return new ReadSession(properties); + }; + + /** + * Encodes the specified ReadSession message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @static + * @param {google.cloud.bigquery.storage.v1.IReadSession} message ReadSession message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadSession.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.dataFormat); + if (message.avroSchema != null && message.hasOwnProperty("avroSchema")) + $root.google.cloud.bigquery.storage.v1.AvroSchema.encode(message.avroSchema, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.arrowSchema != null && message.hasOwnProperty("arrowSchema")) + $root.google.cloud.bigquery.storage.v1.ArrowSchema.encode(message.arrowSchema, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.table != null && message.hasOwnProperty("table")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.table); + if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) + $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.encode(message.tableModifiers, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.readOptions != null && message.hasOwnProperty("readOptions")) + $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.encode(message.readOptions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.streams != null && message.streams.length) + for (var i = 0; i < message.streams.length; ++i) + $root.google.cloud.bigquery.storage.v1.ReadStream.encode(message.streams[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadSession message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @static + * @param {google.cloud.bigquery.storage.v1.IReadSession} message ReadSession message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadSession.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadSession message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.ReadSession} ReadSession + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadSession.decode = function decode(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.storage.v1.ReadSession(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.dataFormat = reader.int32(); + break; + case 4: + message.avroSchema = $root.google.cloud.bigquery.storage.v1.AvroSchema.decode(reader, reader.uint32()); + break; + case 5: + message.arrowSchema = $root.google.cloud.bigquery.storage.v1.ArrowSchema.decode(reader, reader.uint32()); + break; + case 6: + message.table = reader.string(); + break; + case 7: + message.tableModifiers = $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.decode(reader, reader.uint32()); + break; + case 8: + message.readOptions = $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.decode(reader, reader.uint32()); + break; + case 10: + if (!(message.streams && message.streams.length)) + message.streams = []; + message.streams.push($root.google.cloud.bigquery.storage.v1.ReadStream.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadSession message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.ReadSession} ReadSession + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadSession.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadSession message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadSession.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + switch (message.dataFormat) { + default: + return "dataFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.avroSchema != null && message.hasOwnProperty("avroSchema")) { + properties.schema = 1; + { + var error = $root.google.cloud.bigquery.storage.v1.AvroSchema.verify(message.avroSchema); + if (error) + return "avroSchema." + error; + } + } + if (message.arrowSchema != null && message.hasOwnProperty("arrowSchema")) { + if (properties.schema === 1) + return "schema: multiple values"; + properties.schema = 1; + { + var error = $root.google.cloud.bigquery.storage.v1.ArrowSchema.verify(message.arrowSchema); + if (error) + return "arrowSchema." + error; + } + } + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) { + var error = $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.verify(message.tableModifiers); + if (error) + return "tableModifiers." + error; + } + if (message.readOptions != null && message.hasOwnProperty("readOptions")) { + var error = $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.verify(message.readOptions); + if (error) + return "readOptions." + error; + } + if (message.streams != null && message.hasOwnProperty("streams")) { + if (!Array.isArray(message.streams)) + return "streams: array expected"; + for (var i = 0; i < message.streams.length; ++i) { + var error = $root.google.cloud.bigquery.storage.v1.ReadStream.verify(message.streams[i]); + if (error) + return "streams." + error; + } + } + return null; + }; + + /** + * Creates a ReadSession message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.ReadSession} ReadSession + */ + ReadSession.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.ReadSession) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.ReadSession(); + if (object.name != null) + message.name = String(object.name); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + switch (object.dataFormat) { + case "DATA_FORMAT_UNSPECIFIED": + case 0: + message.dataFormat = 0; + break; + case "AVRO": + case 1: + message.dataFormat = 1; + break; + case "ARROW": + case 2: + message.dataFormat = 2; + break; + } + if (object.avroSchema != null) { + if (typeof object.avroSchema !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.avroSchema: object expected"); + message.avroSchema = $root.google.cloud.bigquery.storage.v1.AvroSchema.fromObject(object.avroSchema); + } + if (object.arrowSchema != null) { + if (typeof object.arrowSchema !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.arrowSchema: object expected"); + message.arrowSchema = $root.google.cloud.bigquery.storage.v1.ArrowSchema.fromObject(object.arrowSchema); + } + if (object.table != null) + message.table = String(object.table); + if (object.tableModifiers != null) { + if (typeof object.tableModifiers !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.tableModifiers: object expected"); + message.tableModifiers = $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.fromObject(object.tableModifiers); + } + if (object.readOptions != null) { + if (typeof object.readOptions !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.readOptions: object expected"); + message.readOptions = $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.fromObject(object.readOptions); + } + if (object.streams) { + if (!Array.isArray(object.streams)) + throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.streams: array expected"); + message.streams = []; + for (var i = 0; i < object.streams.length; ++i) { + if (typeof object.streams[i] !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.streams: object expected"); + message.streams[i] = $root.google.cloud.bigquery.storage.v1.ReadStream.fromObject(object.streams[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ReadSession message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @static + * @param {google.cloud.bigquery.storage.v1.ReadSession} message ReadSession + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadSession.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.streams = []; + if (options.defaults) { + object.name = ""; + object.expireTime = null; + object.dataFormat = options.enums === String ? "DATA_FORMAT_UNSPECIFIED" : 0; + object.table = ""; + object.tableModifiers = null; + object.readOptions = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + object.dataFormat = options.enums === String ? $root.google.cloud.bigquery.storage.v1.DataFormat[message.dataFormat] : message.dataFormat; + if (message.avroSchema != null && message.hasOwnProperty("avroSchema")) { + object.avroSchema = $root.google.cloud.bigquery.storage.v1.AvroSchema.toObject(message.avroSchema, options); + if (options.oneofs) + object.schema = "avroSchema"; + } + if (message.arrowSchema != null && message.hasOwnProperty("arrowSchema")) { + object.arrowSchema = $root.google.cloud.bigquery.storage.v1.ArrowSchema.toObject(message.arrowSchema, options); + if (options.oneofs) + object.schema = "arrowSchema"; + } + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) + object.tableModifiers = $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.toObject(message.tableModifiers, options); + if (message.readOptions != null && message.hasOwnProperty("readOptions")) + object.readOptions = $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.toObject(message.readOptions, options); + if (message.streams && message.streams.length) { + object.streams = []; + for (var j = 0; j < message.streams.length; ++j) + object.streams[j] = $root.google.cloud.bigquery.storage.v1.ReadStream.toObject(message.streams[j], options); + } + return object; + }; + + /** + * Converts this ReadSession to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @instance + * @returns {Object.} JSON object + */ + ReadSession.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ReadSession.TableModifiers = (function() { + + /** + * Properties of a TableModifiers. + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @interface ITableModifiers + * @property {google.protobuf.ITimestamp|null} [snapshotTime] TableModifiers snapshotTime + */ + + /** + * Constructs a new TableModifiers. + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @classdesc Represents a TableModifiers. + * @implements ITableModifiers + * @constructor + * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers=} [properties] Properties to set + */ + function TableModifiers(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableModifiers snapshotTime. + * @member {google.protobuf.ITimestamp|null|undefined} snapshotTime + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @instance + */ + TableModifiers.prototype.snapshotTime = null; + + /** + * Creates a new TableModifiers instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @static + * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableModifiers} TableModifiers instance + */ + TableModifiers.create = function create(properties) { + return new TableModifiers(properties); + }; + + /** + * Encodes the specified TableModifiers message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @static + * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers} message TableModifiers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableModifiers.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) + $root.google.protobuf.Timestamp.encode(message.snapshotTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TableModifiers message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @static + * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers} message TableModifiers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableModifiers.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableModifiers message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableModifiers} TableModifiers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableModifiers.decode = function decode(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.storage.v1.ReadSession.TableModifiers(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.snapshotTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableModifiers message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableModifiers} TableModifiers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableModifiers.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableModifiers message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableModifiers.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.snapshotTime); + if (error) + return "snapshotTime." + error; + } + return null; + }; + + /** + * Creates a TableModifiers message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableModifiers} TableModifiers + */ + TableModifiers.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers(); + if (object.snapshotTime != null) { + if (typeof object.snapshotTime !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.snapshotTime: object expected"); + message.snapshotTime = $root.google.protobuf.Timestamp.fromObject(object.snapshotTime); + } + return message; + }; + + /** + * Creates a plain object from a TableModifiers message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @static + * @param {google.cloud.bigquery.storage.v1.ReadSession.TableModifiers} message TableModifiers + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableModifiers.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.snapshotTime = null; + if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) + object.snapshotTime = $root.google.protobuf.Timestamp.toObject(message.snapshotTime, options); + return object; + }; + + /** + * Converts this TableModifiers to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @instance + * @returns {Object.} JSON object + */ + TableModifiers.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TableModifiers; + })(); + + ReadSession.TableReadOptions = (function() { + + /** + * Properties of a TableReadOptions. + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @interface ITableReadOptions + * @property {Array.|null} [selectedFields] TableReadOptions selectedFields + * @property {string|null} [rowRestriction] TableReadOptions rowRestriction + */ + + /** + * Constructs a new TableReadOptions. + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @classdesc Represents a TableReadOptions. + * @implements ITableReadOptions + * @constructor + * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions=} [properties] Properties to set + */ + function TableReadOptions(properties) { + this.selectedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableReadOptions selectedFields. + * @member {Array.} selectedFields + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @instance + */ + TableReadOptions.prototype.selectedFields = $util.emptyArray; + + /** + * TableReadOptions rowRestriction. + * @member {string} rowRestriction + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @instance + */ + TableReadOptions.prototype.rowRestriction = ""; + + /** + * Creates a new TableReadOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @static + * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions} TableReadOptions instance + */ + TableReadOptions.create = function create(properties) { + return new TableReadOptions(properties); + }; + + /** + * Encodes the specified TableReadOptions message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @static + * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions} message TableReadOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableReadOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selectedFields != null && message.selectedFields.length) + for (var i = 0; i < message.selectedFields.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectedFields[i]); + if (message.rowRestriction != null && message.hasOwnProperty("rowRestriction")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rowRestriction); + return writer; + }; + + /** + * Encodes the specified TableReadOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @static + * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions} message TableReadOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableReadOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableReadOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions} TableReadOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableReadOptions.decode = function decode(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.storage.v1.ReadSession.TableReadOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.selectedFields && message.selectedFields.length)) + message.selectedFields = []; + message.selectedFields.push(reader.string()); + break; + case 2: + message.rowRestriction = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableReadOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions} TableReadOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableReadOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableReadOptions message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableReadOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selectedFields != null && message.hasOwnProperty("selectedFields")) { + if (!Array.isArray(message.selectedFields)) + return "selectedFields: array expected"; + for (var i = 0; i < message.selectedFields.length; ++i) + if (!$util.isString(message.selectedFields[i])) + return "selectedFields: string[] expected"; + } + if (message.rowRestriction != null && message.hasOwnProperty("rowRestriction")) + if (!$util.isString(message.rowRestriction)) + return "rowRestriction: string expected"; + return null; + }; + + /** + * Creates a TableReadOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions} TableReadOptions + */ + TableReadOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions(); + if (object.selectedFields) { + if (!Array.isArray(object.selectedFields)) + throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.selectedFields: array expected"); + message.selectedFields = []; + for (var i = 0; i < object.selectedFields.length; ++i) + message.selectedFields[i] = String(object.selectedFields[i]); + } + if (object.rowRestriction != null) + message.rowRestriction = String(object.rowRestriction); + return message; + }; + + /** + * Creates a plain object from a TableReadOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @static + * @param {google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions} message TableReadOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableReadOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.selectedFields = []; + if (options.defaults) + object.rowRestriction = ""; + if (message.selectedFields && message.selectedFields.length) { + object.selectedFields = []; + for (var j = 0; j < message.selectedFields.length; ++j) + object.selectedFields[j] = message.selectedFields[j]; + } + if (message.rowRestriction != null && message.hasOwnProperty("rowRestriction")) + object.rowRestriction = message.rowRestriction; + return object; + }; + + /** + * Converts this TableReadOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @instance + * @returns {Object.} JSON object + */ + TableReadOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TableReadOptions; + })(); + + return ReadSession; + })(); + + v1.ReadStream = (function() { + + /** + * Properties of a ReadStream. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IReadStream + * @property {string|null} [name] ReadStream name + */ + + /** + * Constructs a new ReadStream. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a ReadStream. + * @implements IReadStream + * @constructor + * @param {google.cloud.bigquery.storage.v1.IReadStream=} [properties] Properties to set + */ + function ReadStream(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadStream name. + * @member {string} name + * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @instance + */ + ReadStream.prototype.name = ""; + + /** + * Creates a new ReadStream instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @static + * @param {google.cloud.bigquery.storage.v1.IReadStream=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.ReadStream} ReadStream instance + */ + ReadStream.create = function create(properties) { + return new ReadStream(properties); + }; + + /** + * Encodes the specified ReadStream message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadStream.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @static + * @param {google.cloud.bigquery.storage.v1.IReadStream} message ReadStream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadStream.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified ReadStream message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadStream.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @static + * @param {google.cloud.bigquery.storage.v1.IReadStream} message ReadStream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadStream.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadStream message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.ReadStream} ReadStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadStream.decode = function decode(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.storage.v1.ReadStream(); + 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 ReadStream message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.ReadStream} ReadStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadStream.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadStream message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadStream.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 ReadStream message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.ReadStream} ReadStream + */ + ReadStream.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.ReadStream) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.ReadStream(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a ReadStream message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @static + * @param {google.cloud.bigquery.storage.v1.ReadStream} message ReadStream + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadStream.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 ReadStream to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @instance + * @returns {Object.} JSON object + */ + ReadStream.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReadStream; + })(); + + return v1; + })(); + storage.v1beta1 = (function() { /** diff --git a/packages/google-cloud-bigquery-storage/protos/protos.json b/packages/google-cloud-bigquery-storage/protos/protos.json index 6f3c1689461..b14e1b22555 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.json +++ b/packages/google-cloud-bigquery-storage/protos/protos.json @@ -8,6 +8,348 @@ "nested": { "storage": { "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.BigQuery.Storage.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1;storage", + "java_multiple_files": true, + "java_outer_classname": "StreamProto", + "java_package": "com.google.cloud.bigquery.storage.v1", + "php_namespace": "Google\\Cloud\\BigQuery\\Storage\\V1", + "(google.api.resource_definition).type": "bigquery.googleapis.com/Table", + "(google.api.resource_definition).pattern": "projects/{project}/datasets/{dataset}/tables/{table}" + }, + "nested": { + "ArrowSchema": { + "fields": { + "serializedSchema": { + "type": "bytes", + "id": 1 + } + } + }, + "ArrowRecordBatch": { + "fields": { + "serializedRecordBatch": { + "type": "bytes", + "id": 1 + }, + "rowCount": { + "type": "int64", + "id": 2 + } + } + }, + "AvroSchema": { + "fields": { + "schema": { + "type": "string", + "id": 1 + } + } + }, + "AvroRows": { + "fields": { + "serializedBinaryRows": { + "type": "bytes", + "id": 1 + }, + "rowCount": { + "type": "int64", + "id": 2 + } + } + }, + "BigQueryRead": { + "options": { + "(google.api.default_host)": "bigquerystorage.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/bigquery.readonly,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateReadSession": { + "requestType": "CreateReadSessionRequest", + "responseType": "ReadSession", + "options": { + "(google.api.http).post": "/v1/{read_session.table=projects/*/datasets/*/tables/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,read_session,max_stream_count" + } + }, + "ReadRows": { + "requestType": "ReadRowsRequest", + "responseType": "ReadRowsResponse", + "responseStream": true, + "options": { + "(google.api.http).get": "/v1/{read_stream=projects/*/locations/*/sessions/*/streams/*}", + "(google.api.method_signature)": "read_stream,offset" + } + }, + "SplitReadStream": { + "requestType": "SplitReadStreamRequest", + "responseType": "SplitReadStreamResponse", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/sessions/*/streams/*}" + } + } + } + }, + "CreateReadSessionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "readSession": { + "type": "ReadSession", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxStreamCount": { + "type": "int32", + "id": 3 + } + } + }, + "ReadRowsRequest": { + "fields": { + "readStream": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerystorage.googleapis.com/ReadStream" + } + }, + "offset": { + "type": "int64", + "id": 2 + } + } + }, + "ThrottleState": { + "fields": { + "throttlePercent": { + "type": "int32", + "id": 1 + } + } + }, + "StreamStats": { + "fields": { + "progress": { + "type": "Progress", + "id": 2 + } + }, + "nested": { + "Progress": { + "fields": { + "atResponseStart": { + "type": "double", + "id": 1 + }, + "atResponseEnd": { + "type": "double", + "id": 2 + } + } + } + } + }, + "ReadRowsResponse": { + "oneofs": { + "rows": { + "oneof": [ + "avroRows", + "arrowRecordBatch" + ] + } + }, + "fields": { + "avroRows": { + "type": "AvroRows", + "id": 3 + }, + "arrowRecordBatch": { + "type": "ArrowRecordBatch", + "id": 4 + }, + "rowCount": { + "type": "int64", + "id": 6 + }, + "stats": { + "type": "StreamStats", + "id": 2 + }, + "throttleState": { + "type": "ThrottleState", + "id": 5 + } + } + }, + "SplitReadStreamRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerystorage.googleapis.com/ReadStream" + } + }, + "fraction": { + "type": "double", + "id": 2 + } + } + }, + "SplitReadStreamResponse": { + "fields": { + "primaryStream": { + "type": "ReadStream", + "id": 1 + }, + "remainderStream": { + "type": "ReadStream", + "id": 2 + } + } + }, + "DataFormat": { + "values": { + "DATA_FORMAT_UNSPECIFIED": 0, + "AVRO": 1, + "ARROW": 2 + } + }, + "ReadSession": { + "options": { + "(google.api.resource).type": "bigquerystorage.googleapis.com/ReadSession", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/sessions/{session}" + }, + "oneofs": { + "schema": { + "oneof": [ + "avroSchema", + "arrowSchema" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataFormat": { + "type": "DataFormat", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "avroSchema": { + "type": "AvroSchema", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "arrowSchema": { + "type": "ArrowSchema", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "table": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "bigquery.googleapis.com/Table" + } + }, + "tableModifiers": { + "type": "TableModifiers", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "readOptions": { + "type": "TableReadOptions", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "streams": { + "rule": "repeated", + "type": "ReadStream", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "TableModifiers": { + "fields": { + "snapshotTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + } + } + }, + "TableReadOptions": { + "fields": { + "selectedFields": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "rowRestriction": { + "type": "string", + "id": 2 + } + } + } + } + }, + "ReadStream": { + "options": { + "(google.api.resource).type": "bigquerystorage.googleapis.com/ReadStream", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/sessions/{session}/streams/{stream}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, "v1beta1": { "options": { "go_package": "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta1;storage", diff --git a/packages/google-cloud-bigquery-storage/samples/quickstart.js b/packages/google-cloud-bigquery-storage/samples/quickstart.js index daf4263c433..edb9c2e1262 100644 --- a/packages/google-cloud-bigquery-storage/samples/quickstart.js +++ b/packages/google-cloud-bigquery-storage/samples/quickstart.js @@ -28,10 +28,9 @@ async function main() { // See reference documentation at // https://cloud.google.com/bigquery/docs/reference/storage - const bqStorage = require('@google-cloud/bigquery-storage').v1beta1 - .BigQueryStorageClient; + const {BigQueryStorageClient} = require('@google-cloud/bigquery-storage'); - const client = new bqStorage(); + const client = new BigQueryStorageClient(); async function bigqueryStorageQuickstart() { // Get current project ID. The read session is created in this project. diff --git a/packages/google-cloud-bigquery-storage/samples/test/quickstart.js b/packages/google-cloud-bigquery-storage/samples/test/quickstart.js index 926b12c4b6a..c9cce2e5694 100644 --- a/packages/google-cloud-bigquery-storage/samples/test/quickstart.js +++ b/packages/google-cloud-bigquery-storage/samples/test/quickstart.js @@ -25,7 +25,7 @@ const cp = require('child_process'); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); describe('Quickstart', () => { - it('quickstart should create a dataset', async () => { + it('quickstart should read rows from stream', async () => { const output = execSync('node quickstart'); assert.match(output, /unique names in states/); assert.match(output, /Last offset:/); diff --git a/packages/google-cloud-bigquery-storage/src/index.ts b/packages/google-cloud-bigquery-storage/src/index.ts index a3e89d46812..8716f5a6ad2 100644 --- a/packages/google-cloud-bigquery-storage/src/index.ts +++ b/packages/google-cloud-bigquery-storage/src/index.ts @@ -16,9 +16,13 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +import * as v1 from './v1'; import * as v1beta1 from './v1beta1'; +const BigQueryReadClient = v1.BigQueryReadClient; const BigQueryStorageClient = v1beta1.BigQueryStorageClient; -export {v1beta1, BigQueryStorageClient}; -export default {v1beta1, BigQueryStorageClient}; +export {v1, BigQueryReadClient, v1beta1, BigQueryStorageClient}; +// For compatibility with JavaScript libraries we need to provide this default export: +// tslint:disable-next-line no-default-export +export default {v1, BigQueryReadClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts new file mode 100644 index 00000000000..069be0386c0 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -0,0 +1,698 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; +import * as path from 'path'; + +import * as protosTypes from '../../protos/protos'; +import * as gapicConfig from './big_query_read_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * BigQuery Read API. + * + * The Read API can be used to read data from BigQuery. + * @class + * @memberof v1 + */ +export class BigQueryReadClient { + private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + bigQueryReadStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BigQueryReadClient. + * + * @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 BigQueryReadClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof BigQueryReadClient).scopes; + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this._pathTemplates = { + readSessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sessions/{session}' + ), + readStreamPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sessions/{session}/streams/{stream}' + ), + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this._descriptors.stream = { + readRows: new this._gaxModule.StreamDescriptor( + gax.StreamType.SERVER_STREAMING + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.bigquery.storage.v1.BigQueryRead', + 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.bigQueryReadStub) { + return this.bigQueryReadStub; + } + + // Put together the "service stub" for + // google.cloud.bigquery.storage.v1.BigQueryRead. + this.bigQueryReadStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.bigquery.storage.v1.BigQueryRead' + ) + : // tslint:disable-next-line no-any + (this._protos as any).google.cloud.bigquery.storage.v1.BigQueryRead, + 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 bigQueryReadStubMethods = [ + 'createReadSession', + 'readRows', + 'splitReadStream', + ]; + + for (const methodName of bigQueryReadStubMethods) { + const innerCallPromise = this.bigQueryReadStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + // eslint-disable-next-line prefer-spread + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = this._gaxModule.createApiCall( + innerCallPromise, + this._defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + + return this.bigQueryReadStub; + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'bigquerystorage.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'bigquerystorage.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/bigquery.readonly', + '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 -- + // ------------------- + createReadSession( + request: protosTypes.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.bigquery.storage.v1.IReadSession, + ( + | protosTypes.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest + | undefined + ), + {} | undefined + ] + >; + createReadSession( + request: protosTypes.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.bigquery.storage.v1.IReadSession, + | protosTypes.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest + | undefined, + {} | undefined + > + ): void; + /** + * Creates a new read session. A read session divides the contents of a + * BigQuery table into one or more streams, which can then be used to read + * data from the table. The read session also specifies properties of the + * data to be read, such as a list of columns or a push-down filter describing + * the rows to be returned. + * + * A particular row can be read by at most one stream. When the caller has + * reached the end of each stream in the session, then all the data in the + * table has been read. + * + * Data is assigned to each stream such that roughly the same number of + * rows can be read from each stream. Because the server-side unit for + * assigning data is collections of rows, the API does not guarantee that + * each stream will return the same number or rows. Additionally, the + * limits are enforced based on the number of pre-filtered rows, so some + * filters can lead to lopsided assignments. + * + * Read sessions automatically expire 24 hours after they are created and do + * not require manual clean-up by the caller. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The request project that owns the session, in the form of + * `projects/{project_id}`. + * @param {google.cloud.bigquery.storage.v1.ReadSession} request.readSession + * Required. Session to be created. + * @param {number} request.maxStreamCount + * Max initial number of streams. If unset or zero, the server will + * provide a value of streams so as to produce reasonable throughput. Must be + * non-negative. The number of streams may be lower than the requested number, + * depending on the amount parallelism that is reasonable for the table. Error + * will be returned if the max count is greater than the current system + * max limit of 1,000. + * + * Streams must be read starting from offset 0. + * @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 [ReadSession]{@link google.cloud.bigquery.storage.v1.ReadSession}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createReadSession( + request: protosTypes.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.bigquery.storage.v1.IReadSession, + | protosTypes.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.bigquery.storage.v1.IReadSession, + | protosTypes.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.bigquery.storage.v1.IReadSession, + ( + | protosTypes.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest + | 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({ + 'read_session.table': request.readSession!.table || '', + }); + this.initialize(); + return this._innerApiCalls.createReadSession(request, options, callback); + } + splitReadStream( + request: protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, + ( + | protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest + | undefined + ), + {} | undefined + ] + >; + splitReadStream( + request: protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, + | protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest + | undefined, + {} | undefined + > + ): void; + /** + * Splits a given `ReadStream` into two `ReadStream` objects. These + * `ReadStream` objects are referred to as the primary and the residual + * streams of the split. The original `ReadStream` can still be read from in + * the same manner as before. Both of the returned `ReadStream` objects can + * also be read from, and the rows returned by both child streams will be + * the same as the rows read from the original stream. + * + * Moreover, the two child streams will be allocated back-to-back in the + * original `ReadStream`. Concretely, it is guaranteed that for streams + * original, primary, and residual, that original[0-j] = primary[0-j] and + * original[j-n] = residual[0-m] once the streams have been read to + * completion. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the stream to split. + * @param {number} request.fraction + * A value in the range (0.0, 1.0) that specifies the fractional point at + * which the original stream should be split. The actual split point is + * evaluated on pre-filtered rows, so if a filter is provided, then there is + * no guarantee that the division of the rows between the new child streams + * will be proportional to this fractional value. Additionally, because the + * server-side unit for assigning data is collections of rows, this fraction + * will always map to a data storage boundary on the server side. + * @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 [SplitReadStreamResponse]{@link google.cloud.bigquery.storage.v1.SplitReadStreamResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + splitReadStream( + request: protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, + | protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, + | protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, + ( + | protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest + | 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.splitReadStream(request, options, callback); + } + + /** + * Reads rows from the stream in the format prescribed by the ReadSession. + * Each response contains one or more table rows, up to a maximum of 100 MiB + * per response; read requests which attempt to read individual rows larger + * than 100 MiB will fail. + * + * Each request also returns a set of stream statistics reflecting the current + * state of the stream. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.readStream + * Required. Stream to read rows from. + * @param {number} request.offset + * The offset requested must be less than the last row read from Read. + * Requesting a larger offset is undefined. If not specified, start reading + * from offset zero. + * @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 [ReadRowsResponse]{@link google.cloud.bigquery.storage.v1.ReadRowsResponse} on 'data' event. + */ + readRows( + request?: protosTypes.google.cloud.bigquery.storage.v1.IReadRowsRequest, + options?: gax.CallOptions + ): gax.CancellableStream { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + read_stream: request.readStream || '', + }); + this.initialize(); + return this._innerApiCalls.readRows(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified readSession resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} session + * @returns {string} Resource name string. + */ + readSessionPath(project: string, location: string, session: string) { + return this._pathTemplates.readSessionPathTemplate.render({ + project, + location, + session, + }); + } + + /** + * Parse the project from ReadSession resource. + * + * @param {string} readSessionName + * A fully-qualified path representing ReadSession resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReadSessionName(readSessionName: string) { + return this._pathTemplates.readSessionPathTemplate.match(readSessionName) + .project; + } + + /** + * Parse the location from ReadSession resource. + * + * @param {string} readSessionName + * A fully-qualified path representing ReadSession resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReadSessionName(readSessionName: string) { + return this._pathTemplates.readSessionPathTemplate.match(readSessionName) + .location; + } + + /** + * Parse the session from ReadSession resource. + * + * @param {string} readSessionName + * A fully-qualified path representing ReadSession resource. + * @returns {string} A string representing the session. + */ + matchSessionFromReadSessionName(readSessionName: string) { + return this._pathTemplates.readSessionPathTemplate.match(readSessionName) + .session; + } + + /** + * Return a fully-qualified readStream resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} session + * @param {string} stream + * @returns {string} Resource name string. + */ + readStreamPath( + project: string, + location: string, + session: string, + stream: string + ) { + return this._pathTemplates.readStreamPathTemplate.render({ + project, + location, + session, + stream, + }); + } + + /** + * Parse the project from ReadStream resource. + * + * @param {string} readStreamName + * A fully-qualified path representing ReadStream resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReadStreamName(readStreamName: string) { + return this._pathTemplates.readStreamPathTemplate.match(readStreamName) + .project; + } + + /** + * Parse the location from ReadStream resource. + * + * @param {string} readStreamName + * A fully-qualified path representing ReadStream resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReadStreamName(readStreamName: string) { + return this._pathTemplates.readStreamPathTemplate.match(readStreamName) + .location; + } + + /** + * Parse the session from ReadStream resource. + * + * @param {string} readStreamName + * A fully-qualified path representing ReadStream resource. + * @returns {string} A string representing the session. + */ + matchSessionFromReadStreamName(readStreamName: string) { + return this._pathTemplates.readStreamPathTemplate.match(readStreamName) + .session; + } + + /** + * Parse the stream from ReadStream resource. + * + * @param {string} readStreamName + * A fully-qualified path representing ReadStream resource. + * @returns {string} A string representing the stream. + */ + matchStreamFromReadStreamName(readStreamName: string) { + return this._pathTemplates.readStreamPathTemplate.match(readStreamName) + .stream; + } + + /** + * 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.bigQueryReadStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client_config.json b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client_config.json new file mode 100644 index 00000000000..42b2735b9fe --- /dev/null +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client_config.json @@ -0,0 +1,44 @@ +{ + "interfaces": { + "google.cloud.bigquery.storage.v1.BigQueryRead": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateReadSession": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ReadRows": { + "timeout_millis": 86400000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "SplitReadStream": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_proto_list.json b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_proto_list.json new file mode 100644 index 00000000000..13440ce253e --- /dev/null +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_proto_list.json @@ -0,0 +1,6 @@ +[ + "../../protos/google/cloud/bigquery/storage/v1/arrow.proto", + "../../protos/google/cloud/bigquery/storage/v1/avro.proto", + "../../protos/google/cloud/bigquery/storage/v1/storage.proto", + "../../protos/google/cloud/bigquery/storage/v1/stream.proto" +] diff --git a/packages/google-cloud-bigquery-storage/src/v1/index.ts b/packages/google-cloud-bigquery-storage/src/v1/index.ts new file mode 100644 index 00000000000..5eae3fb5e73 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {BigQueryReadClient} from './big_query_read_client'; diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index 89d815f9e06..f464c061b9f 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -807,9 +807,9 @@ export class BigQueryStorageClient { */ readSessionPath(project: string, location: string, session: string) { return this.pathTemplates.readSessionPathTemplate.render({ - project: project, - location: location, - session: session, + project, + location, + session, }); } @@ -859,9 +859,9 @@ export class BigQueryStorageClient { */ streamPath(project: string, location: string, stream: string) { return this.pathTemplates.streamPathTemplate.render({ - project: project, - location: location, - stream: stream, + project, + location, + stream, }); } diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 2c96de14d13..862f3735b43 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -1,19 +1,20 @@ { - "updateTime": "2020-04-02T12:08:46.500507Z", + "updateTime": "2020-03-11T21:35:37.421495Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "75047719f704d61f405cac6d7439637ab36c1232", - "internalRef": "304305096" + "sha": "80d2bd2c652a5e213302041b0620aff423132589", + "internalRef": "300393997", + "log": "80d2bd2c652a5e213302041b0620aff423132589\nEnable proto annotation and gapic v2 for talent API.\n\nPiperOrigin-RevId: 300393997\n\n85e454be7a353f7fe1bf2b0affb753305785b872\ndocs(google/maps/roads): remove mention of nonexported api\n\nPiperOrigin-RevId: 300367734\n\nbf839ae632e0f263a729569e44be4b38b1c85f9c\nAdding protocol buffer annotations and updated config info for v1 and v2.\n\nPiperOrigin-RevId: 300276913\n\n309b899ca18a4c604bce63882a161d44854da549\nPublish `Backup` APIs and protos.\n\nPiperOrigin-RevId: 300246038\n\neced64c3f122421350b4aca68a28e89121d20db8\nadd PHP client libraries\n\nPiperOrigin-RevId: 300193634\n\n7727af0e39df1ae9ad715895c8576d7b65cf6c6d\nfeat: use the latest gapic-generator and protoc-java-resource-name-plugin in googleapis/WORKSPACE.\n\nPiperOrigin-RevId: 300188410\n\n2a25aa351dd5b5fe14895266aff5824d90ce757b\nBreaking change: remove the ProjectOrTenant resource and its references.\n\nPiperOrigin-RevId: 300182152\n\na499dbb28546379415f51803505cfb6123477e71\nUpdate web risk v1 gapic config and BUILD file.\n\nPiperOrigin-RevId: 300152177\n\n52701da10fec2a5f9796e8d12518c0fe574488fe\nFix: apply appropriate namespace/package options for C#, PHP and Ruby.\n\nPiperOrigin-RevId: 300123508\n\n365c029b8cdb63f7751b92ab490f1976e616105c\nAdd CC targets to the kms protos.\n\nThese are needed by go/tink.\n\nPiperOrigin-RevId: 300038469\n\n4ba9aa8a4a1413b88dca5a8fa931824ee9c284e6\nExpose logo recognition API proto for GA.\n\nPiperOrigin-RevId: 299971671\n\n1c9fc2c9e03dadf15f16b1c4f570955bdcebe00e\nAdding ruby_package option to accessapproval.proto for the Ruby client libraries generation.\n\nPiperOrigin-RevId: 299955924\n\n1cc6f0a7bfb147e6f2ede911d9b01e7a9923b719\nbuild(google/maps/routes): generate api clients\n\nPiperOrigin-RevId: 299955905\n\n29a47c965aac79e3fe8e3314482ca0b5967680f0\nIncrease timeout to 1hr for method `dropRange` in bigtable/admin/v2, which is\nsynced with the timeout setting in gapic_yaml.\n\nPiperOrigin-RevId: 299917154\n\n8f631c4c70a60a9c7da3749511ee4ad432b62898\nbuild(google/maps/roads/v1op): move go to monorepo pattern\n\nPiperOrigin-RevId: 299885195\n\nd66816518844ebbf63504c9e8dfc7133921dd2cd\nbuild(google/maps/roads/v1op): Add bazel build files to generate clients.\n\nPiperOrigin-RevId: 299851148\n\naf7dff701fabe029672168649c62356cf1bb43d0\nAdd LogPlayerReports and LogImpressions to Playable Locations service\n\nPiperOrigin-RevId: 299724050\n\nb6927fca808f38df32a642c560082f5bf6538ced\nUpdate BigQuery Connection API v1beta1 proto: added credential to CloudSqlProperties.\n\nPiperOrigin-RevId: 299503150\n\n91e1fb5ef9829c0c7a64bfa5bde330e6ed594378\nchore: update protobuf (protoc) version to 3.11.2\n\nPiperOrigin-RevId: 299404145\n\n30e36b4bee6749c4799f4fc1a51cc8f058ba167d\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 299399890\n\nffbb493674099f265693872ae250711b2238090c\nfeat: cloudbuild/v1 add new fields and annotate OUTPUT_OUT fields.\n\nPiperOrigin-RevId: 299397780\n\nbc973a15818e00c19e121959832676e9b7607456\nbazel: Fix broken common dependency\n\nPiperOrigin-RevId: 299397431\n\n71094a343e3b962e744aa49eb9338219537474e4\nchore: bigtable/admin/v2 publish retry config\n\nPiperOrigin-RevId: 299391875\n\n8f488efd7bda33885cb674ddd023b3678c40bd82\nfeat: Migrate logging to GAPIC v2; release new features.\n\nIMPORTANT: This is a breaking change for client libraries\nin all languages.\n\nCommitter: @lukesneeringer, @jskeet\nPiperOrigin-RevId: 299370279\n\n007605bf9ad3a1fd775014ebefbf7f1e6b31ee71\nUpdate API for bigqueryreservation v1beta1.\n- Adds flex capacity commitment plan to CapacityCommitment.\n- Adds methods for getting and updating BiReservations.\n- Adds methods for updating/splitting/merging CapacityCommitments.\n\nPiperOrigin-RevId: 299368059\n\n" } }, { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "99820243d348191bc9c634f2b48ddf65096285ed" + "template": { + "name": "node_library", + "origin": "synthtool.gcp", + "version": "2020.2.4" } } ], @@ -26,6 +27,15 @@ "language": "typescript", "generator": "gapic-generator-typescript" } + }, + { + "client": { + "source": "googleapis", + "apiName": "bigquerystorage", + "apiVersion": "v1", + "language": "typescript", + "generator": "gapic-generator-typescript" + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-bigquery-storage/synth.py b/packages/google-cloud-bigquery-storage/synth.py index 564adc79dcb..24ecbba9777 100644 --- a/packages/google-cloud-bigquery-storage/synth.py +++ b/packages/google-cloud-bigquery-storage/synth.py @@ -23,7 +23,7 @@ # Run the gapic generator gapic = gcp.GAPICMicrogenerator() name = 'bigquerystorage' -versions = ['v1beta1'] +versions = ['v1beta1', 'v1'] for version in versions: library = gapic.typescript_library( name, @@ -34,7 +34,7 @@ 'package-name': f'@google-cloud/bigquery-storage', }, ) - s.copy(library, excludes=['package.json', 'README.md']) + s.copy(library, excludes=['package.json', 'README.md', 'src/index.ts']) # Copy common templates common_templates = gcp.CommonTemplates() templates = common_templates.node_library(source_location='build/src') diff --git a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js index 1f6ab3784e4..029b4d88171 100644 --- a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js @@ -17,10 +17,10 @@ // ** All changes to this file may be overwritten. ** /* eslint-disable node/no-missing-require, no-unused-vars */ -const storage = require('@google-cloud/bigquery-storage'); +const {BigQueryReadClient} = require('@google-cloud/bigquery-storage'); function main() { - const bigQueryStorageClient = new storage.BigQueryStorageClient(); + const bigQueryReadClient = new BigQueryReadClient(); } main(); diff --git a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts index d53a99905ac..5c67c093939 100644 --- a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts @@ -16,10 +16,11 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import {BigQueryStorageClient} from '@google-cloud/bigquery-storage'; +import {BigQueryReadClient} from '@google-cloud/bigquery-storage'; function main() { - new BigQueryStorageClient(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const bigQueryReadClient = new BigQueryReadClient(); } main(); diff --git a/packages/google-cloud-bigquery-storage/test/gapic-big_query_read-v1.ts b/packages/google-cloud-bigquery-storage/test/gapic-big_query_read-v1.ts new file mode 100644 index 00000000000..622a2a3d66e --- /dev/null +++ b/packages/google-cloud-bigquery-storage/test/gapic-big_query_read-v1.ts @@ -0,0 +1,288 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +// eslint-disable-next-line @typescript-eslint/no-var-requires +const bigqueryreadModule = require('../src'); + +import {PassThrough} from 'stream'; + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +function mockServerStreamingGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + const mockStream = new PassThrough({ + objectMode: true, + transform: (chunk: {}, enc: {}, callback: Callback) => { + if (error) { + callback(error); + } else { + callback(null, response); + } + }, + }); + return mockStream; + }; +} +describe('v1.BigQueryReadClient', () => { + it('has servicePath', () => { + const servicePath = bigqueryreadModule.v1.BigQueryReadClient.servicePath; + assert(servicePath); + }); + it('has apiEndpoint', () => { + const apiEndpoint = bigqueryreadModule.v1.BigQueryReadClient.apiEndpoint; + assert(apiEndpoint); + }); + it('has port', () => { + const port = bigqueryreadModule.v1.BigQueryReadClient.port; + assert(port); + assert(typeof port === 'number'); + }); + it('should create a client with no option', () => { + const client = new bigqueryreadModule.v1.BigQueryReadClient(); + assert(client); + }); + it('should create a client with gRPC fallback', () => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + fallback: true, + }); + assert(client); + }); + it('has initialize method and supports deferred initialization', async () => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.bigQueryReadStub, undefined); + await client.initialize(); + assert(client.bigQueryReadStub); + }); + it('has close method', () => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + describe('createReadSession', () => { + it('invokes createReadSession without error', done => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest = {}; + request.readSession = {}; + request.readSession.table = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createReadSession = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.createReadSession(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes createReadSession with error', done => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest = {}; + request.readSession = {}; + request.readSession.table = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createReadSession = mockSimpleGrpcMethod( + request, + null, + error + ); + client.createReadSession(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('splitReadStream', () => { + it('invokes splitReadStream without error', done => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.splitReadStream = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.splitReadStream(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes splitReadStream with error', done => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.splitReadStream = mockSimpleGrpcMethod( + request, + null, + error + ); + client.splitReadStream(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('readRows', () => { + it('invokes readRows without error', done => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.bigquery.storage.v1.IReadRowsRequest = {}; + request.readStream = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.readRows = mockServerStreamingGrpcMethod( + request, + expectedResponse, + null + ); + const stream = client.readRows(request); + stream.on('data', (response: {}) => { + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + stream.on('error', (err: FakeError) => { + done(err); + }); + stream.write(); + }); + it('invokes readRows with error', done => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Initialize client before mocking + client.initialize(); + // Mock request + const request: protosTypes.google.cloud.bigquery.storage.v1.IReadRowsRequest = {}; + request.readStream = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.readRows = mockServerStreamingGrpcMethod( + request, + null, + error + ); + const stream = client.readRows(request); + stream.on('data', () => { + assert.fail(); + }); + stream.on('error', (err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + stream.write(); + }); + }); +}); diff --git a/packages/google-cloud-bigquery-storage/webpack.config.js b/packages/google-cloud-bigquery-storage/webpack.config.js index 683c6ec0233..215b4b9acb9 100644 --- a/packages/google-cloud-bigquery-storage/webpack.config.js +++ b/packages/google-cloud-bigquery-storage/webpack.config.js @@ -17,8 +17,8 @@ const path = require('path'); module.exports = { entry: './src/index.ts', output: { - library: 'BigQueryStorage', - filename: './big-query-storage.js', + library: 'BigQueryRead', + filename: './big-query-read.js', }, node: { child_process: 'empty', From ce0d2901ebe11b6cda691ce6e97e7aa2e19e3493 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Apr 2020 20:57:04 +0200 Subject: [PATCH 027/182] chore(deps): update dependency gts to v2.0.0 (#48) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [gts](https://togithub.com/google/gts) | devDependencies | patch | [`2.0.0-alpha.9` -> `2.0.0`](https://renovatebot.com/diffs/npm/gts/2.0.0-alpha.9/2.0.0) | --- ### Release Notes
google/gts ### [`v2.0.0`](https://togithub.com/google/gts/blob/master/CHANGELOG.md#​200-httpswwwgithubcomgooglegtscomparev112v200-2020-04-02) [Compare Source](https://togithub.com/google/gts/compare/39a2705e51b4b6329a70f91f8293a2d7a363bf5d...v2.0.0) ##### ⚠ BREAKING CHANGES ⚠ This is a major rewrite of the tool. Based on community guidance, we've switched from using [tslint](https://palantir.github.io/tslint/) to [eslint](https://eslint.org/). _Please read all of the steps below to upgrade_. ##### Configuring `eslint` With the shift to `eslint`, `gts` now will format and lint JavaScript _as well_ as TypeScript. Upgrading will require a number of manual steps. To format JavaScript and TypeScript, you can run: $ npx gts fix To specify only TypeScript: $ npx gts fix '**/*.ts' ##### Delete `tslint.json` This file is no longer used, and can lead to confusion. ##### Create a `.eslintrc.json` Now that we're using eslint, you need to extend the eslint configuration baked into the module. Create a new file named `.eslintrc.json`, and paste the following: ```js { "extends": "./node_modules/gts" } ``` ##### Create a `.eslintignore` The `.eslintignore` file lets you ignore specific directories. This tool now lints and formats JavaScript, so it's _really_ important to ignore your build directory! Here is an example of a `.eslintignore` file: **/node_modules build/ ##### Rule changes The underlying linter was changed, so naturally there are going to be a variety of rule changes along the way. To see the full list, check out [.eslintrc.json](https://togithub.com/google/gts/blob/master/.eslintrc.json). ##### Require Node.js 10.x and up Node.js 8.x is now end of life - this module now requires Ndoe.js 10.x and up. ##### Features - add the eol-last rule ([#​425](https://www.github.com/google/gts/issues/425)) ([50ebd4d](https://www.github.com/google/gts/commit/50ebd4dbaf063615f4c025f567ca28076a734223)) - allow eslintrc to run over tsx files ([#​469](https://www.github.com/google/gts/issues/469)) ([a21db94](https://www.github.com/google/gts/commit/a21db94601def563952d677cb0980a12b6730f4c)) - disable global rule for checking TODO comments ([#​459](https://www.github.com/google/gts/issues/459)) ([96aa84a](https://www.github.com/google/gts/commit/96aa84a0a42181046daa248750cc8fef0c320619)) - override require-atomic-updates ([#​468](https://www.github.com/google/gts/issues/468)) ([8105c93](https://www.github.com/google/gts/commit/8105c9334ee5104b05f6b1b2f150e51419637262)) - prefer single quotes if possible ([#​475](https://www.github.com/google/gts/issues/475)) ([39a2705](https://www.github.com/google/gts/commit/39a2705e51b4b6329a70f91f8293a2d7a363bf5d)) - use eslint instead of tslint ([#​400](https://www.github.com/google/gts/issues/400)) ([b3096fb](https://www.github.com/google/gts/commit/b3096fbd5076d302d93c2307bf627e12c423e726)) ##### Bug Fixes - use .prettierrc.js ([#​437](https://www.github.com/google/gts/issues/437)) ([06efa84](https://www.github.com/google/gts/commit/06efa8444cdf1064b64f3e8d61ebd04f45d90b4c)) - **deps:** update dependency chalk to v4 ([#​477](https://www.github.com/google/gts/issues/477)) ([061d64e](https://www.github.com/google/gts/commit/061d64e29d37b93ce55228937cc100e05ddef352)) - **deps:** update dependency eslint-plugin-node to v11 ([#​426](https://www.github.com/google/gts/issues/426)) ([a394b7c](https://www.github.com/google/gts/commit/a394b7c1f80437f25017ca5c500b968ebb789ece)) - **deps:** update dependency execa to v4 ([#​427](https://www.github.com/google/gts/issues/427)) ([f42ef36](https://www.github.com/google/gts/commit/f42ef36709251553342e655e287e889df72ee3e3)) - **deps:** update dependency prettier to v2 ([#​464](https://www.github.com/google/gts/issues/464)) ([20ef43d](https://www.github.com/google/gts/commit/20ef43d566df17d3c93949ef7db3b72ee9123ca3)) - disable no-use-before-define ([#​431](https://www.github.com/google/gts/issues/431)) ([dea2c22](https://www.github.com/google/gts/commit/dea2c223d1d3a60a1786aa820eebb93be27016a7)) - **deps:** update dependency update-notifier to v4 ([#​403](https://www.github.com/google/gts/issues/403)) ([57393b7](https://www.github.com/google/gts/commit/57393b74c6cf299e8ae09311f0382226b8baa3e3)) - **deps:** upgrade to meow 6.x ([#​423](https://www.github.com/google/gts/issues/423)) ([8f93d00](https://www.github.com/google/gts/commit/8f93d0049337a832d9a22b6ae4e86fd41140ec56)) - align back to the google style guide ([#​440](https://www.github.com/google/gts/issues/440)) ([8bd78c4](https://www.github.com/google/gts/commit/8bd78c4c78526a72400f618a95a987d2a7c1a8db)) - disable empty-function check ([#​467](https://www.github.com/google/gts/issues/467)) ([6455d7a](https://www.github.com/google/gts/commit/6455d7a9d227320d3ffe1b00c9c739b846f339a8)) - drop support for node 8 ([#​422](https://www.github.com/google/gts/issues/422)) ([888c686](https://www.github.com/google/gts/commit/888c68692079065f38ce66ec84472f1f3311a050)) - emit .prettierrc.js with init ([#​462](https://www.github.com/google/gts/issues/462)) ([b114614](https://www.github.com/google/gts/commit/b114614d22ab5560d2d1dd5cb6695968cc80027b)) - enable trailing comma ([#​470](https://www.github.com/google/gts/issues/470)) ([6518f58](https://www.github.com/google/gts/commit/6518f5843d3093e3beb7d3371b56d9aecedf3924)) - include _.tsx and _.jsx in default fix command ([#​473](https://www.github.com/google/gts/issues/473)) ([0509780](https://www.github.com/google/gts/commit/050978005ad089d9b3b5d8895b25ea1175d75db2)) ##### [1.1.2](https://www.github.com/google/gts/compare/v1.1.1...v1.1.2) (2019-11-20) ##### Bug Fixes - **deps:** update to newest prettier (with support for optional chain) ([#​396](https://www.github.com/google/gts/issues/396)) ([ce8ad06](https://www.github.com/google/gts/commit/ce8ad06c8489c44a9e2ed5292382637b3ebb7601)) ##### [1.1.1](https://www.github.com/google/gts/compare/v1.1.0...v1.1.1) (2019-11-11) ##### Bug Fixes - **deps:** update dependency chalk to v3 ([#​389](https://www.github.com/google/gts/issues/389)) ([1ce0f45](https://www.github.com/google/gts/commit/1ce0f450677e143a27efc39def617d13c66503e8)) - **deps:** update dependency inquirer to v7 ([#​377](https://www.github.com/google/gts/issues/377)) ([bf2c349](https://www.github.com/google/gts/commit/bf2c349b2208ac63e551542599ac9cd27b461338)) - **deps:** update dependency rimraf to v3 ([#​374](https://www.github.com/google/gts/issues/374)) ([2058eaa](https://www.github.com/google/gts/commit/2058eaa682f4baae978b469fd708d1f866e7da74)) - **deps:** update dependency write-file-atomic to v3 ([#​353](https://www.github.com/google/gts/issues/353)) ([59e6aa8](https://www.github.com/google/gts/commit/59e6aa8580a2f8e9457d2d2b6fa9e18e86347592))
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-bigquery-storage). --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index d3919de0baf..cf5da124444 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -37,7 +37,7 @@ "eslint-config-prettier": "^6.10.0", "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.1.2", - "gts": "2.0.0-alpha.9", + "gts": "2.0.0", "jsdoc": "^3.6.3", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", From b0bcff1946a1425228cf6dedfa8a9631ece995ee Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Fri, 10 Apr 2020 18:49:28 -0700 Subject: [PATCH 028/182] fix: remove eslint, update gax, fix generated protos, run the generator (#49) Run the latest version of the generator, update google-gax, update gts, and remove direct dependencies on eslint. --- .../google-cloud-bigquery-storage/.jsdoc.js | 2 +- .../.prettierrc.js | 2 +- .../google-cloud-bigquery-storage/README.md | 5 +- .../package.json | 14 +- .../protos/protos.js | 2 +- .../src/v1/big_query_read_client.ts | 189 +++--- .../src/v1/index.ts | 2 +- .../src/v1beta1/big_query_storage_client.ts | 12 +- .../synth.metadata | 17 +- .../system-test/fixtures/sample/src/index.js | 4 +- .../system-test/fixtures/sample/src/index.ts | 3 +- .../test/gapic-big_query_read-v1.ts | 288 -------- .../test/gapic_big_query_read_v1.ts | 623 ++++++++++++++++++ .../test/gapic_big_query_storage_v1beta1.ts | 10 +- 14 files changed, 757 insertions(+), 416 deletions(-) delete mode 100644 packages/google-cloud-bigquery-storage/test/gapic-big_query_read-v1.ts create mode 100644 packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts diff --git a/packages/google-cloud-bigquery-storage/.jsdoc.js b/packages/google-cloud-bigquery-storage/.jsdoc.js index e8a4b174718..ac0f1658a27 100644 --- a/packages/google-cloud-bigquery-storage/.jsdoc.js +++ b/packages/google-cloud-bigquery-storage/.jsdoc.js @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2019 Google, LLC.', + copyright: 'Copyright 2020 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/bigquery-storage', diff --git a/packages/google-cloud-bigquery-storage/.prettierrc.js b/packages/google-cloud-bigquery-storage/.prettierrc.js index 08cba3775be..d1b95106f4c 100644 --- a/packages/google-cloud-bigquery-storage/.prettierrc.js +++ b/packages/google-cloud-bigquery-storage/.prettierrc.js @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/packages/google-cloud-bigquery-storage/README.md b/packages/google-cloud-bigquery-storage/README.md index cbd319b1dc1..4dc17dfd9d0 100644 --- a/packages/google-cloud-bigquery-storage/README.md +++ b/packages/google-cloud-bigquery-storage/README.md @@ -63,10 +63,9 @@ const avro = require('avsc'); // See reference documentation at // https://cloud.google.com/bigquery/docs/reference/storage -const bqStorage = require('@google-cloud/bigquery-storage').v1beta1 - .BigQueryStorageClient; +const {BigQueryStorageClient} = require('@google-cloud/bigquery-storage'); -const client = new bqStorage(); +const client = new BigQueryStorageClient(); async function bigqueryStorageQuickstart() { // Get current project ID. The read session is created in this project. diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index cf5da124444..cdf7c977e7c 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -17,27 +17,23 @@ "docs": "jsdoc -c .jsdoc.js", "predocs-test": "npm run docs", "docs-test": "linkinator docs", - "fix": "gts fix && eslint samples --fix", - "prelint": "cd samples; npm link ../; npm i", - "lint": "gts check && eslint samples", + "fix": "gts fix", + "prelint": "cd samples; npm link ../; npm install", + "lint": "gts fix", "prepare": "npm run compile-protos && npm run compile", "system-test": "c8 mocha build/system-test", "test": "c8 mocha build/test", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../" }, "dependencies": { - "google-gax": "^2.0.1" + "google-gax": "^2.1.0" }, "devDependencies": { "@types/mocha": "^7.0.1", "@types/node": "^13.7.1", "@types/sinon": "^9.0.0", "c8": "^7.1.0", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.10.0", - "eslint-plugin-node": "^11.0.0", - "eslint-plugin-prettier": "^3.1.2", - "gts": "2.0.0", + "gts": "^2.0.0", "jsdoc": "^3.6.3", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", diff --git a/packages/google-cloud-bigquery-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index 911efd69b28..402f59277c5 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/protos/protos.js @@ -28,7 +28,7 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace - var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + var $root = $protobuf.roots._google_cloud_bigquery_storage_1_1_0_protos || ($protobuf.roots._google_cloud_bigquery_storage_1_1_0_protos = {}); $root.google = (function() { diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index 069be0386c0..ba031a72a85 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,16 +17,10 @@ // ** All changes to this file may be overwritten. ** import * as gax from 'google-gax'; -import { - APICallback, - Callback, - CallOptions, - Descriptors, - ClientOptions, -} from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; import * as path from 'path'; -import * as protosTypes from '../../protos/protos'; +import * as protos from '../../protos/protos'; import * as gapicConfig from './big_query_read_client_config.json'; const version = require('../../../package.json').version; @@ -39,9 +33,6 @@ const version = require('../../../package.json').version; * @memberof v1 */ export class BigQueryReadClient { - private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; - private _innerApiCalls: {[name: string]: Function}; - private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; private _opts: ClientOptions; private _gaxModule: typeof gax | typeof gax.fallback; @@ -49,6 +40,14 @@ export class BigQueryReadClient { 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}; bigQueryReadStub?: Promise<{[name: string]: Function}>; /** @@ -140,13 +139,16 @@ export class BigQueryReadClient { 'protos.json' ); this._protos = this._gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. - this._pathTemplates = { + this.pathTemplates = { readSessionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/sessions/{session}' ), @@ -157,7 +159,7 @@ export class BigQueryReadClient { // Some of the methods on this service provide streaming responses. // Provide descriptors for these. - this._descriptors.stream = { + this.descriptors.stream = { readRows: new this._gaxModule.StreamDescriptor( gax.StreamType.SERVER_STREAMING ), @@ -174,7 +176,7 @@ export class BigQueryReadClient { // Set up a dictionary of "inner API calls"; the core implementation // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. - this._innerApiCalls = {}; + this.innerApiCalls = {}; } /** @@ -201,7 +203,7 @@ export class BigQueryReadClient { ? (this._protos as protobuf.Root).lookupService( 'google.cloud.bigquery.storage.v1.BigQueryRead' ) - : // tslint:disable-next-line no-any + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.bigquery.storage.v1.BigQueryRead, this._opts ) as Promise<{[method: string]: Function}>; @@ -213,15 +215,14 @@ export class BigQueryReadClient { 'readRows', 'splitReadStream', ]; - for (const methodName of bigQueryReadStubMethods) { - const innerCallPromise = this.bigQueryReadStub.then( + const callPromise = this.bigQueryReadStub.then( stub => (...args: Array<{}>) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - // eslint-disable-next-line prefer-spread - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error | null | undefined) => () => { throw err; @@ -229,20 +230,14 @@ export class BigQueryReadClient { ); const apiCall = this._gaxModule.createApiCall( - innerCallPromise, + callPromise, this._defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.stream[methodName] || - this._descriptors.longrunning[methodName] + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); - this._innerApiCalls[methodName] = ( - argument: {}, - callOptions?: CallOptions, - callback?: APICallback - ) => { - return apiCall(argument, callOptions, callback); - }; + this.innerApiCalls[methodName] = apiCall; } return this.bigQueryReadStub; @@ -303,26 +298,37 @@ export class BigQueryReadClient { // -- Service calls -- // ------------------- createReadSession( - request: protosTypes.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, + request: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.bigquery.storage.v1.IReadSession, + protos.google.cloud.bigquery.storage.v1.IReadSession, ( - | protosTypes.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest + | protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest | undefined ), {} | undefined ] >; createReadSession( - request: protosTypes.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, + request: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.bigquery.storage.v1.IReadSession, - | protosTypes.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest + protos.google.cloud.bigquery.storage.v1.IReadSession, + | protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + createReadSession( + request: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, + callback: Callback< + protos.google.cloud.bigquery.storage.v1.IReadSession, + | protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -369,26 +375,28 @@ export class BigQueryReadClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ createReadSession( - request: protosTypes.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, + request: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.bigquery.storage.v1.IReadSession, - | protosTypes.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest + protos.google.cloud.bigquery.storage.v1.IReadSession, + | protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.bigquery.storage.v1.IReadSession, - | protosTypes.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest + protos.google.cloud.bigquery.storage.v1.IReadSession, + | protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.bigquery.storage.v1.IReadSession, + protos.google.cloud.bigquery.storage.v1.IReadSession, ( - | protosTypes.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest + | protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest | undefined ), {} | undefined @@ -411,29 +419,40 @@ export class BigQueryReadClient { 'read_session.table': request.readSession!.table || '', }); this.initialize(); - return this._innerApiCalls.createReadSession(request, options, callback); + return this.innerApiCalls.createReadSession(request, options, callback); } splitReadStream( - request: protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, + request: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, + protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, ( - | protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest + | protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest | undefined ), {} | undefined ] >; splitReadStream( - request: protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, + request: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, - | protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest + protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, + | protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + splitReadStream( + request: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, + callback: Callback< + protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, + | protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -469,26 +488,28 @@ export class BigQueryReadClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ splitReadStream( - request: protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, + request: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, - | protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest + protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, + | protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, - | protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest + protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, + | protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, + protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, ( - | protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest + | protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest | undefined ), {} | undefined @@ -511,7 +532,7 @@ export class BigQueryReadClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.splitReadStream(request, options, callback); + return this.innerApiCalls.splitReadStream(request, options, callback); } /** @@ -537,7 +558,7 @@ export class BigQueryReadClient { * An object stream which emits [ReadRowsResponse]{@link google.cloud.bigquery.storage.v1.ReadRowsResponse} on 'data' event. */ readRows( - request?: protosTypes.google.cloud.bigquery.storage.v1.IReadRowsRequest, + request?: protos.google.cloud.bigquery.storage.v1.IReadRowsRequest, options?: gax.CallOptions ): gax.CancellableStream { request = request || {}; @@ -550,7 +571,7 @@ export class BigQueryReadClient { read_stream: request.readStream || '', }); this.initialize(); - return this._innerApiCalls.readRows(request, options); + return this.innerApiCalls.readRows(request, options); } // -------------------- @@ -566,10 +587,10 @@ export class BigQueryReadClient { * @returns {string} Resource name string. */ readSessionPath(project: string, location: string, session: string) { - return this._pathTemplates.readSessionPathTemplate.render({ - project, - location, - session, + return this.pathTemplates.readSessionPathTemplate.render({ + project: project, + location: location, + session: session, }); } @@ -581,7 +602,7 @@ export class BigQueryReadClient { * @returns {string} A string representing the project. */ matchProjectFromReadSessionName(readSessionName: string) { - return this._pathTemplates.readSessionPathTemplate.match(readSessionName) + return this.pathTemplates.readSessionPathTemplate.match(readSessionName) .project; } @@ -593,7 +614,7 @@ export class BigQueryReadClient { * @returns {string} A string representing the location. */ matchLocationFromReadSessionName(readSessionName: string) { - return this._pathTemplates.readSessionPathTemplate.match(readSessionName) + return this.pathTemplates.readSessionPathTemplate.match(readSessionName) .location; } @@ -605,7 +626,7 @@ export class BigQueryReadClient { * @returns {string} A string representing the session. */ matchSessionFromReadSessionName(readSessionName: string) { - return this._pathTemplates.readSessionPathTemplate.match(readSessionName) + return this.pathTemplates.readSessionPathTemplate.match(readSessionName) .session; } @@ -624,11 +645,11 @@ export class BigQueryReadClient { session: string, stream: string ) { - return this._pathTemplates.readStreamPathTemplate.render({ - project, - location, - session, - stream, + return this.pathTemplates.readStreamPathTemplate.render({ + project: project, + location: location, + session: session, + stream: stream, }); } @@ -640,7 +661,7 @@ export class BigQueryReadClient { * @returns {string} A string representing the project. */ matchProjectFromReadStreamName(readStreamName: string) { - return this._pathTemplates.readStreamPathTemplate.match(readStreamName) + return this.pathTemplates.readStreamPathTemplate.match(readStreamName) .project; } @@ -652,7 +673,7 @@ export class BigQueryReadClient { * @returns {string} A string representing the location. */ matchLocationFromReadStreamName(readStreamName: string) { - return this._pathTemplates.readStreamPathTemplate.match(readStreamName) + return this.pathTemplates.readStreamPathTemplate.match(readStreamName) .location; } @@ -664,7 +685,7 @@ export class BigQueryReadClient { * @returns {string} A string representing the session. */ matchSessionFromReadStreamName(readStreamName: string) { - return this._pathTemplates.readStreamPathTemplate.match(readStreamName) + return this.pathTemplates.readStreamPathTemplate.match(readStreamName) .session; } @@ -676,7 +697,7 @@ export class BigQueryReadClient { * @returns {string} A string representing the stream. */ matchStreamFromReadStreamName(readStreamName: string) { - return this._pathTemplates.readStreamPathTemplate.match(readStreamName) + return this.pathTemplates.readStreamPathTemplate.match(readStreamName) .stream; } diff --git a/packages/google-cloud-bigquery-storage/src/v1/index.ts b/packages/google-cloud-bigquery-storage/src/v1/index.ts index 5eae3fb5e73..c882095873b 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/index.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index f464c061b9f..89d815f9e06 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -807,9 +807,9 @@ export class BigQueryStorageClient { */ readSessionPath(project: string, location: string, session: string) { return this.pathTemplates.readSessionPathTemplate.render({ - project, - location, - session, + project: project, + location: location, + session: session, }); } @@ -859,9 +859,9 @@ export class BigQueryStorageClient { */ streamPath(project: string, location: string, stream: string) { return this.pathTemplates.streamPathTemplate.render({ - project, - location, - stream, + project: project, + location: location, + stream: stream, }); } diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 862f3735b43..daa2e456f0e 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -1,20 +1,11 @@ { - "updateTime": "2020-03-11T21:35:37.421495Z", + "updateTime": "2020-04-10T23:55:16.301945Z", "sources": [ { "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "80d2bd2c652a5e213302041b0620aff423132589", - "internalRef": "300393997", - "log": "80d2bd2c652a5e213302041b0620aff423132589\nEnable proto annotation and gapic v2 for talent API.\n\nPiperOrigin-RevId: 300393997\n\n85e454be7a353f7fe1bf2b0affb753305785b872\ndocs(google/maps/roads): remove mention of nonexported api\n\nPiperOrigin-RevId: 300367734\n\nbf839ae632e0f263a729569e44be4b38b1c85f9c\nAdding protocol buffer annotations and updated config info for v1 and v2.\n\nPiperOrigin-RevId: 300276913\n\n309b899ca18a4c604bce63882a161d44854da549\nPublish `Backup` APIs and protos.\n\nPiperOrigin-RevId: 300246038\n\neced64c3f122421350b4aca68a28e89121d20db8\nadd PHP client libraries\n\nPiperOrigin-RevId: 300193634\n\n7727af0e39df1ae9ad715895c8576d7b65cf6c6d\nfeat: use the latest gapic-generator and protoc-java-resource-name-plugin in googleapis/WORKSPACE.\n\nPiperOrigin-RevId: 300188410\n\n2a25aa351dd5b5fe14895266aff5824d90ce757b\nBreaking change: remove the ProjectOrTenant resource and its references.\n\nPiperOrigin-RevId: 300182152\n\na499dbb28546379415f51803505cfb6123477e71\nUpdate web risk v1 gapic config and BUILD file.\n\nPiperOrigin-RevId: 300152177\n\n52701da10fec2a5f9796e8d12518c0fe574488fe\nFix: apply appropriate namespace/package options for C#, PHP and Ruby.\n\nPiperOrigin-RevId: 300123508\n\n365c029b8cdb63f7751b92ab490f1976e616105c\nAdd CC targets to the kms protos.\n\nThese are needed by go/tink.\n\nPiperOrigin-RevId: 300038469\n\n4ba9aa8a4a1413b88dca5a8fa931824ee9c284e6\nExpose logo recognition API proto for GA.\n\nPiperOrigin-RevId: 299971671\n\n1c9fc2c9e03dadf15f16b1c4f570955bdcebe00e\nAdding ruby_package option to accessapproval.proto for the Ruby client libraries generation.\n\nPiperOrigin-RevId: 299955924\n\n1cc6f0a7bfb147e6f2ede911d9b01e7a9923b719\nbuild(google/maps/routes): generate api clients\n\nPiperOrigin-RevId: 299955905\n\n29a47c965aac79e3fe8e3314482ca0b5967680f0\nIncrease timeout to 1hr for method `dropRange` in bigtable/admin/v2, which is\nsynced with the timeout setting in gapic_yaml.\n\nPiperOrigin-RevId: 299917154\n\n8f631c4c70a60a9c7da3749511ee4ad432b62898\nbuild(google/maps/roads/v1op): move go to monorepo pattern\n\nPiperOrigin-RevId: 299885195\n\nd66816518844ebbf63504c9e8dfc7133921dd2cd\nbuild(google/maps/roads/v1op): Add bazel build files to generate clients.\n\nPiperOrigin-RevId: 299851148\n\naf7dff701fabe029672168649c62356cf1bb43d0\nAdd LogPlayerReports and LogImpressions to Playable Locations service\n\nPiperOrigin-RevId: 299724050\n\nb6927fca808f38df32a642c560082f5bf6538ced\nUpdate BigQuery Connection API v1beta1 proto: added credential to CloudSqlProperties.\n\nPiperOrigin-RevId: 299503150\n\n91e1fb5ef9829c0c7a64bfa5bde330e6ed594378\nchore: update protobuf (protoc) version to 3.11.2\n\nPiperOrigin-RevId: 299404145\n\n30e36b4bee6749c4799f4fc1a51cc8f058ba167d\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 299399890\n\nffbb493674099f265693872ae250711b2238090c\nfeat: cloudbuild/v1 add new fields and annotate OUTPUT_OUT fields.\n\nPiperOrigin-RevId: 299397780\n\nbc973a15818e00c19e121959832676e9b7607456\nbazel: Fix broken common dependency\n\nPiperOrigin-RevId: 299397431\n\n71094a343e3b962e744aa49eb9338219537474e4\nchore: bigtable/admin/v2 publish retry config\n\nPiperOrigin-RevId: 299391875\n\n8f488efd7bda33885cb674ddd023b3678c40bd82\nfeat: Migrate logging to GAPIC v2; release new features.\n\nIMPORTANT: This is a breaking change for client libraries\nin all languages.\n\nCommitter: @lukesneeringer, @jskeet\nPiperOrigin-RevId: 299370279\n\n007605bf9ad3a1fd775014ebefbf7f1e6b31ee71\nUpdate API for bigqueryreservation v1beta1.\n- Adds flex capacity commitment plan to CapacityCommitment.\n- Adds methods for getting and updating BiReservations.\n- Adds methods for updating/splitting/merging CapacityCommitments.\n\nPiperOrigin-RevId: 299368059\n\n" - } - }, - { - "template": { - "name": "node_library", - "origin": "synthtool.gcp", - "version": "2020.2.4" + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "6f32150677c9784f3c3a7e1949472bd29c9d72c5" } } ], diff --git a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js index 029b4d88171..a0f6f03ee57 100644 --- a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js @@ -17,10 +17,10 @@ // ** All changes to this file may be overwritten. ** /* eslint-disable node/no-missing-require, no-unused-vars */ -const {BigQueryReadClient} = require('@google-cloud/bigquery-storage'); +const storage = require('@google-cloud/bigquery-storage'); function main() { - const bigQueryReadClient = new BigQueryReadClient(); + const bigQueryReadClient = new storage.BigQueryReadClient(); } main(); diff --git a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts index 5c67c093939..5edf8f362ab 100644 --- a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts @@ -19,8 +19,7 @@ import {BigQueryReadClient} from '@google-cloud/bigquery-storage'; function main() { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const bigQueryReadClient = new BigQueryReadClient(); + new BigQueryReadClient(); } main(); diff --git a/packages/google-cloud-bigquery-storage/test/gapic-big_query_read-v1.ts b/packages/google-cloud-bigquery-storage/test/gapic-big_query_read-v1.ts deleted file mode 100644 index 622a2a3d66e..00000000000 --- a/packages/google-cloud-bigquery-storage/test/gapic-big_query_read-v1.ts +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protosTypes from '../protos/protos'; -import * as assert from 'assert'; -import {describe, it} from 'mocha'; -// eslint-disable-next-line @typescript-eslint/no-var-requires -const bigqueryreadModule = require('../src'); - -import {PassThrough} from 'stream'; - -const FAKE_STATUS_CODE = 1; -class FakeError { - name: string; - message: string; - code: number; - constructor(n: number) { - this.name = 'fakeName'; - this.message = 'fake message'; - this.code = n; - } -} -const error = new FakeError(FAKE_STATUS_CODE); -export interface Callback { - (err: FakeError | null, response?: {} | null): void; -} - -export class Operation { - constructor() {} - promise() {} -} -function mockSimpleGrpcMethod( - expectedRequest: {}, - response: {} | null, - error: FakeError | null -) { - return (actualRequest: {}, options: {}, callback: Callback) => { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} -function mockServerStreamingGrpcMethod( - expectedRequest: {}, - response: {} | null, - error: FakeError | null -) { - return (actualRequest: {}) => { - assert.deepStrictEqual(actualRequest, expectedRequest); - const mockStream = new PassThrough({ - objectMode: true, - transform: (chunk: {}, enc: {}, callback: Callback) => { - if (error) { - callback(error); - } else { - callback(null, response); - } - }, - }); - return mockStream; - }; -} -describe('v1.BigQueryReadClient', () => { - it('has servicePath', () => { - const servicePath = bigqueryreadModule.v1.BigQueryReadClient.servicePath; - assert(servicePath); - }); - it('has apiEndpoint', () => { - const apiEndpoint = bigqueryreadModule.v1.BigQueryReadClient.apiEndpoint; - assert(apiEndpoint); - }); - it('has port', () => { - const port = bigqueryreadModule.v1.BigQueryReadClient.port; - assert(port); - assert(typeof port === 'number'); - }); - it('should create a client with no option', () => { - const client = new bigqueryreadModule.v1.BigQueryReadClient(); - assert(client); - }); - it('should create a client with gRPC fallback', () => { - const client = new bigqueryreadModule.v1.BigQueryReadClient({ - fallback: true, - }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new bigqueryreadModule.v1.BigQueryReadClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.bigQueryReadStub, undefined); - await client.initialize(); - assert(client.bigQueryReadStub); - }); - it('has close method', () => { - const client = new bigqueryreadModule.v1.BigQueryReadClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.close(); - }); - describe('createReadSession', () => { - it('invokes createReadSession without error', done => { - const client = new bigqueryreadModule.v1.BigQueryReadClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest = {}; - request.readSession = {}; - request.readSession.table = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createReadSession = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.createReadSession(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes createReadSession with error', done => { - const client = new bigqueryreadModule.v1.BigQueryReadClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest = {}; - request.readSession = {}; - request.readSession.table = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createReadSession = mockSimpleGrpcMethod( - request, - null, - error - ); - client.createReadSession(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('splitReadStream', () => { - it('invokes splitReadStream without error', done => { - const client = new bigqueryreadModule.v1.BigQueryReadClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.splitReadStream = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.splitReadStream(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes splitReadStream with error', done => { - const client = new bigqueryreadModule.v1.BigQueryReadClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.splitReadStream = mockSimpleGrpcMethod( - request, - null, - error - ); - client.splitReadStream(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('readRows', () => { - it('invokes readRows without error', done => { - const client = new bigqueryreadModule.v1.BigQueryReadClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.bigquery.storage.v1.IReadRowsRequest = {}; - request.readStream = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.readRows = mockServerStreamingGrpcMethod( - request, - expectedResponse, - null - ); - const stream = client.readRows(request); - stream.on('data', (response: {}) => { - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - stream.on('error', (err: FakeError) => { - done(err); - }); - stream.write(); - }); - it('invokes readRows with error', done => { - const client = new bigqueryreadModule.v1.BigQueryReadClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.bigquery.storage.v1.IReadRowsRequest = {}; - request.readStream = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.readRows = mockServerStreamingGrpcMethod( - request, - null, - error - ); - const stream = client.readRows(request); - stream.on('data', () => { - assert.fail(); - }); - stream.on('error', (err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - stream.write(); - }); - }); -}); diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts new file mode 100644 index 00000000000..8e8aee52a2b --- /dev/null +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts @@ -0,0 +1,623 @@ +// 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 bigqueryreadModule 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 stubServerStreamingCall( + response?: ResponseType, + error?: Error +) { + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // write something to the stream to trigger transformStub and send the response back to the client + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + return sinon.stub().returns(mockStream); +} + +describe('v1.BigQueryReadClient', () => { + it('has servicePath', () => { + const servicePath = bigqueryreadModule.v1.BigQueryReadClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = bigqueryreadModule.v1.BigQueryReadClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = bigqueryreadModule.v1.BigQueryReadClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new bigqueryreadModule.v1.BigQueryReadClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.bigQueryReadStub, undefined); + await client.initialize(); + assert(client.bigQueryReadStub); + }); + + it('has close method', () => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + 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 bigqueryreadModule.v1.BigQueryReadClient({ + 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('createReadSession', () => { + it('invokes createReadSession without error', async () => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.CreateReadSessionRequest() + ); + request.readSession = {}; + request.readSession.table = ''; + const expectedHeaderRequestParams = 'read_session.table='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.ReadSession() + ); + client.innerApiCalls.createReadSession = stubSimpleCall(expectedResponse); + const [response] = await client.createReadSession(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createReadSession as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createReadSession without error using callback', async () => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.CreateReadSessionRequest() + ); + request.readSession = {}; + request.readSession.table = ''; + const expectedHeaderRequestParams = 'read_session.table='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.ReadSession() + ); + client.innerApiCalls.createReadSession = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createReadSession( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.storage.v1.IReadSession | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createReadSession as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createReadSession with error', async () => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.CreateReadSessionRequest() + ); + request.readSession = {}; + request.readSession.table = ''; + const expectedHeaderRequestParams = 'read_session.table='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createReadSession = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.createReadSession(request); + }, expectedError); + assert( + (client.innerApiCalls.createReadSession as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('splitReadStream', () => { + it('invokes splitReadStream without error', async () => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.SplitReadStreamRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.SplitReadStreamResponse() + ); + client.innerApiCalls.splitReadStream = stubSimpleCall(expectedResponse); + const [response] = await client.splitReadStream(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.splitReadStream as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes splitReadStream without error using callback', async () => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.SplitReadStreamRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.SplitReadStreamResponse() + ); + client.innerApiCalls.splitReadStream = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.splitReadStream( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.splitReadStream as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes splitReadStream with error', async () => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.SplitReadStreamRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.splitReadStream = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.splitReadStream(request); + }, expectedError); + assert( + (client.innerApiCalls.splitReadStream as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('readRows', () => { + it('invokes readRows without error', async () => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.ReadRowsRequest() + ); + request.readStream = ''; + const expectedHeaderRequestParams = 'read_stream='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.ReadRowsResponse() + ); + client.innerApiCalls.readRows = stubServerStreamingCall(expectedResponse); + const stream = client.readRows(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.storage.v1.ReadRowsResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.readRows as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions) + ); + }); + + it('invokes readRows with error', async () => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.ReadRowsRequest() + ); + request.readStream = ''; + const expectedHeaderRequestParams = 'read_stream='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.readRows = stubServerStreamingCall( + undefined, + expectedError + ); + const stream = client.readRows(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.storage.v1.ReadRowsResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(async () => { + await promise; + }, expectedError); + assert( + (client.innerApiCalls.readRows as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions) + ); + }); + }); + + describe('Path templates', () => { + describe('readSession', () => { + const fakePath = '/rendered/path/readSession'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + }; + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.readSessionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.readSessionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('readSessionPath', () => { + const result = client.readSessionPath( + 'projectValue', + 'locationValue', + 'sessionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.readSessionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReadSessionName', () => { + const result = client.matchProjectFromReadSessionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.readSessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReadSessionName', () => { + const result = client.matchLocationFromReadSessionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.readSessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromReadSessionName', () => { + const result = client.matchSessionFromReadSessionName(fakePath); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.readSessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('readStream', () => { + const fakePath = '/rendered/path/readStream'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + stream: 'streamValue', + }; + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.readStreamPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.readStreamPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('readStreamPath', () => { + const result = client.readStreamPath( + 'projectValue', + 'locationValue', + 'sessionValue', + 'streamValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.readStreamPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReadStreamName', () => { + const result = client.matchProjectFromReadStreamName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.readStreamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReadStreamName', () => { + const result = client.matchLocationFromReadStreamName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.readStreamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromReadStreamName', () => { + const result = client.matchSessionFromReadStreamName(fakePath); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.readStreamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchStreamFromReadStreamName', () => { + const result = client.matchStreamFromReadStreamName(fakePath); + assert.strictEqual(result, 'streamValue'); + assert( + (client.pathTemplates.readStreamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts index 47eca9a12c9..7321fc43ee4 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts @@ -271,7 +271,7 @@ describe('v1beta1.BigQueryStorageClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createReadSession(request); }, expectedError); assert( @@ -390,7 +390,7 @@ describe('v1beta1.BigQueryStorageClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.batchCreateReadSessionStreams(request); }, expectedError); assert( @@ -507,7 +507,7 @@ describe('v1beta1.BigQueryStorageClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.finalizeStream(request); }, expectedError); assert( @@ -624,7 +624,7 @@ describe('v1beta1.BigQueryStorageClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.splitReadStream(request); }, expectedError); assert( @@ -722,7 +722,7 @@ describe('v1beta1.BigQueryStorageClient', () => { reject(err); }); }); - assert.rejects(async () => { + await assert.rejects(async () => { await promise; }, expectedError); assert( From bc15d588f69a4884aa4cb7fd4efe7c32c8055422 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sat, 11 Apr 2020 22:20:11 -0700 Subject: [PATCH 029/182] build: remove unused codecov config (#50) --- packages/google-cloud-bigquery-storage/codecov.yaml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 packages/google-cloud-bigquery-storage/codecov.yaml diff --git a/packages/google-cloud-bigquery-storage/codecov.yaml b/packages/google-cloud-bigquery-storage/codecov.yaml deleted file mode 100644 index 5724ea9478d..00000000000 --- a/packages/google-cloud-bigquery-storage/codecov.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -codecov: - ci: - - source.cloud.google.com From 85efecf48ff4eea6a9346491f8cffdba0e6f1f88 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 13 Apr 2020 09:32:42 -0700 Subject: [PATCH 030/182] docs: update doc urls (#51) --- .../google/cloud/bigquery/storage/v1/arrow.proto | 2 +- .../cloud/bigquery/storage/v1/stream.proto | 2 +- .../google-cloud-bigquery-storage/synth.metadata | 16 +++++++++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/arrow.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/arrow.proto index 90add9780e1..1c54eeab07f 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/arrow.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/arrow.proto @@ -27,7 +27,7 @@ option php_namespace = "Google\\Cloud\\BigQuery\\Storage\\V1"; // Arrow schema as specified in // https://arrow.apache.org/docs/python/api/datatypes.html // and serialized to bytes using IPC: -// https://arrow.apache.org/docs/ipc.html. +// https://arrow.apache.org/docs/format/Columnar.html#serialization-and-interprocess-communication-ipc // // See code samples on how this message can be deserialized. message ArrowSchema { diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto index 19d4231da5b..febad03675e 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto @@ -99,7 +99,7 @@ message ReadSession { } // Immutable. Table that this ReadSession is reading from, in the form - // `projects/{project_id}/datasets/{dataset_id}/tables/{table_id} + // `projects/{project_id}/datasets/{dataset_id}/tables/{table_id}` string table = 6 [ (google.api.field_behavior) = IMMUTABLE, (google.api.resource_reference) = { diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index daa2e456f0e..7ca8503ec55 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -1,6 +1,20 @@ { - "updateTime": "2020-04-10T23:55:16.301945Z", "sources": [ + { + "git": { + "name": ".", + "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", + "sha": "b5b9492a0c4b86b868a2b33c5c350301db29cc65" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "1bd77e8ce6f953ac641af7966d0c52646afc16a8", + "internalRef": "305974465" + } + }, { "git": { "name": "synthtool", From 32bc6e7c5c7729f81fb2a7f12be774cd07c4b7e1 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 13 Apr 2020 14:57:22 -0700 Subject: [PATCH 031/182] chore: update lint ignore files (#52) --- packages/google-cloud-bigquery-storage/.eslintignore | 3 ++- packages/google-cloud-bigquery-storage/.prettierignore | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/.eslintignore b/packages/google-cloud-bigquery-storage/.eslintignore index 09b31fe735a..9340ad9b86d 100644 --- a/packages/google-cloud-bigquery-storage/.eslintignore +++ b/packages/google-cloud-bigquery-storage/.eslintignore @@ -1,5 +1,6 @@ **/node_modules -src/**/doc/* +**/coverage +test/fixtures build/ docs/ protos/ diff --git a/packages/google-cloud-bigquery-storage/.prettierignore b/packages/google-cloud-bigquery-storage/.prettierignore index f6fac98b0a8..9340ad9b86d 100644 --- a/packages/google-cloud-bigquery-storage/.prettierignore +++ b/packages/google-cloud-bigquery-storage/.prettierignore @@ -1,3 +1,6 @@ -node_modules/* -samples/node_modules/* -src/**/doc/* +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ From 77f70671f85252264e24ee07327cab546a1b61fe Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 13 Apr 2020 19:28:47 -0700 Subject: [PATCH 032/182] chore: remove tslint.json (#53) --- packages/google-cloud-bigquery-storage/tslint.json | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 packages/google-cloud-bigquery-storage/tslint.json diff --git a/packages/google-cloud-bigquery-storage/tslint.json b/packages/google-cloud-bigquery-storage/tslint.json deleted file mode 100644 index 617dc975bae..00000000000 --- a/packages/google-cloud-bigquery-storage/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "gts/tslint.json" -} From 65bf32f7f583e1480296223735cf43d9650f24b0 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 14 Apr 2020 09:55:17 -0700 Subject: [PATCH 033/182] chore: remove unused dev packages (#54) --- packages/google-cloud-bigquery-storage/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index cdf7c977e7c..80ea15bf736 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -41,7 +41,6 @@ "mocha": "^7.0.1", "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", - "prettier": "^1.19.1", "sinon": "^9.0.1", "ts-loader": "^6.2.1", "typescript": "^3.8.3", From dffca87aecc5e73e561d9be0a2787270a48445d5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 15 Apr 2020 17:31:48 +0200 Subject: [PATCH 034/182] chore(deps): update dependency ts-loader to v7 (#55) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [ts-loader](https://togithub.com/TypeStrong/ts-loader) | devDependencies | major | [`^6.2.1` -> `^7.0.0`](https://renovatebot.com/diffs/npm/ts-loader/6.2.2/7.0.0) | --- ### Release Notes
TypeStrong/ts-loader ### [`v7.0.0`](https://togithub.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md#v700) [Compare Source](https://togithub.com/TypeStrong/ts-loader/compare/v6.2.2...v7.0.0) - [Project reference support enhancements](https://togithub.com/TypeStrong/ts-loader/pull/1076) - thanks [@​sheetalkamat](https://togithub.com/sheetalkamat)! - Following the end of life of Node 8, `ts-loader` no longer supports Node 8 **BREAKING CHANGE**
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-bigquery-storage). --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 80ea15bf736..2dd3c73635b 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -42,7 +42,7 @@ "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", - "ts-loader": "^6.2.1", + "ts-loader": "^7.0.0", "typescript": "^3.8.3", "webpack": "^4.41.6", "webpack-cli": "^3.3.11" From 3156a0cb819818f0a7c02b2adf9b60b8edd43d4b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 15 Apr 2020 18:31:29 +0200 Subject: [PATCH 035/182] chore(deps): update dependency null-loader to v4 (#56) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [null-loader](https://togithub.com/webpack-contrib/null-loader) | devDependencies | major | [`^3.0.0` -> `^4.0.0`](https://renovatebot.com/diffs/npm/null-loader/3.0.0/4.0.0) | --- ### Release Notes
webpack-contrib/null-loader ### [`v4.0.0`](https://togithub.com/webpack-contrib/null-loader/blob/master/CHANGELOG.md#​400-httpsgithubcomwebpack-contribnull-loadercomparev300v400-2020-04-15) [Compare Source](https://togithub.com/webpack-contrib/null-loader/compare/v3.0.0...v4.0.0) ##### Bug Fixes - support `webpack@5` ##### ⚠ BREAKING CHANGES - minimum required Nodejs version is `10.13`
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-bigquery-storage). --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 2dd3c73635b..c430768b059 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -39,7 +39,7 @@ "jsdoc-region-tag": "^1.0.4", "linkinator": "^2.0.1", "mocha": "^7.0.1", - "null-loader": "^3.0.0", + "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", "ts-loader": "^7.0.0", From c65b08eac1b81d7a10d12c70497c32e9dd596cbb Mon Sep 17 00:00:00 2001 From: David Supplee Date: Fri, 17 Apr 2020 13:53:36 -0700 Subject: [PATCH 036/182] chore: add client_documentation (#58) --- packages/google-cloud-bigquery-storage/.repo-metadata.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-bigquery-storage/.repo-metadata.json b/packages/google-cloud-bigquery-storage/.repo-metadata.json index e417e6a9678..09762cf5274 100644 --- a/packages/google-cloud-bigquery-storage/.repo-metadata.json +++ b/packages/google-cloud-bigquery-storage/.repo-metadata.json @@ -2,6 +2,7 @@ "name": "bigquerystorage", "name_pretty": "Google BigQuery Storage", "product_documentation": "https://cloud.google.com/bigquery/docs/reference/storage", + "client_documentation": "https://googleapis.dev/nodejs/bigquerystorage/latest", "issue_tracker": "https://b.corp.google.com/savedsearches/559654", "release_level": "beta", "language": "nodejs", From 539578d1e6b9b17be216c5479d624a1f91a2eb10 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 17 Apr 2020 16:12:06 -0700 Subject: [PATCH 037/182] chore: update linting (#57) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/e2decde6-d852-4ee4-a679-2a536210319e/targets --- packages/google-cloud-bigquery-storage/synth.metadata | 8 ++++---- .../google-cloud-bigquery-storage/system-test/install.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 7ca8503ec55..03cfbcff61d 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,22 +4,22 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "b5b9492a0c4b86b868a2b33c5c350301db29cc65" + "sha": "6b00060ca9bbd07cc540e7f29eb33404c58cdccf" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "1bd77e8ce6f953ac641af7966d0c52646afc16a8", - "internalRef": "305974465" + "sha": "dea1f52034d188ca371c3a70c716ca2a6b3f2aa1", + "internalRef": "306298030" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "6f32150677c9784f3c3a7e1949472bd29c9d72c5" + "sha": "682c0c37d1054966ca662a44259e96cc7aea4413" } } ], diff --git a/packages/google-cloud-bigquery-storage/system-test/install.ts b/packages/google-cloud-bigquery-storage/system-test/install.ts index c4d80e9c0c8..4c1ba3eb79a 100644 --- a/packages/google-cloud-bigquery-storage/system-test/install.ts +++ b/packages/google-cloud-bigquery-storage/system-test/install.ts @@ -21,7 +21,7 @@ import {readFileSync} from 'fs'; import {describe, it} from 'mocha'; describe('typescript consumer tests', () => { - it('should have correct type signature for typescript users', async function() { + it('should have correct type signature for typescript users', async function () { this.timeout(300000); const options = { packageDir: process.cwd(), // path to your module. @@ -35,7 +35,7 @@ describe('typescript consumer tests', () => { await packNTest(options); // will throw upon error. }); - it('should have correct type signature for javascript users', async function() { + it('should have correct type signature for javascript users', async function () { this.timeout(300000); const options = { packageDir: process.cwd(), // path to your module. From 6abd4745e8c727b2dd03561ba0253ac29361b4cc Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 20 Apr 2020 15:40:29 -0700 Subject: [PATCH 038/182] docs: add reference doc link (#60) --- packages/google-cloud-bigquery-storage/README.md | 7 +++++-- packages/google-cloud-bigquery-storage/synth.metadata | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/README.md b/packages/google-cloud-bigquery-storage/README.md index 4dc17dfd9d0..6e66eb377d7 100644 --- a/packages/google-cloud-bigquery-storage/README.md +++ b/packages/google-cloud-bigquery-storage/README.md @@ -14,7 +14,7 @@ Client for the BigQuery Storage API - +* [Google BigQuery Storage Node.js Client API Reference][client-docs] * [Google BigQuery Storage Documentation][product-docs] * [github.com/googleapis/nodejs-bigquery-storage](https://github.com/googleapis/nodejs-bigquery-storage) @@ -190,6 +190,9 @@ has instructions for running the samples. +The [Google BigQuery Storage 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/). @@ -245,7 +248,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-bigquery-storage/blob/master/LICENSE) - +[client-docs]: https://googleapis.dev/nodejs/bigquerystorage/latest [product-docs]: https://cloud.google.com/bigquery/docs/reference/storage [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 03cfbcff61d..dc56cff4f20 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,22 +4,22 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "6b00060ca9bbd07cc540e7f29eb33404c58cdccf" + "sha": "aa16f9c028724dbab16ece815408771a36935dee" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "dea1f52034d188ca371c3a70c716ca2a6b3f2aa1", - "internalRef": "306298030" + "sha": "42ee97c1b93a0e3759bbba3013da309f670a90ab", + "internalRef": "307114445" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "682c0c37d1054966ca662a44259e96cc7aea4413" + "sha": "19465d3ec5e5acdb01521d8f3bddd311bcbee28d" } } ], From cfb492cb8eb4889021dd0dbb2164c6f36ce65888 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 21 Apr 2020 20:40:16 -0700 Subject: [PATCH 039/182] build: adopt changes to generator formatting (#61) --- .../protos/protos.js | 412 +++++++++--------- .../synth.metadata | 2 +- 2 files changed, 207 insertions(+), 207 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index 402f59277c5..d1ff86ad210 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/protos/protos.js @@ -131,7 +131,7 @@ ArrowSchema.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.serializedSchema != null && message.hasOwnProperty("serializedSchema")) + if (message.serializedSchema != null && Object.hasOwnProperty.call(message, "serializedSchema")) writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.serializedSchema); return writer; }; @@ -336,9 +336,9 @@ ArrowRecordBatch.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.serializedRecordBatch != null && message.hasOwnProperty("serializedRecordBatch")) + if (message.serializedRecordBatch != null && Object.hasOwnProperty.call(message, "serializedRecordBatch")) writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.serializedRecordBatch); - if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.rowCount); return writer; }; @@ -560,7 +560,7 @@ AvroSchema.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.schema != null && message.hasOwnProperty("schema")) + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.schema); return writer; }; @@ -756,9 +756,9 @@ AvroRows.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.serializedBinaryRows != null && message.hasOwnProperty("serializedBinaryRows")) + if (message.serializedBinaryRows != null && Object.hasOwnProperty.call(message, "serializedBinaryRows")) writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.serializedBinaryRows); - if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.rowCount); return writer; }; @@ -1132,11 +1132,11 @@ CreateReadSessionRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.readSession != null && message.hasOwnProperty("readSession")) + if (message.readSession != null && Object.hasOwnProperty.call(message, "readSession")) $root.google.cloud.bigquery.storage.v1.ReadSession.encode(message.readSession, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.maxStreamCount != null && message.hasOwnProperty("maxStreamCount")) + if (message.maxStreamCount != null && Object.hasOwnProperty.call(message, "maxStreamCount")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxStreamCount); return writer; }; @@ -1360,9 +1360,9 @@ ReadRowsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.readStream != null && message.hasOwnProperty("readStream")) + if (message.readStream != null && Object.hasOwnProperty.call(message, "readStream")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.readStream); - if (message.offset != null && message.hasOwnProperty("offset")) + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.offset); return writer; }; @@ -1575,7 +1575,7 @@ ThrottleState.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.throttlePercent != null && message.hasOwnProperty("throttlePercent")) + if (message.throttlePercent != null && Object.hasOwnProperty.call(message, "throttlePercent")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.throttlePercent); return writer; }; @@ -1762,7 +1762,7 @@ StreamStats.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.progress != null && message.hasOwnProperty("progress")) + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) $root.google.cloud.bigquery.storage.v1.StreamStats.Progress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -1960,9 +1960,9 @@ Progress.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.atResponseStart != null && message.hasOwnProperty("atResponseStart")) + if (message.atResponseStart != null && Object.hasOwnProperty.call(message, "atResponseStart")) writer.uint32(/* id 1, wireType 1 =*/9).double(message.atResponseStart); - if (message.atResponseEnd != null && message.hasOwnProperty("atResponseEnd")) + if (message.atResponseEnd != null && Object.hasOwnProperty.call(message, "atResponseEnd")) writer.uint32(/* id 2, wireType 1 =*/17).double(message.atResponseEnd); return writer; }; @@ -2214,15 +2214,15 @@ ReadRowsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.stats != null && message.hasOwnProperty("stats")) + if (message.stats != null && Object.hasOwnProperty.call(message, "stats")) $root.google.cloud.bigquery.storage.v1.StreamStats.encode(message.stats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.avroRows != null && message.hasOwnProperty("avroRows")) + if (message.avroRows != null && Object.hasOwnProperty.call(message, "avroRows")) $root.google.cloud.bigquery.storage.v1.AvroRows.encode(message.avroRows, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.arrowRecordBatch != null && message.hasOwnProperty("arrowRecordBatch")) + if (message.arrowRecordBatch != null && Object.hasOwnProperty.call(message, "arrowRecordBatch")) $root.google.cloud.bigquery.storage.v1.ArrowRecordBatch.encode(message.arrowRecordBatch, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.throttleState != null && message.hasOwnProperty("throttleState")) + if (message.throttleState != null && Object.hasOwnProperty.call(message, "throttleState")) $root.google.cloud.bigquery.storage.v1.ThrottleState.encode(message.throttleState, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) writer.uint32(/* id 6, wireType 0 =*/48).int64(message.rowCount); return writer; }; @@ -2510,9 +2510,9 @@ SplitReadStreamRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.fraction != null && message.hasOwnProperty("fraction")) + if (message.fraction != null && Object.hasOwnProperty.call(message, "fraction")) writer.uint32(/* id 2, wireType 1 =*/17).double(message.fraction); return writer; }; @@ -2720,9 +2720,9 @@ SplitReadStreamResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.primaryStream != null && message.hasOwnProperty("primaryStream")) + if (message.primaryStream != null && Object.hasOwnProperty.call(message, "primaryStream")) $root.google.cloud.bigquery.storage.v1.ReadStream.encode(message.primaryStream, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.remainderStream != null && message.hasOwnProperty("remainderStream")) + if (message.remainderStream != null && Object.hasOwnProperty.call(message, "remainderStream")) $root.google.cloud.bigquery.storage.v1.ReadStream.encode(message.remainderStream, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -2878,7 +2878,7 @@ /** * DataFormat enum. * @name google.cloud.bigquery.storage.v1.DataFormat - * @enum {string} + * @enum {number} * @property {number} DATA_FORMAT_UNSPECIFIED=0 DATA_FORMAT_UNSPECIFIED value * @property {number} AVRO=1 AVRO value * @property {number} ARROW=2 ARROW value @@ -3034,21 +3034,21 @@ ReadSession.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + if (message.dataFormat != null && Object.hasOwnProperty.call(message, "dataFormat")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.dataFormat); - if (message.avroSchema != null && message.hasOwnProperty("avroSchema")) + if (message.avroSchema != null && Object.hasOwnProperty.call(message, "avroSchema")) $root.google.cloud.bigquery.storage.v1.AvroSchema.encode(message.avroSchema, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.arrowSchema != null && message.hasOwnProperty("arrowSchema")) + if (message.arrowSchema != null && Object.hasOwnProperty.call(message, "arrowSchema")) $root.google.cloud.bigquery.storage.v1.ArrowSchema.encode(message.arrowSchema, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.table != null && message.hasOwnProperty("table")) + if (message.table != null && Object.hasOwnProperty.call(message, "table")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.table); - if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) + if (message.tableModifiers != null && Object.hasOwnProperty.call(message, "tableModifiers")) $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.encode(message.tableModifiers, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.readOptions != null && message.hasOwnProperty("readOptions")) + if (message.readOptions != null && Object.hasOwnProperty.call(message, "readOptions")) $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.encode(message.readOptions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.streams != null && message.streams.length) for (var i = 0; i < message.streams.length; ++i) @@ -3400,7 +3400,7 @@ TableModifiers.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) + if (message.snapshotTime != null && Object.hasOwnProperty.call(message, "snapshotTime")) $root.google.protobuf.Timestamp.encode(message.snapshotTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -3605,7 +3605,7 @@ if (message.selectedFields != null && message.selectedFields.length) for (var i = 0; i < message.selectedFields.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectedFields[i]); - if (message.rowRestriction != null && message.hasOwnProperty("rowRestriction")) + if (message.rowRestriction != null && Object.hasOwnProperty.call(message, "rowRestriction")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.rowRestriction); return writer; }; @@ -3821,7 +3821,7 @@ ReadStream.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -4020,7 +4020,7 @@ ArrowSchema.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.serializedSchema != null && message.hasOwnProperty("serializedSchema")) + if (message.serializedSchema != null && Object.hasOwnProperty.call(message, "serializedSchema")) writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.serializedSchema); return writer; }; @@ -4225,9 +4225,9 @@ ArrowRecordBatch.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.serializedRecordBatch != null && message.hasOwnProperty("serializedRecordBatch")) + if (message.serializedRecordBatch != null && Object.hasOwnProperty.call(message, "serializedRecordBatch")) writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.serializedRecordBatch); - if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.rowCount); return writer; }; @@ -4449,7 +4449,7 @@ AvroSchema.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.schema != null && message.hasOwnProperty("schema")) + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.schema); return writer; }; @@ -4645,9 +4645,9 @@ AvroRows.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.serializedBinaryRows != null && message.hasOwnProperty("serializedBinaryRows")) + if (message.serializedBinaryRows != null && Object.hasOwnProperty.call(message, "serializedBinaryRows")) writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.serializedBinaryRows); - if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.rowCount); return writer; }; @@ -4882,7 +4882,7 @@ if (message.selectedFields != null && message.selectedFields.length) for (var i = 0; i < message.selectedFields.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectedFields[i]); - if (message.rowRestriction != null && message.hasOwnProperty("rowRestriction")) + if (message.rowRestriction != null && Object.hasOwnProperty.call(message, "rowRestriction")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.rowRestriction); return writer; }; @@ -5295,7 +5295,7 @@ Stream.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -5491,9 +5491,9 @@ StreamPosition.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.stream != null && message.hasOwnProperty("stream")) + if (message.stream != null && Object.hasOwnProperty.call(message, "stream")) $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.stream, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.offset != null && message.hasOwnProperty("offset")) + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.offset); return writer; }; @@ -5789,22 +5789,22 @@ ReadSession.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.expireTime != null && message.hasOwnProperty("expireTime")) + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.streams != null && message.streams.length) for (var i = 0; i < message.streams.length; ++i) $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.streams[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.avroSchema != null && message.hasOwnProperty("avroSchema")) + if (message.avroSchema != null && Object.hasOwnProperty.call(message, "avroSchema")) $root.google.cloud.bigquery.storage.v1beta1.AvroSchema.encode(message.avroSchema, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.arrowSchema != null && message.hasOwnProperty("arrowSchema")) + if (message.arrowSchema != null && Object.hasOwnProperty.call(message, "arrowSchema")) $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema.encode(message.arrowSchema, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.tableReference != null && message.hasOwnProperty("tableReference")) + if (message.tableReference != null && Object.hasOwnProperty.call(message, "tableReference")) $root.google.cloud.bigquery.storage.v1beta1.TableReference.encode(message.tableReference, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) + if (message.tableModifiers != null && Object.hasOwnProperty.call(message, "tableModifiers")) $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.encode(message.tableModifiers, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.shardingStrategy != null && message.hasOwnProperty("shardingStrategy")) + if (message.shardingStrategy != null && Object.hasOwnProperty.call(message, "shardingStrategy")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.shardingStrategy); return writer; }; @@ -6199,19 +6199,19 @@ CreateReadSessionRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.tableReference != null && message.hasOwnProperty("tableReference")) + if (message.tableReference != null && Object.hasOwnProperty.call(message, "tableReference")) $root.google.cloud.bigquery.storage.v1beta1.TableReference.encode(message.tableReference, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) + if (message.tableModifiers != null && Object.hasOwnProperty.call(message, "tableModifiers")) $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.encode(message.tableModifiers, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestedStreams != null && message.hasOwnProperty("requestedStreams")) + if (message.requestedStreams != null && Object.hasOwnProperty.call(message, "requestedStreams")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.requestedStreams); - if (message.readOptions != null && message.hasOwnProperty("readOptions")) + if (message.readOptions != null && Object.hasOwnProperty.call(message, "readOptions")) $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions.encode(message.readOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.format != null && message.hasOwnProperty("format")) + if (message.format != null && Object.hasOwnProperty.call(message, "format")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.format); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.parent); - if (message.shardingStrategy != null && message.hasOwnProperty("shardingStrategy")) + if (message.shardingStrategy != null && Object.hasOwnProperty.call(message, "shardingStrategy")) writer.uint32(/* id 7, wireType 0 =*/56).int32(message.shardingStrategy); return writer; }; @@ -6463,7 +6463,7 @@ /** * DataFormat enum. * @name google.cloud.bigquery.storage.v1beta1.DataFormat - * @enum {string} + * @enum {number} * @property {number} DATA_FORMAT_UNSPECIFIED=0 DATA_FORMAT_UNSPECIFIED value * @property {number} AVRO=1 AVRO value * @property {number} ARROW=3 ARROW value @@ -6479,7 +6479,7 @@ /** * ShardingStrategy enum. * @name google.cloud.bigquery.storage.v1beta1.ShardingStrategy - * @enum {string} + * @enum {number} * @property {number} SHARDING_STRATEGY_UNSPECIFIED=0 SHARDING_STRATEGY_UNSPECIFIED value * @property {number} LIQUID=1 LIQUID value * @property {number} BALANCED=2 BALANCED value @@ -6548,7 +6548,7 @@ ReadRowsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.readPosition != null && message.hasOwnProperty("readPosition")) + if (message.readPosition != null && Object.hasOwnProperty.call(message, "readPosition")) $root.google.cloud.bigquery.storage.v1beta1.StreamPosition.encode(message.readPosition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -6767,13 +6767,13 @@ StreamStatus.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.estimatedRowCount != null && message.hasOwnProperty("estimatedRowCount")) + if (message.estimatedRowCount != null && Object.hasOwnProperty.call(message, "estimatedRowCount")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.estimatedRowCount); - if (message.fractionConsumed != null && message.hasOwnProperty("fractionConsumed")) + if (message.fractionConsumed != null && Object.hasOwnProperty.call(message, "fractionConsumed")) writer.uint32(/* id 2, wireType 5 =*/21).float(message.fractionConsumed); - if (message.isSplittable != null && message.hasOwnProperty("isSplittable")) + if (message.isSplittable != null && Object.hasOwnProperty.call(message, "isSplittable")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isSplittable); - if (message.progress != null && message.hasOwnProperty("progress")) + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) $root.google.cloud.bigquery.storage.v1beta1.Progress.encode(message.progress, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -7022,9 +7022,9 @@ Progress.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.atResponseStart != null && message.hasOwnProperty("atResponseStart")) + if (message.atResponseStart != null && Object.hasOwnProperty.call(message, "atResponseStart")) writer.uint32(/* id 1, wireType 5 =*/13).float(message.atResponseStart); - if (message.atResponseEnd != null && message.hasOwnProperty("atResponseEnd")) + if (message.atResponseEnd != null && Object.hasOwnProperty.call(message, "atResponseEnd")) writer.uint32(/* id 2, wireType 5 =*/21).float(message.atResponseEnd); return writer; }; @@ -7223,7 +7223,7 @@ ThrottleStatus.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.throttlePercent != null && message.hasOwnProperty("throttlePercent")) + if (message.throttlePercent != null && Object.hasOwnProperty.call(message, "throttlePercent")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.throttlePercent); return writer; }; @@ -7460,15 +7460,15 @@ ReadRowsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.status != null && message.hasOwnProperty("status")) + if (message.status != null && Object.hasOwnProperty.call(message, "status")) $root.google.cloud.bigquery.storage.v1beta1.StreamStatus.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.avroRows != null && message.hasOwnProperty("avroRows")) + if (message.avroRows != null && Object.hasOwnProperty.call(message, "avroRows")) $root.google.cloud.bigquery.storage.v1beta1.AvroRows.encode(message.avroRows, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.arrowRecordBatch != null && message.hasOwnProperty("arrowRecordBatch")) + if (message.arrowRecordBatch != null && Object.hasOwnProperty.call(message, "arrowRecordBatch")) $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.encode(message.arrowRecordBatch, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.throttleStatus != null && message.hasOwnProperty("throttleStatus")) + if (message.throttleStatus != null && Object.hasOwnProperty.call(message, "throttleStatus")) $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus.encode(message.throttleStatus, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) writer.uint32(/* id 6, wireType 0 =*/48).int64(message.rowCount); return writer; }; @@ -7756,9 +7756,9 @@ BatchCreateReadSessionStreamsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.session != null && message.hasOwnProperty("session")) + if (message.session != null && Object.hasOwnProperty.call(message, "session")) $root.google.cloud.bigquery.storage.v1beta1.ReadSession.encode(message.session, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.requestedStreams != null && message.hasOwnProperty("requestedStreams")) + if (message.requestedStreams != null && Object.hasOwnProperty.call(message, "requestedStreams")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.requestedStreams); return writer; }; @@ -8170,7 +8170,7 @@ FinalizeStreamRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.stream != null && message.hasOwnProperty("stream")) + if (message.stream != null && Object.hasOwnProperty.call(message, "stream")) $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.stream, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -8371,9 +8371,9 @@ SplitReadStreamRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.originalStream != null && message.hasOwnProperty("originalStream")) + if (message.originalStream != null && Object.hasOwnProperty.call(message, "originalStream")) $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.originalStream, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fraction != null && message.hasOwnProperty("fraction")) + if (message.fraction != null && Object.hasOwnProperty.call(message, "fraction")) writer.uint32(/* id 2, wireType 5 =*/21).float(message.fraction); return writer; }; @@ -8586,9 +8586,9 @@ SplitReadStreamResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.primaryStream != null && message.hasOwnProperty("primaryStream")) + if (message.primaryStream != null && Object.hasOwnProperty.call(message, "primaryStream")) $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.primaryStream, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.remainderStream != null && message.hasOwnProperty("remainderStream")) + if (message.remainderStream != null && Object.hasOwnProperty.call(message, "remainderStream")) $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.remainderStream, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -8815,11 +8815,11 @@ TableReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.datasetId != null && message.hasOwnProperty("datasetId")) + if (message.datasetId != null && Object.hasOwnProperty.call(message, "datasetId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.datasetId); - if (message.tableId != null && message.hasOwnProperty("tableId")) + if (message.tableId != null && Object.hasOwnProperty.call(message, "tableId")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.tableId); return writer; }; @@ -9029,7 +9029,7 @@ TableModifiers.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) + if (message.snapshotTime != null && Object.hasOwnProperty.call(message, "snapshotTime")) $root.google.protobuf.Timestamp.encode(message.snapshotTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -9255,7 +9255,7 @@ if (message.rules != null && message.rules.length) for (var i = 0; i < message.rules.length; ++i) $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); return writer; }; @@ -9569,26 +9569,26 @@ HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selector != null && message.hasOwnProperty("selector")) + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && message.hasOwnProperty("get")) + if (message.get != null && Object.hasOwnProperty.call(message, "get")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && message.hasOwnProperty("put")) + if (message.put != null && Object.hasOwnProperty.call(message, "put")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && message.hasOwnProperty("post")) + if (message.post != null && Object.hasOwnProperty.call(message, "post")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && message.hasOwnProperty("delete")) + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && message.hasOwnProperty("patch")) + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && message.hasOwnProperty("body")) + if (message.body != null && Object.hasOwnProperty.call(message, "body")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && message.hasOwnProperty("custom")) + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.additionalBindings != null && message.additionalBindings.length) for (var i = 0; i < message.additionalBindings.length; ++i) $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); return writer; }; @@ -9945,9 +9945,9 @@ CustomHttpPattern.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && message.hasOwnProperty("path")) + if (message.path != null && Object.hasOwnProperty.call(message, "path")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); return writer; }; @@ -10093,7 +10093,7 @@ /** * FieldBehavior enum. * @name google.api.FieldBehavior - * @enum {string} + * @enum {number} * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value * @property {number} OPTIONAL=1 OPTIONAL value * @property {number} REQUIRED=2 REQUIRED value @@ -10214,18 +10214,18 @@ ResourceDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); if (message.pattern != null && message.pattern.length) for (var i = 0; i < message.pattern.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && message.hasOwnProperty("nameField")) + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && message.hasOwnProperty("history")) + if (message.history != null && Object.hasOwnProperty.call(message, "history")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && message.hasOwnProperty("plural")) + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && message.hasOwnProperty("singular")) + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); return writer; }; @@ -10445,7 +10445,7 @@ /** * History enum. * @name google.api.ResourceDescriptor.History - * @enum {string} + * @enum {number} * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value @@ -10526,9 +10526,9 @@ ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && message.hasOwnProperty("childType")) + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); return writer; }; @@ -11053,9 +11053,9 @@ FileDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && message.hasOwnProperty("package")) + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); if (message.dependency != null && message.dependency.length) for (var i = 0; i < message.dependency.length; ++i) @@ -11072,9 +11072,9 @@ if (message.extension != null && message.extension.length) for (var i = 0; i < message.extension.length; ++i) $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); if (message.publicDependency != null && message.publicDependency.length) for (var i = 0; i < message.publicDependency.length; ++i) @@ -11082,7 +11082,7 @@ if (message.weakDependency != null && message.weakDependency.length) for (var i = 0; i < message.weakDependency.length; ++i) writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && message.hasOwnProperty("syntax")) + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); return writer; }; @@ -11620,7 +11620,7 @@ DescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.field != null && message.field.length) for (var i = 0; i < message.field.length; ++i) @@ -11637,7 +11637,7 @@ if (message.extension != null && message.extension.length) for (var i = 0; i < message.extension.length; ++i) $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.oneofDecl != null && message.oneofDecl.length) for (var i = 0; i < message.oneofDecl.length; ++i) @@ -12102,11 +12102,11 @@ ExtensionRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -12330,9 +12330,9 @@ ReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -12823,25 +12823,25 @@ FieldDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && message.hasOwnProperty("extendee")) + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && message.hasOwnProperty("label")) + if (message.label != null && Object.hasOwnProperty.call(message, "label")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && message.hasOwnProperty("typeName")) + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); return writer; }; @@ -13188,7 +13188,7 @@ /** * Type enum. * @name google.protobuf.FieldDescriptorProto.Type - * @enum {string} + * @enum {number} * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value * @property {number} TYPE_INT64=3 TYPE_INT64 value @@ -13234,7 +13234,7 @@ /** * Label enum. * @name google.protobuf.FieldDescriptorProto.Label - * @enum {string} + * @enum {number} * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value @@ -13315,9 +13315,9 @@ OneofDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -13560,12 +13560,12 @@ EnumDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.value != null && message.value.length) for (var i = 0; i < message.value.length; ++i) $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.reservedRange != null && message.reservedRange.length) for (var i = 0; i < message.reservedRange.length; ++i) @@ -13868,9 +13868,9 @@ EnumReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -14090,11 +14090,11 @@ EnumValueDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -14328,12 +14328,12 @@ ServiceDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.method != null && message.method.length) for (var i = 0; i < message.method.length; ++i) $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -14613,17 +14613,17 @@ MethodDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && message.hasOwnProperty("inputType")) + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && message.hasOwnProperty("outputType")) + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && message.hasOwnProperty("options")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); return writer; }; @@ -15062,45 +15062,45 @@ FileOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -15527,7 +15527,7 @@ /** * OptimizeMode enum. * @name google.protobuf.FileOptions.OptimizeMode - * @enum {string} + * @enum {number} * @property {number} SPEED=1 SPEED value * @property {number} CODE_SIZE=2 CODE_SIZE value * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value @@ -15645,18 +15645,18 @@ MessageOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); return writer; }; @@ -15998,17 +15998,17 @@ FieldOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.ctype != null && message.hasOwnProperty("ctype")) + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && message.hasOwnProperty("packed")) + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && message.hasOwnProperty("lazy")) + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && message.hasOwnProperty("jstype")) + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && message.hasOwnProperty("weak")) + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -16019,7 +16019,7 @@ writer.int32(message[".google.api.fieldBehavior"][i]); writer.ldelim(); } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); return writer; }; @@ -16355,7 +16355,7 @@ /** * CType enum. * @name google.protobuf.FieldOptions.CType - * @enum {string} + * @enum {number} * @property {number} STRING=0 STRING value * @property {number} CORD=1 CORD value * @property {number} STRING_PIECE=2 STRING_PIECE value @@ -16371,7 +16371,7 @@ /** * JSType enum. * @name google.protobuf.FieldOptions.JSType - * @enum {string} + * @enum {number} * @property {number} JS_NORMAL=0 JS_NORMAL value * @property {number} JS_STRING=1 JS_STRING value * @property {number} JS_NUMBER=2 JS_NUMBER value @@ -16670,9 +16670,9 @@ EnumOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -16915,7 +16915,7 @@ EnumValueOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -17164,14 +17164,14 @@ ServiceOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); return writer; }; @@ -17450,9 +17450,9 @@ MethodOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -17460,7 +17460,7 @@ if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); return writer; }; @@ -17694,7 +17694,7 @@ /** * IdempotencyLevel enum. * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {string} + * @enum {number} * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value * @property {number} IDEMPOTENT=2 IDEMPOTENT value @@ -17824,17 +17824,17 @@ if (message.name != null && message.name.length) for (var i = 0; i < message.name.length; ++i) $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); return writer; }; @@ -18611,9 +18611,9 @@ writer.int32(message.span[i]); writer.ldelim(); } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) for (var i = 0; i < message.leadingDetachedComments.length; ++i) @@ -19144,11 +19144,11 @@ writer.int32(message.path[i]); writer.ldelim(); } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && message.hasOwnProperty("begin")) + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); return writer; }; @@ -19401,9 +19401,9 @@ Timestamp.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && message.hasOwnProperty("seconds")) + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && message.hasOwnProperty("nanos")) + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index dc56cff4f20..19a48798bee 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "aa16f9c028724dbab16ece815408771a36935dee" + "sha": "492650446385640eeec9036f9252b3b88ea49d53" } }, { From 8339d90c6ccdcdeead67cd967f150c13a39042df Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 23 Apr 2020 19:35:01 -0700 Subject: [PATCH 040/182] chore: update npm scripts and synth.py (#62) Update npm scripts: add clean, prelint, prefix; make sure that lint and fix are set properly. Use post-process feature of synthtool. --- packages/google-cloud-bigquery-storage/package.json | 5 +++-- packages/google-cloud-bigquery-storage/synth.py | 7 ++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index c430768b059..fd1d33664cc 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -19,11 +19,12 @@ "docs-test": "linkinator docs", "fix": "gts fix", "prelint": "cd samples; npm link ../; npm install", - "lint": "gts fix", + "lint": "gts check", "prepare": "npm run compile-protos && npm run compile", "system-test": "c8 mocha build/system-test", "test": "c8 mocha build/test", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../" + "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", + "precompile": "gts clean" }, "dependencies": { "google-gax": "^2.1.0" diff --git a/packages/google-cloud-bigquery-storage/synth.py b/packages/google-cloud-bigquery-storage/synth.py index 24ecbba9777..01ba810400a 100644 --- a/packages/google-cloud-bigquery-storage/synth.py +++ b/packages/google-cloud-bigquery-storage/synth.py @@ -14,7 +14,7 @@ """This script is used to synthesize generated parts of this library.""" import synthtool as s import synthtool.gcp as gcp -import subprocess +import synthtool.languages.node as node import logging logging.basicConfig(level=logging.DEBUG) @@ -39,7 +39,4 @@ 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 +node.postprocess_gapic_library() From ca268655fa7c559de735ef10726b78f15d02253c Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 5 May 2020 19:38:07 -0700 Subject: [PATCH 041/182] fix: regen protos and tests (#63) --- .../synth.metadata | 14 +++-------- .../test/gapic_big_query_read_v1.ts | 12 +++------- .../test/gapic_big_query_storage_v1beta1.ts | 23 +++++++------------ 3 files changed, 14 insertions(+), 35 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 19a48798bee..b20225c0063 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -3,23 +3,15 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "492650446385640eeec9036f9252b3b88ea49d53" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "42ee97c1b93a0e3759bbba3013da309f670a90ab", - "internalRef": "307114445" + "remote": "git@github.com:googleapis/nodejs-bigquery-storage.git", + "sha": "775dd910ebac4fcc62f728c2d354ef503fb757f7" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "19465d3ec5e5acdb01521d8f3bddd311bcbee28d" + "sha": "ab883569eb0257bbf16a6d825fd018b3adde3912" } } ], diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts index 8e8aee52a2b..bac7067ae3c 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts @@ -260,9 +260,7 @@ describe('v1.BigQueryReadClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.createReadSession(request); - }, expectedError); + await assert.rejects(client.createReadSession(request), expectedError); assert( (client.innerApiCalls.createReadSession as SinonStub) .getCall(0) @@ -374,9 +372,7 @@ describe('v1.BigQueryReadClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.splitReadStream(request); - }, expectedError); + await assert.rejects(client.splitReadStream(request), expectedError); assert( (client.innerApiCalls.splitReadStream as SinonStub) .getCall(0) @@ -468,9 +464,7 @@ describe('v1.BigQueryReadClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.innerApiCalls.readRows as SinonStub) .getCall(0) diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts index 7321fc43ee4..e122cb23bd2 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts @@ -271,9 +271,7 @@ describe('v1beta1.BigQueryStorageClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.createReadSession(request); - }, expectedError); + await assert.rejects(client.createReadSession(request), expectedError); assert( (client.innerApiCalls.createReadSession as SinonStub) .getCall(0) @@ -390,9 +388,10 @@ describe('v1beta1.BigQueryStorageClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.batchCreateReadSessionStreams(request); - }, expectedError); + await assert.rejects( + client.batchCreateReadSessionStreams(request), + expectedError + ); assert( (client.innerApiCalls.batchCreateReadSessionStreams as SinonStub) .getCall(0) @@ -507,9 +506,7 @@ describe('v1beta1.BigQueryStorageClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.finalizeStream(request); - }, expectedError); + await assert.rejects(client.finalizeStream(request), expectedError); assert( (client.innerApiCalls.finalizeStream as SinonStub) .getCall(0) @@ -624,9 +621,7 @@ describe('v1beta1.BigQueryStorageClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.splitReadStream(request); - }, expectedError); + await assert.rejects(client.splitReadStream(request), expectedError); assert( (client.innerApiCalls.splitReadStream as SinonStub) .getCall(0) @@ -722,9 +717,7 @@ describe('v1beta1.BigQueryStorageClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.innerApiCalls.readRows as SinonStub) .getCall(0) From 624ad2a01d938d4d5c5a08ff6e39865e0c1c90ce Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 6 May 2020 12:00:07 -0700 Subject: [PATCH 042/182] feat: additional type annotation (#64) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/d5e01c0b-0d2d-4da4-b495-86674ea6021f/targets --- .../bigquery/storage/v1beta1/arrow.proto | 3 +-- .../cloud/bigquery/storage/v1beta1/avro.proto | 3 +-- .../storage/v1beta1/read_options.proto | 3 +-- .../bigquery/storage/v1beta1/storage.proto | 21 ++++++++++--------- .../storage/v1beta1/table_reference.proto | 3 +-- .../protos/protos.json | 13 +++++++++--- .../src/v1beta1/big_query_storage_client.ts | 4 ++-- .../synth.metadata | 12 +++++++++-- 8 files changed, 37 insertions(+), 25 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/arrow.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/arrow.proto index 3003de444c2..f70c61c7246 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/arrow.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/arrow.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,7 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/avro.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/avro.proto index 021d8e44f9f..7d034a28a7e 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/avro.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/avro.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,7 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/read_options.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/read_options.proto index 8ed9b73f6cf..1ff8d8b5eb6 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/read_options.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/read_options.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,7 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/storage.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/storage.proto index 22f742fbb65..81e77c73af5 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/storage.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/storage.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,7 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; @@ -204,7 +203,12 @@ message CreateReadSessionRequest { // Required. String of the form `projects/{project_id}` indicating the // project this ReadSession is associated with. This is the project that will // be billed for usage. - string parent = 6 [(google.api.field_behavior) = REQUIRED]; + string parent = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; // Any modifiers to the Table (e.g. snapshot timestamp). TableModifiers table_modifiers = 2; @@ -286,9 +290,6 @@ message StreamStatus { float fraction_consumed = 2; // Represents the progress of the current stream. - // - // Note: This value is under development and should not be used. Use - // `fraction_consumed` instead. Progress progress = 4; // Whether this stream can be split. For sessions that use the LIQUID sharding @@ -373,14 +374,14 @@ message BatchCreateReadSessionStreamsResponse { // Request information for invoking `FinalizeStream`. message FinalizeStreamRequest { - // Stream to finalize. - Stream stream = 2; + // Required. Stream to finalize. + Stream stream = 2 [(google.api.field_behavior) = REQUIRED]; } // Request information for `SplitReadStream`. message SplitReadStreamRequest { - // Stream to split. - Stream original_stream = 1; + // Required. Stream to split. + Stream original_stream = 1 [(google.api.field_behavior) = REQUIRED]; // A value in the range (0.0, 1.0) that specifies the fractional point at // which the original stream should be split. The actual split point is diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/table_reference.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/table_reference.proto index a55dc48eb02..4269392f676 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/table_reference.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/table_reference.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,7 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; diff --git a/packages/google-cloud-bigquery-storage/protos/protos.json b/packages/google-cloud-bigquery-storage/protos/protos.json index b14e1b22555..434e158d5fe 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.json +++ b/packages/google-cloud-bigquery-storage/protos/protos.json @@ -550,7 +550,8 @@ "type": "string", "id": 6, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" } }, "tableModifiers": { @@ -703,7 +704,10 @@ "fields": { "stream": { "type": "Stream", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -711,7 +715,10 @@ "fields": { "originalStream": { "type": "Stream", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "fraction": { "type": "float", diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index 89d815f9e06..5e8f75d4414 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -585,7 +585,7 @@ export class BigQueryStorageClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.bigquery.storage.v1beta1.Stream} request.stream - * Stream to finalize. + * Required. Stream to finalize. * @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. @@ -691,7 +691,7 @@ export class BigQueryStorageClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.bigquery.storage.v1beta1.Stream} request.originalStream - * Stream to split. + * Required. Stream to split. * @param {number} request.fraction * A value in the range (0.0, 1.0) that specifies the fractional point at * which the original stream should be split. The actual split point is diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index b20225c0063..7dbe8b175bc 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -3,8 +3,16 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-bigquery-storage.git", - "sha": "775dd910ebac4fcc62f728c2d354ef503fb757f7" + "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", + "sha": "6293832961eedcdd57c24edc311f2c154781e34e" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "a3a0bf0f6291d69f2ff3df7fcd63d28ee20ac727", + "internalRef": "310060413" } }, { From ad807fc9052005c67b1aeec855bae8e66fdd811f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 18 May 2020 09:58:07 -0700 Subject: [PATCH 043/182] build: do not fail builds on codecov errors (#528) (#66) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/74eabfaf-a964-4a5b-b26c-c28d4ae22df0/targets Source-Link: https://github.com/googleapis/synthtool/commit/be74d3e532faa47eb59f1a0eaebde0860d1d8ab4 --- packages/google-cloud-bigquery-storage/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 7dbe8b175bc..f76b8feb32a 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "6293832961eedcdd57c24edc311f2c154781e34e" + "sha": "2d76c0e16abedfaf106db063dc00f79e38166dad" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ab883569eb0257bbf16a6d825fd018b3adde3912" + "sha": "be74d3e532faa47eb59f1a0eaebde0860d1d8ab4" } } ], From 784357fd931f2da026a5da774f394b45cae111df Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 2 Jun 2020 14:52:08 -0700 Subject: [PATCH 044/182] chore: release 2.0.0 (#40) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- .../CHANGELOG.md | 19 +++++++++++++++++++ .../package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md index fee320ce64d..3070a86abbd 100644 --- a/packages/google-cloud-bigquery-storage/CHANGELOG.md +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [2.0.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v1.1.0...v2.0.0) (2020-05-18) + + +### ⚠ BREAKING CHANGES + +* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. + +### Features + +* add V1 client ([#28](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/28)) ([da10a33](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/da10a33ee30a6fa0b447ef16c8b755e3ac05a87c)) +* additional type annotation ([#64](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/64)) ([2d76c0e](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/2d76c0e16abedfaf106db063dc00f79e38166dad)) +* drop node8 support ([#39](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/39)) ([2f66ded](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/2f66ded8db03f71d3f2b37a1d91e4f3f232d5eaf)) + + +### Bug Fixes + +* regen protos and tests ([#63](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/63)) ([6293832](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/6293832961eedcdd57c24edc311f2c154781e34e)) +* remove eslint, update gax, fix generated protos, run the generator ([#49](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/49)) ([b5b9492](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/b5b9492a0c4b86b868a2b33c5c350301db29cc65)) + ## [1.1.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v1.0.0...v1.1.0) (2020-03-06) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index fd1d33664cc..a9f57c51615 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "1.1.0", + "version": "2.0.0", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index eb21017cf21..2b76fb58225 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^1.1.0", + "@google-cloud/bigquery-storage": "^2.0.0", "avsc": "^5.4.18", "snappy": "^6.2.3" }, From 6d30e08e14d22133ab057400535ce60c4e76e5e3 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 3 Jun 2020 18:13:42 -0700 Subject: [PATCH 045/182] chore: update protos.js --- .../protos/protos.d.ts | 6 ++++ .../protos/protos.js | 28 +++++++++++++++++-- .../protos/protos.json | 6 +++- .../synth.metadata | 2 +- 4 files changed, 37 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/protos/protos.d.ts b/packages/google-cloud-bigquery-storage/protos/protos.d.ts index 33f0b578737..7d93ddb63d4 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-storage/protos/protos.d.ts @@ -5223,6 +5223,9 @@ export namespace google { /** FieldDescriptorProto options */ options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); } /** Represents a FieldDescriptorProto. */ @@ -5264,6 +5267,9 @@ export namespace google { /** FieldDescriptorProto options. */ public options?: (google.protobuf.IFieldOptions|null); + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + /** * Creates a new FieldDescriptorProto instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-bigquery-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index d1ff86ad210..5df38a02d53 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/protos/protos.js @@ -28,7 +28,7 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace - var $root = $protobuf.roots._google_cloud_bigquery_storage_1_1_0_protos || ($protobuf.roots._google_cloud_bigquery_storage_1_1_0_protos = {}); + var $root = $protobuf.roots._google_cloud_bigquery_storage_2_0_0_protos || ($protobuf.roots._google_cloud_bigquery_storage_2_0_0_protos = {}); $root.google = (function() { @@ -12702,6 +12702,7 @@ * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex * @property {string|null} [jsonName] FieldDescriptorProto jsonName * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional */ /** @@ -12799,6 +12800,14 @@ */ FieldDescriptorProto.prototype.options = null; + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + /** * Creates a new FieldDescriptorProto instance using the specified properties. * @function create @@ -12843,6 +12852,8 @@ writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); return writer; }; @@ -12907,6 +12918,9 @@ case 8: message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); break; + case 17: + message.proto3Optional = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -13001,6 +13015,9 @@ if (error) return "options." + error; } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; return null; }; @@ -13123,6 +13140,8 @@ throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); return message; }; @@ -13150,6 +13169,7 @@ object.options = null; object.oneofIndex = 0; object.jsonName = ""; + object.proto3Optional = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -13171,6 +13191,8 @@ object.oneofIndex = message.oneofIndex; if (message.jsonName != null && message.hasOwnProperty("jsonName")) object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; return object; }; @@ -14964,7 +14986,7 @@ * @memberof google.protobuf.FileOptions * @instance */ - FileOptions.prototype.ccEnableArenas = false; + FileOptions.prototype.ccEnableArenas = true; /** * FileOptions objcClassPrefix. @@ -15450,7 +15472,7 @@ object.javaGenerateEqualsAndHash = false; object.deprecated = false; object.javaStringCheckUtf8 = false; - object.ccEnableArenas = false; + object.ccEnableArenas = true; object.objcClassPrefix = ""; object.csharpNamespace = ""; object.swiftPrefix = ""; diff --git a/packages/google-cloud-bigquery-storage/protos/protos.json b/packages/google-cloud-bigquery-storage/protos/protos.json index 434e158d5fe..ca83026b195 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.json +++ b/packages/google-cloud-bigquery-storage/protos/protos.json @@ -1190,6 +1190,10 @@ "options": { "type": "FieldOptions", "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 } }, "nested": { @@ -1425,7 +1429,7 @@ "type": "bool", "id": 31, "options": { - "default": false + "default": true } }, "objcClassPrefix": { diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index f76b8feb32a..86e7c8d5dee 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "2d76c0e16abedfaf106db063dc00f79e38166dad" + "sha": "a83dff661119fc6dc667afffcf984694fe46ee73" } }, { From 4e0a9d84b2099616e6a7f083c580831185e7e30d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 11 Jun 2020 17:40:24 -0700 Subject: [PATCH 046/182] feat(secrets): begin migration to secret manager from keystore (#70) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/8d5e906d-0de4-4e28-b374-7d5fd4a1ce62/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/1c92077459db3dc50741e878f98b08c6261181e0 --- packages/google-cloud-bigquery-storage/protos/protos.js | 2 +- .../src/v1/big_query_read_client.ts | 7 +++++++ .../src/v1beta1/big_query_storage_client.ts | 7 +++++++ packages/google-cloud-bigquery-storage/synth.metadata | 4 ++-- packages/google-cloud-bigquery-storage/tsconfig.json | 2 +- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index 5df38a02d53..faf2f6c3d8b 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/protos/protos.js @@ -28,7 +28,7 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace - var $root = $protobuf.roots._google_cloud_bigquery_storage_2_0_0_protos || ($protobuf.roots._google_cloud_bigquery_storage_2_0_0_protos = {}); + var $root = $protobuf.roots._google_cloud_bigquery_storage_protos || ($protobuf.roots._google_cloud_bigquery_storage_protos = {}); $root.google = (function() { diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index ba031a72a85..622628516d6 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -92,6 +92,13 @@ export class BigQueryReadClient { } opts.servicePath = opts.servicePath || servicePath; opts.port = opts.port || port; + + // users can override the config from client side, like retry codes name. + // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 + // The way to override client config for Showcase API: + // + // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} + // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; const isBrowser = typeof window !== 'undefined'; diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index 5e8f75d4414..e24f7d9a7e8 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -92,6 +92,13 @@ export class BigQueryStorageClient { } opts.servicePath = opts.servicePath || servicePath; opts.port = opts.port || port; + + // users can override the config from client side, like retry codes name. + // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 + // The way to override client config for Showcase API: + // + // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} + // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; const isBrowser = typeof window !== 'undefined'; diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 86e7c8d5dee..140b12c58f2 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "a83dff661119fc6dc667afffcf984694fe46ee73" + "sha": "20d9978cf09493d982bde1914f4ba1ef6fc21711" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "be74d3e532faa47eb59f1a0eaebde0860d1d8ab4" + "sha": "1c92077459db3dc50741e878f98b08c6261181e0" } } ], diff --git a/packages/google-cloud-bigquery-storage/tsconfig.json b/packages/google-cloud-bigquery-storage/tsconfig.json index 613d35597b5..c78f1c884ef 100644 --- a/packages/google-cloud-bigquery-storage/tsconfig.json +++ b/packages/google-cloud-bigquery-storage/tsconfig.json @@ -5,7 +5,7 @@ "outDir": "build", "resolveJsonModule": true, "lib": [ - "es2016", + "es2018", "dom" ] }, From 47352610f6a640d90521c9e6f0584e5f88e3414b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 12 Jun 2020 11:05:03 -0700 Subject: [PATCH 047/182] fix: handle fallback option properly (#73) * changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. * chore(nodejs_templates): add script logging to node_library populate-secrets.sh Co-authored-by: Benjamin E. Coe Source-Author: BenWhitehead Source-Date: Wed Jun 10 22:24:28 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: e7034945fbdc0e79d3c57f6e299e5c90b0f11469 Source-Link: https://github.com/googleapis/synthtool/commit/e7034945fbdc0e79d3c57f6e299e5c90b0f11469 --- .../src/v1/big_query_read_client.ts | 13 +++++-------- .../src/v1beta1/big_query_storage_client.ts | 13 +++++-------- .../google-cloud-bigquery-storage/synth.metadata | 4 ++-- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index 622628516d6..aca62fdcaca 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -101,14 +101,11 @@ export class BigQueryReadClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the BigQueryReadClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index e24f7d9a7e8..0bad12e8eab 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -101,14 +101,11 @@ export class BigQueryStorageClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the BigQueryStorageClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 140b12c58f2..3b53e6abd39 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "20d9978cf09493d982bde1914f4ba1ef6fc21711" + "sha": "6513e8cf6195740b570b39fb645d8a1adafc0580" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1c92077459db3dc50741e878f98b08c6261181e0" + "sha": "e7034945fbdc0e79d3c57f6e299e5c90b0f11469" } } ], From a121254a8ccd11ef213073c769ba4da6eeda4af8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Jun 2020 20:40:50 +0200 Subject: [PATCH 048/182] chore(deps): update dependency mocha to v8 (#71) --- packages/google-cloud-bigquery-storage/package.json | 2 +- packages/google-cloud-bigquery-storage/samples/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index a9f57c51615..b93033a76ca 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -39,7 +39,7 @@ "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", "linkinator": "^2.0.1", - "mocha": "^7.0.1", + "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index 2b76fb58225..3b46d1aee87 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -20,6 +20,6 @@ "devDependencies": { "c8": "^7.0.0", "chai": "^4.2.0", - "mocha": "^7.0.0" + "mocha": "^8.0.0" } } From af5cdf00124af119a547fe58c46056263bd267f0 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 16 Jun 2020 18:46:08 +0000 Subject: [PATCH 049/182] chore: release 2.1.0 (#72) :robot: I have created a release \*beep\* \*boop\* --- ## [2.1.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.0.0...v2.1.0) (2020-06-12) ### Features * **secrets:** begin migration to secret manager from keystore ([#70](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/70)) ([6513e8c](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/6513e8cf6195740b570b39fb645d8a1adafc0580)) ### Bug Fixes * handle fallback option properly ([#73](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/73)) ([ec6b88c](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/ec6b88cf87bf45e0f16935b8b27f15447aa385b9)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- packages/google-cloud-bigquery-storage/CHANGELOG.md | 12 ++++++++++++ packages/google-cloud-bigquery-storage/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md index 3070a86abbd..0a782d3f34a 100644 --- a/packages/google-cloud-bigquery-storage/CHANGELOG.md +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.1.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.0.0...v2.1.0) (2020-06-12) + + +### Features + +* **secrets:** begin migration to secret manager from keystore ([#70](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/70)) ([6513e8c](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/6513e8cf6195740b570b39fb645d8a1adafc0580)) + + +### Bug Fixes + +* handle fallback option properly ([#73](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/73)) ([ec6b88c](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/ec6b88cf87bf45e0f16935b8b27f15447aa385b9)) + ## [2.0.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v1.1.0...v2.0.0) (2020-05-18) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index b93033a76ca..734405b3615 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "2.0.0", + "version": "2.1.0", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index 3b46d1aee87..3c0ecab49c7 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^2.0.0", + "@google-cloud/bigquery-storage": "^2.1.0", "avsc": "^5.4.18", "snappy": "^6.2.3" }, From 4b1d1f693427c3e21653f29fce7a131beaac6a4f Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Fri, 19 Jun 2020 13:13:20 -0700 Subject: [PATCH 050/182] feat: promote library to GA (#75) --- .../google-cloud-bigquery-storage/.repo-metadata.json | 2 +- packages/google-cloud-bigquery-storage/README.md | 11 ++++++----- packages/google-cloud-bigquery-storage/synth.metadata | 10 +++++----- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/.repo-metadata.json b/packages/google-cloud-bigquery-storage/.repo-metadata.json index 09762cf5274..7ae251898a0 100644 --- a/packages/google-cloud-bigquery-storage/.repo-metadata.json +++ b/packages/google-cloud-bigquery-storage/.repo-metadata.json @@ -4,7 +4,7 @@ "product_documentation": "https://cloud.google.com/bigquery/docs/reference/storage", "client_documentation": "https://googleapis.dev/nodejs/bigquerystorage/latest", "issue_tracker": "https://b.corp.google.com/savedsearches/559654", - "release_level": "beta", + "release_level": "ga", "language": "nodejs", "repo": "googleapis/nodejs-bigquery-storage", "distribution_name": "@google-cloud/bigquery-storage", diff --git a/packages/google-cloud-bigquery-storage/README.md b/packages/google-cloud-bigquery-storage/README.md index 6e66eb377d7..bae285ff153 100644 --- a/packages/google-cloud-bigquery-storage/README.md +++ b/packages/google-cloud-bigquery-storage/README.md @@ -4,7 +4,7 @@ # [Google BigQuery Storage: Node.js Client](https://github.com/googleapis/nodejs-bigquery-storage) -[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/bigquery-storage.svg)](https://www.npmjs.org/package/@google-cloud/bigquery-storage) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-bigquery-storage/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-bigquery-storage) @@ -219,11 +219,12 @@ _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 +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **GA** libraries +are addressed with the highest priority. -This library is considered to be in **beta**. This means it is expected to be -mostly stable while we work toward a general availability release; however, -complete stability is not guaranteed. We will address issues and requests -against beta libraries with a high priority. diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 3b53e6abd39..c6765e428d7 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -3,23 +3,23 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "6513e8cf6195740b570b39fb645d8a1adafc0580" + "remote": "git@github.com:googleapis/nodejs-bigquery-storage.git", + "sha": "a6c5bf05da2d751dc3c656d387ac983455b24781" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "a3a0bf0f6291d69f2ff3df7fcd63d28ee20ac727", - "internalRef": "310060413" + "sha": "eb37e688331443969eed9b969531751154a956d5", + "internalRef": "317130948" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "e7034945fbdc0e79d3c57f6e299e5c90b0f11469" + "sha": "cd522c3b4dde821766d95c80ae5aeb43d7a41170" } } ], From c2caee0589ca13d56d5155658bd0872944380e2c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sun, 21 Jun 2020 14:28:37 -0700 Subject: [PATCH 051/182] chore: release 2.2.0 (#78) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-bigquery-storage/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-storage/package.json | 2 +- .../google-cloud-bigquery-storage/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md index 0a782d3f34a..c37dd9bf6c8 100644 --- a/packages/google-cloud-bigquery-storage/CHANGELOG.md +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.2.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.1.0...v2.2.0) (2020-06-19) + + +### Features + +* promote library to GA ([#75](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/75)) ([7d7a67e](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/7d7a67e9198e87cdcc4911d9505a121f1a1d9549)) + ## [2.1.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.0.0...v2.1.0) (2020-06-12) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 734405b3615..aa9ebc44f91 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "2.1.0", + "version": "2.2.0", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index 3c0ecab49c7..cc07fa17120 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^2.1.0", + "@google-cloud/bigquery-storage": "^2.2.0", "avsc": "^5.4.18", "snappy": "^6.2.3" }, From 465311e8370ccba4f2b3e13614de1483c81acfce Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 27 Jun 2020 17:48:06 -0700 Subject: [PATCH 052/182] build: add config .gitattributes (#80) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/2a81bca4-7abd-4108-ac1f-21340f858709/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/dc9caca650c77b7039e2bbc3339ffb34ae78e5b7 --- packages/google-cloud-bigquery-storage/.gitattributes | 3 +++ packages/google-cloud-bigquery-storage/synth.metadata | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 packages/google-cloud-bigquery-storage/.gitattributes diff --git a/packages/google-cloud-bigquery-storage/.gitattributes b/packages/google-cloud-bigquery-storage/.gitattributes new file mode 100644 index 00000000000..2e63216ae9c --- /dev/null +++ b/packages/google-cloud-bigquery-storage/.gitattributes @@ -0,0 +1,3 @@ +*.ts text eol=lf +*.js test eol=lf +protos/* linguist-generated diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index c6765e428d7..b9498181ba3 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -3,8 +3,8 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-bigquery-storage.git", - "sha": "a6c5bf05da2d751dc3c656d387ac983455b24781" + "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", + "sha": "2c4f58676e3fdb4bbf1d565d087e44587a854e7f" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "cd522c3b4dde821766d95c80ae5aeb43d7a41170" + "sha": "dc9caca650c77b7039e2bbc3339ffb34ae78e5b7" } } ], From 36bafbdfff3a9cf34c0100052fac36d0fc115567 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Mon, 6 Jul 2020 10:17:39 -0700 Subject: [PATCH 053/182] build: use bazel build (#81) --- .../src/v1/big_query_read_client.ts | 26 +++++++++++++ .../src/v1beta1/big_query_storage_client.ts | 26 +++++++++++++ .../synth.metadata | 26 +++++-------- .../google-cloud-bigquery-storage/synth.py | 14 ++----- .../test/gapic_big_query_read_v1.ts | 38 +++++++++++++++++++ .../test/gapic_big_query_storage_v1beta1.ts | 38 +++++++++++++++++++ 6 files changed, 140 insertions(+), 28 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index aca62fdcaca..7d054605a41 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -153,6 +153,9 @@ export class BigQueryReadClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), readSessionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/sessions/{session}' ), @@ -582,6 +585,29 @@ export class BigQueryReadClient { // -- Path templates -- // -------------------- + /** + * 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 readSession resource name string. * diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index 0bad12e8eab..2e99c9d35ae 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -153,6 +153,9 @@ export class BigQueryStorageClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), readSessionPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/sessions/{session}' ), @@ -801,6 +804,29 @@ export class BigQueryStorageClient { // -- Path templates -- // -------------------- + /** + * 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 readSession resource name string. * diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index b9498181ba3..e490e21ec1d 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -3,23 +3,15 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "2c4f58676e3fdb4bbf1d565d087e44587a854e7f" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "eb37e688331443969eed9b969531751154a956d5", - "internalRef": "317130948" + "remote": "git@github.com:googleapis/nodejs-bigquery-storage.git", + "sha": "6dcda30d8df32fff0599df7f3f185813fa827da6" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "dc9caca650c77b7039e2bbc3339ffb34ae78e5b7" + "sha": "303271797a360f8a439203413f13a160f2f5b3b4" } } ], @@ -27,19 +19,19 @@ { "client": { "source": "googleapis", - "apiName": "bigquerystorage", + "apiName": "bigquery-storage", "apiVersion": "v1beta1", - "language": "typescript", - "generator": "gapic-generator-typescript" + "language": "nodejs", + "generator": "bazel" } }, { "client": { "source": "googleapis", - "apiName": "bigquerystorage", + "apiName": "bigquery-storage", "apiVersion": "v1", - "language": "typescript", - "generator": "gapic-generator-typescript" + "language": "nodejs", + "generator": "bazel" } } ] diff --git a/packages/google-cloud-bigquery-storage/synth.py b/packages/google-cloud-bigquery-storage/synth.py index 01ba810400a..1cb8ff00d59 100644 --- a/packages/google-cloud-bigquery-storage/synth.py +++ b/packages/google-cloud-bigquery-storage/synth.py @@ -21,19 +21,11 @@ AUTOSYNTH_MULTIPLE_COMMITS = True # Run the gapic generator -gapic = gcp.GAPICMicrogenerator() -name = 'bigquerystorage' +gapic = gcp.GAPICBazel() +name = 'bigquery-storage' versions = ['v1beta1', 'v1'] for version in versions: - library = gapic.typescript_library( - name, - version, - proto_path=f'google/cloud/bigquery/storage/{version}', - generator_args={ - 'grpc-service-config': f'google/cloud/bigquery/storage/{version}/{name}_grpc_service_config.json', - 'package-name': f'@google-cloud/bigquery-storage', - }, - ) + library = gapic.node_library(name, version, proto_path=f'google/cloud/bigquery/storage/{version}') s.copy(library, excludes=['package.json', 'README.md', 'src/index.ts']) # Copy common templates common_templates = gcp.CommonTemplates() diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts index bac7067ae3c..fb204c5c622 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts @@ -474,6 +474,44 @@ describe('v1.BigQueryReadClient', () => { }); describe('Path templates', () => { + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + 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('readSession', () => { const fakePath = '/rendered/path/readSession'; const expectedParameters = { diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts index e122cb23bd2..117757e569b 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts @@ -727,6 +727,44 @@ describe('v1beta1.BigQueryStorageClient', () => { }); describe('Path templates', () => { + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + 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('readSession', () => { const fakePath = '/rendered/path/readSession'; const expectedParameters = { From 0e85dbbbc33332a70477ce14bb337153b1791887 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 9 Jul 2020 05:12:09 -0700 Subject: [PATCH 054/182] fix: typeo in nodejs .gitattribute (#84) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/cc99acfa-05b8-434b-9500-2f6faf2eaa02/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b --- .../google-cloud-bigquery-storage/.gitattributes | 2 +- .../google-cloud-bigquery-storage/synth.metadata | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/.gitattributes b/packages/google-cloud-bigquery-storage/.gitattributes index 2e63216ae9c..d4f4169b28b 100644 --- a/packages/google-cloud-bigquery-storage/.gitattributes +++ b/packages/google-cloud-bigquery-storage/.gitattributes @@ -1,3 +1,3 @@ *.ts text eol=lf -*.js test eol=lf +*.js text eol=lf protos/* linguist-generated diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index e490e21ec1d..5956712853d 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -3,15 +3,23 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-bigquery-storage.git", - "sha": "6dcda30d8df32fff0599df7f3f185813fa827da6" + "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", + "sha": "3db6706e8dfbc8b9ac24c0bc41d21207b7b0820d" + } + }, + { + "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": "303271797a360f8a439203413f13a160f2f5b3b4" + "sha": "799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b" } } ], From e38d4f798efe8382b7c88079483cfc9d4833221c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 10 Jul 2020 01:13:36 +0000 Subject: [PATCH 055/182] chore: release 2.2.1 (#85) :robot: I have created a release \*beep\* \*boop\* --- ### [2.2.1](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.2.0...v2.2.1) (2020-07-09) ### Bug Fixes * typeo in nodejs .gitattribute ([#84](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/84)) ([ab36886](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/ab36886171cc6d94f66587f715d23e8cd4603f32)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- packages/google-cloud-bigquery-storage/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-storage/package.json | 2 +- .../google-cloud-bigquery-storage/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md index c37dd9bf6c8..99a9dffbcaf 100644 --- a/packages/google-cloud-bigquery-storage/CHANGELOG.md +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.2.1](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.2.0...v2.2.1) (2020-07-09) + + +### Bug Fixes + +* typeo in nodejs .gitattribute ([#84](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/84)) ([ab36886](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/ab36886171cc6d94f66587f715d23e8cd4603f32)) + ## [2.2.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.1.0...v2.2.0) (2020-06-19) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index aa9ebc44f91..b5b25e9b05a 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "2.2.0", + "version": "2.2.1", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index cc07fa17120..7bd231c6fed 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^2.2.0", + "@google-cloud/bigquery-storage": "^2.2.1", "avsc": "^5.4.18", "snappy": "^6.2.3" }, From b6ba25fc1ecb03689f3be5669942bf8722880dd3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jul 2020 21:38:32 +0200 Subject: [PATCH 056/182] chore(deps): update dependency ts-loader to v8 (#83) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [ts-loader](https://togithub.com/TypeStrong/ts-loader) | devDependencies | major | [`^7.0.0` -> `^8.0.0`](https://renovatebot.com/diffs/npm/ts-loader/7.0.5/8.0.0) | --- ### Release Notes
TypeStrong/ts-loader ### [`v8.0.0`](https://togithub.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md#v800) [Compare Source](https://togithub.com/TypeStrong/ts-loader/compare/v7.0.5...v8.0.0) - [Support for symlinks in project references](https://togithub.com/TypeStrong/ts-loader/pull/1136) - thanks [@​sheetalkamat](https://togithub.com/sheetalkamat)! - `ts-loader` now supports TypeScript 3.6 and greater **BREAKING CHANGE**
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-bigquery-storage). --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index b5b25e9b05a..3b545834dcc 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -43,7 +43,7 @@ "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", - "ts-loader": "^7.0.0", + "ts-loader": "^8.0.0", "typescript": "^3.8.3", "webpack": "^4.41.6", "webpack-cli": "^3.3.11" From 1175fdd498d9c9ee4c5451a9bd23cbcd38fe073f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 12 Jul 2020 18:49:39 +0200 Subject: [PATCH 057/182] chore(deps): update dependency @types/mocha to v8 (#86) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@types/mocha](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | devDependencies | major | [`^7.0.1` -> `^8.0.0`](https://renovatebot.com/diffs/npm/@types%2fmocha/7.0.2/8.0.0) | --- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-bigquery-storage). --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 3b545834dcc..2473080efa7 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -30,7 +30,7 @@ "google-gax": "^2.1.0" }, "devDependencies": { - "@types/mocha": "^7.0.1", + "@types/mocha": "^8.0.0", "@types/node": "^13.7.1", "@types/sinon": "^9.0.0", "c8": "^7.1.0", From 1719fc074d3a2b65179d28aa3d0f0e033150bf0b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 14 Jul 2020 05:44:12 -0700 Subject: [PATCH 058/182] build: missing closing paren in publish script (#88) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/9c6207e5-a7a6-4e44-ab6b-91751e0230b1/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/d82deccf657a66e31bd5da9efdb96c6fa322fc7e --- packages/google-cloud-bigquery-storage/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 5956712853d..7abf2ba253f 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "3db6706e8dfbc8b9ac24c0bc41d21207b7b0820d" + "sha": "c5e781c5290cd898279272c63169d6c932478ae8" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b" + "sha": "d82deccf657a66e31bd5da9efdb96c6fa322fc7e" } } ], From d93508c6a814d94ce8c303f6cff9886633a39a1e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 17 Jul 2020 15:10:37 -0700 Subject: [PATCH 059/182] chore: add config files for cloud-rad for node.js, delete Node 8 templates (#92) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/5e903fff-57bb-4395-bb94-8b4d1909dbf6/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/21f1470ecd01424dc91c70f1a7c798e4e87d1eec Source-Link: https://github.com/googleapis/synthtool/commit/388e10f5ae302d3e8de1fac99f3a95d1ab8f824a --- .../api-extractor.json | 369 ++++++++++++++++++ .../synth.metadata | 4 +- 2 files changed, 371 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-bigquery-storage/api-extractor.json diff --git a/packages/google-cloud-bigquery-storage/api-extractor.json b/packages/google-cloud-bigquery-storage/api-extractor.json new file mode 100644 index 00000000000..de228294b23 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/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-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 7abf2ba253f..371fd4f1397 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "c5e781c5290cd898279272c63169d6c932478ae8" + "sha": "02eff9cbb2c9961bd528ba19b27c1406cdae0713" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "d82deccf657a66e31bd5da9efdb96c6fa322fc7e" + "sha": "21f1470ecd01424dc91c70f1a7c798e4e87d1eec" } } ], From 86056d6976516b72dca525a5ab08ac1ddf244b80 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Tue, 21 Jul 2020 14:46:48 -0400 Subject: [PATCH 060/182] chore: add dev dependencies for cloud-rad ref docs (#93) --- packages/google-cloud-bigquery-storage/package.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 2473080efa7..2f2eb506744 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -24,7 +24,9 @@ "system-test": "c8 mocha build/system-test", "test": "c8 mocha build/test", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "precompile": "gts clean" + "precompile": "gts clean", + "api-extractor": "api-extractor run --local", + "api-documenter": "api-documenter yaml --input-folder=temp" }, "dependencies": { "google-gax": "^2.1.0" @@ -46,7 +48,9 @@ "ts-loader": "^8.0.0", "typescript": "^3.8.3", "webpack": "^4.41.6", - "webpack-cli": "^3.3.11" + "webpack-cli": "^3.3.11", + "@microsoft/api-documenter": "^7.8.10", + "@microsoft/api-extractor": "^7.8.10" }, "engines": { "node": ">=10" From 6a05489f44bb1b93edbb2948579f769361770618 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 21 Jul 2020 22:20:14 -0700 Subject: [PATCH 061/182] build: rename _toc to toc (#94) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/940354f9-15cd-4361-bbf4-dc9af1426979/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/99c93fe09f8c1dca09dfc0301c8668e3a70dd796 --- packages/google-cloud-bigquery-storage/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 371fd4f1397..08c30e4278d 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "02eff9cbb2c9961bd528ba19b27c1406cdae0713" + "sha": "4b083b1431952cc0b62dd9bbebdbccc3832cc244" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "21f1470ecd01424dc91c70f1a7c798e4e87d1eec" + "sha": "99c93fe09f8c1dca09dfc0301c8668e3a70dd796" } } ], From 14be1b7e81e33333026a35eba8fef50b0224ba2f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 23 Jul 2020 14:59:17 -0700 Subject: [PATCH 062/182] build: move gitattributes files to node templates (#95) Source-Author: F. Hinkelmann Source-Date: Thu Jul 23 01:45:04 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3 Source-Link: https://github.com/googleapis/synthtool/commit/3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3 --- packages/google-cloud-bigquery-storage/.gitattributes | 1 + packages/google-cloud-bigquery-storage/synth.metadata | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/.gitattributes b/packages/google-cloud-bigquery-storage/.gitattributes index d4f4169b28b..33739cb74e4 100644 --- a/packages/google-cloud-bigquery-storage/.gitattributes +++ b/packages/google-cloud-bigquery-storage/.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-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 08c30e4278d..20b4b3e96b8 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "4b083b1431952cc0b62dd9bbebdbccc3832cc244" + "sha": "727484c227636b675083ec236a8f3aebfefe6324" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "99c93fe09f8c1dca09dfc0301c8668e3a70dd796" + "sha": "3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3" } } ], From e51577cde98ed4896ee1b7bd09f786911ee5d58a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 29 Jul 2020 17:07:33 -0700 Subject: [PATCH 063/182] chore(node): fix kokoro build path for cloud-rad (#96) Source-Author: F. Hinkelmann Source-Date: Wed Jul 29 00:28:42 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 89d431fb2975fc4e0ed24995a6e6dfc8ff4c24fa Source-Link: https://github.com/googleapis/synthtool/commit/89d431fb2975fc4e0ed24995a6e6dfc8ff4c24fa --- packages/google-cloud-bigquery-storage/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 20b4b3e96b8..0ddb321c9ac 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "727484c227636b675083ec236a8f3aebfefe6324" + "sha": "4e992afd67dc4c34817e73884a63b417638452d8" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3" + "sha": "89d431fb2975fc4e0ed24995a6e6dfc8ff4c24fa" } } ], From 6b5586d7830d1c390b40a90cbbf73370e96a36ea Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 30 Jul 2020 19:46:29 -0700 Subject: [PATCH 064/182] build: update protos --- packages/google-cloud-bigquery-storage/protos/protos.d.ts | 2 +- packages/google-cloud-bigquery-storage/protos/protos.js | 2 +- packages/google-cloud-bigquery-storage/synth.metadata | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/protos/protos.d.ts b/packages/google-cloud-bigquery-storage/protos/protos.d.ts index 7d93ddb63d4..f94b251defa 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-storage/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-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index faf2f6c3d8b..0927a833d1a 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/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-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 0ddb321c9ac..d8044e2f5bc 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "4e992afd67dc4c34817e73884a63b417638452d8" + "sha": "0ba802efd080e76ba2b0b6e268ddfbc60168a08d" } }, { From 4d24128a0e7a6a10c3abc9e61c97fca5e6a97086 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 31 Jul 2020 09:24:31 -0700 Subject: [PATCH 065/182] docs: add links to the CHANGELOG from the README.md for Java and Node (#98) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/7b446397-88f3-4463-9e7d-d2ce7069989d/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/5936421202fb53ed4641bcb824017dd393a3dbcc --- packages/google-cloud-bigquery-storage/README.md | 3 +++ packages/google-cloud-bigquery-storage/synth.metadata | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/README.md b/packages/google-cloud-bigquery-storage/README.md index bae285ff153..251a371a879 100644 --- a/packages/google-cloud-bigquery-storage/README.md +++ b/packages/google-cloud-bigquery-storage/README.md @@ -14,6 +14,9 @@ Client for the BigQuery Storage API +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-bigquery-storage/blob/master/CHANGELOG.md). + * [Google BigQuery Storage Node.js Client API Reference][client-docs] * [Google BigQuery Storage Documentation][product-docs] * [github.com/googleapis/nodejs-bigquery-storage](https://github.com/googleapis/nodejs-bigquery-storage) diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index d8044e2f5bc..d22d57b5a34 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "0ba802efd080e76ba2b0b6e268ddfbc60168a08d" + "sha": "137e4fc42b754a059c8acda04d0f2692e9e2fd77" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "89d431fb2975fc4e0ed24995a6e6dfc8ff4c24fa" + "sha": "5936421202fb53ed4641bcb824017dd393a3dbcc" } } ], From ac288e080e09372792a2d89b701094797cbc0424 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 8 Aug 2020 11:36:33 -0700 Subject: [PATCH 066/182] build: --credential-file-override is no longer required (#101) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/4de22315-84b1-493d-8da2-dfa7688128f5/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/94421c47802f56a44c320257b2b4c190dc7d6b68 --- packages/google-cloud-bigquery-storage/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index d22d57b5a34..0460272fc3a 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "137e4fc42b754a059c8acda04d0f2692e9e2fd77" + "sha": "a3f7556dc9842d0f784d30afea60c814ab208a5a" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5936421202fb53ed4641bcb824017dd393a3dbcc" + "sha": "94421c47802f56a44c320257b2b4c190dc7d6b68" } } ], From d33e56c0e3b41d66f7f099aecc69c9bfeda0638a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 11 Aug 2020 11:24:03 -0700 Subject: [PATCH 067/182] build: use gapic-generator-typescript v1.0.7. (#102) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/5f7f9c6d-c75a-4c60-8bb8-0026a14cead7/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 325949033 Source-Link: https://github.com/googleapis/googleapis/commit/94006b3cb8d2fb44703cf535da15608eed6bf7db --- .../src/v1/big_query_read_client.ts | 5 ++--- .../src/v1beta1/big_query_storage_client.ts | 5 ++--- packages/google-cloud-bigquery-storage/synth.metadata | 6 +++--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index 7d054605a41..dba8fffa0d0 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -236,12 +236,11 @@ export class BigQueryReadClient { } ); + const descriptor = this.descriptors.stream[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-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index 2e99c9d35ae..8964e40f5c5 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -239,12 +239,11 @@ export class BigQueryStorageClient { } ); + const descriptor = this.descriptors.stream[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-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 0460272fc3a..238c96af842 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "a3f7556dc9842d0f784d30afea60c814ab208a5a" + "sha": "4230f845b9365257d6c2686aa4b66e506de2d440" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "4f4aa3a03e470f1390758b9d89eb1aa88837a5be", - "internalRef": "320300472" + "sha": "94006b3cb8d2fb44703cf535da15608eed6bf7db", + "internalRef": "325949033" } }, { From c350efd079c7a07f3b4e567255c7e90b1cc9cb38 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 12 Aug 2020 09:36:13 -0700 Subject: [PATCH 068/182] chore: update cloud rad kokoro build job (#103) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/b742586e-df31-4aac-8092-78288e9ea8e7/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/bd0deaa1113b588d70449535ab9cbf0f2bd0e72f --- packages/google-cloud-bigquery-storage/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 238c96af842..1c7559cc906 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "4230f845b9365257d6c2686aa4b66e506de2d440" + "sha": "08746ef0bde0c826aa33b5393cae4361c6b96986" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "94421c47802f56a44c320257b2b4c190dc7d6b68" + "sha": "bd0deaa1113b588d70449535ab9cbf0f2bd0e72f" } } ], From d6964f07861a069c1c00b3fbbc3334e6a21b3199 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 13 Aug 2020 09:14:21 -0700 Subject: [PATCH 069/182] build: perform publish using Node 12 (#104) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/c36c6dbc-ab79-4f17-b70b-523b420b2a70/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/5747555f7620113d9a2078a48f4c047a99d31b3e --- packages/google-cloud-bigquery-storage/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 1c7559cc906..7cc9313715d 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "08746ef0bde0c826aa33b5393cae4361c6b96986" + "sha": "12e89d855761c4a84db00ed49b847d68069e0754" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "bd0deaa1113b588d70449535ab9cbf0f2bd0e72f" + "sha": "5747555f7620113d9a2078a48f4c047a99d31b3e" } } ], From 73d868b07ecbf0b6a51fe16b8ef3d9ff41d2bd77 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 19 Aug 2020 22:08:25 -0700 Subject: [PATCH 070/182] chore: start tracking obsolete files --- .../synth.metadata | 92 ++++++++++++++++++- 1 file changed, 88 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 7cc9313715d..8013910f8f9 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,22 +4,22 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "12e89d855761c4a84db00ed49b847d68069e0754" + "sha": "ad96022ed862e005d67e8f10bf7e160f362e79e1" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "94006b3cb8d2fb44703cf535da15608eed6bf7db", - "internalRef": "325949033" + "sha": "4c5071b615d96ef9dfd6a63d8429090f1f2872bb", + "internalRef": "327369997" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5747555f7620113d9a2078a48f4c047a99d31b3e" + "sha": "1a60ff2a3975c2f5054431588bd95db9c3b862ba" } } ], @@ -42,5 +42,89 @@ "generator": "bazel" } } + ], + "generatedFiles": [ + ".eslintignore", + ".eslintrc.json", + ".gitattributes", + ".github/ISSUE_TEMPLATE/bug_report.md", + ".github/ISSUE_TEMPLATE/feature_request.md", + ".github/ISSUE_TEMPLATE/support_request.md", + ".github/PULL_REQUEST_TEMPLATE.md", + ".github/publish.yml", + ".github/release-please.yml", + ".github/workflows/ci.yaml", + ".gitignore", + ".jsdoc.js", + ".kokoro/.gitattributes", + ".kokoro/common.cfg", + ".kokoro/continuous/node10/common.cfg", + ".kokoro/continuous/node10/docs.cfg", + ".kokoro/continuous/node10/lint.cfg", + ".kokoro/continuous/node10/samples-test.cfg", + ".kokoro/continuous/node10/system-test.cfg", + ".kokoro/continuous/node10/test.cfg", + ".kokoro/continuous/node12/common.cfg", + ".kokoro/continuous/node12/test.cfg", + ".kokoro/docs.sh", + ".kokoro/lint.sh", + ".kokoro/populate-secrets.sh", + ".kokoro/presubmit/node10/common.cfg", + ".kokoro/presubmit/node10/samples-test.cfg", + ".kokoro/presubmit/node10/system-test.cfg", + ".kokoro/presubmit/node12/common.cfg", + ".kokoro/presubmit/node12/test.cfg", + ".kokoro/publish.sh", + ".kokoro/release/docs-devsite.cfg", + ".kokoro/release/docs-devsite.sh", + ".kokoro/release/docs.cfg", + ".kokoro/release/docs.sh", + ".kokoro/release/publish.cfg", + ".kokoro/samples-test.sh", + ".kokoro/system-test.sh", + ".kokoro/test.bat", + ".kokoro/test.sh", + ".kokoro/trampoline.sh", + ".mocharc.js", + ".nycrc", + ".prettierignore", + ".prettierrc.js", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "README.md", + "api-extractor.json", + "linkinator.config.json", + "package-lock.json.2385627015", + "protos/google/cloud/bigquery/storage/v1/arrow.proto", + "protos/google/cloud/bigquery/storage/v1/avro.proto", + "protos/google/cloud/bigquery/storage/v1/storage.proto", + "protos/google/cloud/bigquery/storage/v1/stream.proto", + "protos/google/cloud/bigquery/storage/v1beta1/arrow.proto", + "protos/google/cloud/bigquery/storage/v1beta1/avro.proto", + "protos/google/cloud/bigquery/storage/v1beta1/read_options.proto", + "protos/google/cloud/bigquery/storage/v1beta1/storage.proto", + "protos/google/cloud/bigquery/storage/v1beta1/table_reference.proto", + "protos/protos.d.ts", + "protos/protos.js", + "protos/protos.json", + "renovate.json", + "samples/README.md", + "samples/package-lock.json.1762785766", + "src/v1/big_query_read_client.ts", + "src/v1/big_query_read_client_config.json", + "src/v1/big_query_read_proto_list.json", + "src/v1/index.ts", + "src/v1beta1/big_query_storage_client.ts", + "src/v1beta1/big_query_storage_client_config.json", + "src/v1beta1/big_query_storage_proto_list.json", + "src/v1beta1/index.ts", + "system-test/fixtures/sample/src/index.js", + "system-test/fixtures/sample/src/index.ts", + "system-test/install.ts", + "test/gapic_big_query_read_v1.ts", + "test/gapic_big_query_storage_v1beta1.ts", + "tsconfig.json", + "webpack.config.js" ] } \ No newline at end of file From 4dd7cedc21a15e1e535310fa4b7760a2d25ee28b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 21 Aug 2020 09:26:36 -0700 Subject: [PATCH 071/182] build: move system and samples test from Node 10 to Node 12 (#106) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/ba2d388f-b3b2-4ad7-a163-0c6b4d86894f/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/05de3e1e14a0b07eab8b474e669164dbd31f81fb --- .../google-cloud-bigquery-storage/synth.metadata | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 8013910f8f9..8c603f39c28 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "ad96022ed862e005d67e8f10bf7e160f362e79e1" + "sha": "059a4caaecff40122f69107ab9ebe91a47f29c5c" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1a60ff2a3975c2f5054431588bd95db9c3b862ba" + "sha": "05de3e1e14a0b07eab8b474e669164dbd31f81fb" } } ], @@ -60,19 +60,19 @@ ".kokoro/common.cfg", ".kokoro/continuous/node10/common.cfg", ".kokoro/continuous/node10/docs.cfg", - ".kokoro/continuous/node10/lint.cfg", - ".kokoro/continuous/node10/samples-test.cfg", - ".kokoro/continuous/node10/system-test.cfg", ".kokoro/continuous/node10/test.cfg", ".kokoro/continuous/node12/common.cfg", + ".kokoro/continuous/node12/lint.cfg", + ".kokoro/continuous/node12/samples-test.cfg", + ".kokoro/continuous/node12/system-test.cfg", ".kokoro/continuous/node12/test.cfg", ".kokoro/docs.sh", ".kokoro/lint.sh", ".kokoro/populate-secrets.sh", ".kokoro/presubmit/node10/common.cfg", - ".kokoro/presubmit/node10/samples-test.cfg", - ".kokoro/presubmit/node10/system-test.cfg", ".kokoro/presubmit/node12/common.cfg", + ".kokoro/presubmit/node12/samples-test.cfg", + ".kokoro/presubmit/node12/system-test.cfg", ".kokoro/presubmit/node12/test.cfg", ".kokoro/publish.sh", ".kokoro/release/docs-devsite.cfg", @@ -95,7 +95,6 @@ "README.md", "api-extractor.json", "linkinator.config.json", - "package-lock.json.2385627015", "protos/google/cloud/bigquery/storage/v1/arrow.proto", "protos/google/cloud/bigquery/storage/v1/avro.proto", "protos/google/cloud/bigquery/storage/v1/storage.proto", @@ -110,7 +109,6 @@ "protos/protos.json", "renovate.json", "samples/README.md", - "samples/package-lock.json.1762785766", "src/v1/big_query_read_client.ts", "src/v1/big_query_read_client_config.json", "src/v1/big_query_read_proto_list.json", From 3f6f4bf7bc524556f7b65c86b26611b59cbabe90 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 28 Aug 2020 10:02:06 -0700 Subject: [PATCH 072/182] build: track flaky tests for "nightly", add new secrets for tagging (#107) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/a8ab5675-1982-4cf5-b9b7-36794038b975/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/8cf6d2834ad14318e64429c3b94f6443ae83daf9 --- packages/google-cloud-bigquery-storage/synth.metadata | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 8c603f39c28..8e87a9a8e7d 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "059a4caaecff40122f69107ab9ebe91a47f29c5c" + "sha": "890d24ba66d242e29c4c3960c190c936038bf042" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "05de3e1e14a0b07eab8b474e669164dbd31f81fb" + "sha": "8cf6d2834ad14318e64429c3b94f6443ae83daf9" } } ], @@ -51,7 +51,6 @@ ".github/ISSUE_TEMPLATE/feature_request.md", ".github/ISSUE_TEMPLATE/support_request.md", ".github/PULL_REQUEST_TEMPLATE.md", - ".github/publish.yml", ".github/release-please.yml", ".github/workflows/ci.yaml", ".gitignore", From 699bed28f9c478ff5f5af851838dd29807bbb1c2 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 12 Sep 2020 11:20:14 -0700 Subject: [PATCH 073/182] build(test): recursively find test files; fail on unsupported dependency versions (#111) 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-storage/.mocharc.js | 3 ++- packages/google-cloud-bigquery-storage/synth.metadata | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/.mocharc.js b/packages/google-cloud-bigquery-storage/.mocharc.js index ff7b34fa5d1..0b600509bed 100644 --- a/packages/google-cloud-bigquery-storage/.mocharc.js +++ b/packages/google-cloud-bigquery-storage/.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-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 8e87a9a8e7d..1c6c1282916 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "890d24ba66d242e29c4c3960c190c936038bf042" + "sha": "58c08c4008a0f028dbe42cb6ec1f585aed5be41e" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "8cf6d2834ad14318e64429c3b94f6443ae83daf9" + "sha": "fdd03c161003ab97657cc0218f25c82c89ddf4b6" } } ], From 3dc564c1a06c1281eff698fef1a3d034a0ded185 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 1 Oct 2020 05:06:33 -0700 Subject: [PATCH 074/182] chore: update bucket for cloud-rad (#112) 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-storage/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 1c6c1282916..61a156293d2 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "58c08c4008a0f028dbe42cb6ec1f585aed5be41e" + "sha": "0430db108fc6dd6c00b0458e79b4fee8913ed016" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "fdd03c161003ab97657cc0218f25c82c89ddf4b6" + "sha": "079dcce498117f9570cebe6e6cff254b38ba3860" } } ], From 616673a40edd73435d7873dc6184fdc22b792ed8 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 5 Oct 2020 10:42:35 -0700 Subject: [PATCH 075/182] build(node_library): migrate to Trampoline V2 (#113) 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-storage/synth.metadata | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 61a156293d2..36705ddd677 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "0430db108fc6dd6c00b0458e79b4fee8913ed016" + "sha": "590b99c703941451d705cfb62f38176630f4dda5" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "079dcce498117f9570cebe6e6cff254b38ba3860" + "sha": "0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9" } } ], @@ -84,10 +84,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 20bee7e3d74de71bd7011f612888af9ec367fd66 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 12 Oct 2020 21:54:26 +0200 Subject: [PATCH 076/182] chore(deps): update dependency webpack-cli to v4 (#117) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [webpack-cli](https://togithub.com/webpack/webpack-cli) | devDependencies | major | [`^3.3.11` -> `^4.0.0`](https://renovatebot.com/diffs/npm/webpack-cli/3.3.12/4.0.0) | --- ### Release Notes
webpack/webpack-cli ### [`v4.0.0`](https://togithub.com/webpack/webpack-cli/blob/master/CHANGELOG.md#​400-httpsgithubcomwebpackwebpack-clicomparewebpack-cli400-rc1webpack-cli400-2020-10-10) [Compare Source](https://togithub.com/webpack/webpack-cli/compare/v3.3.12...webpack-cli@4.0.0) ##### Bug Fixes - add compilation lifecycle in watch instance ([#​1903](https://togithub.com/webpack/webpack-cli/issues/1903)) ([02b6d21](https://togithub.com/webpack/webpack-cli/commit/02b6d21eaa20166a7ed37816de716b8fc22b756a)) - cleanup `package-utils` package ([#​1822](https://togithub.com/webpack/webpack-cli/issues/1822)) ([fd5b92b](https://togithub.com/webpack/webpack-cli/commit/fd5b92b3cd40361daec5bf4486e455a41f4c9738)) - cli-executer supplies args further up ([#​1904](https://togithub.com/webpack/webpack-cli/issues/1904)) ([097564a](https://togithub.com/webpack/webpack-cli/commit/097564a851b36b63e0a6bf88144997ef65aa057a)) - exit code for validation errors ([59f6303](https://togithub.com/webpack/webpack-cli/commit/59f63037fcbdbb8934b578b9adf5725bc4ae1235)) - exit process in case of schema errors ([71e89b4](https://togithub.com/webpack/webpack-cli/commit/71e89b4092d953ea587cc4f606451ab78cbcdb93)) ##### Features - assign config paths in build dependencies in cache config ([#​1900](https://togithub.com/webpack/webpack-cli/issues/1900)) ([7e90f11](https://togithub.com/webpack/webpack-cli/commit/7e90f110b119f36ef9def4f66cf4e17ccf1438cd))
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-bigquery-storage). --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 2f2eb506744..ce0956d34e2 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -48,7 +48,7 @@ "ts-loader": "^8.0.0", "typescript": "^3.8.3", "webpack": "^4.41.6", - "webpack-cli": "^3.3.11", + "webpack-cli": "^4.0.0", "@microsoft/api-documenter": "^7.8.10", "@microsoft/api-extractor": "^7.8.10" }, From 1413f169146768cc2daba2b443107a7f5f119f21 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 14 Oct 2020 23:02:45 +0200 Subject: [PATCH 077/182] chore(deps): update dependency webpack to v5 (#116) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [webpack](https://togithub.com/webpack/webpack) | devDependencies | major | [`^4.41.6` -> `^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-storage). --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index ce0956d34e2..d7f80ef108d 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -47,7 +47,7 @@ "sinon": "^9.0.1", "ts-loader": "^8.0.0", "typescript": "^3.8.3", - "webpack": "^4.41.6", + "webpack": "^5.0.0", "webpack-cli": "^4.0.0", "@microsoft/api-documenter": "^7.8.10", "@microsoft/api-extractor": "^7.8.10" From 4a84f4bdd44ada631bd4a8ca0c7cfdade613de56 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 16 Oct 2020 10:08:47 -0700 Subject: [PATCH 078/182] build: only check --engine-strict for production deps (#119) 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-storage/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 36705ddd677..247e555cc14 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "590b99c703941451d705cfb62f38176630f4dda5" + "sha": "cf74b5fe028deb7c3cc9630d74ed89df62d266b0" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9" + "sha": "5451633881133e5573cc271a18e73b18caca8b1b" } } ], From 3d3f0566dbb5f5657d514dfbfe2f47138019684b Mon Sep 17 00:00:00 2001 From: Steffany Brown <30247553+steffnay@users.noreply.github.com> Date: Mon, 19 Oct 2020 10:18:41 -0700 Subject: [PATCH 079/182] docs(samples): update quickstart to use v1 client (#118) * update quickstart to use v1 read client * update offset Co-authored-by: Benjamin E. Coe --- .../samples/quickstart.js | 76 +++++++++---------- 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/samples/quickstart.js b/packages/google-cloud-bigquery-storage/samples/quickstart.js index edb9c2e1262..74fa5c7dfa2 100644 --- a/packages/google-cloud-bigquery-storage/samples/quickstart.js +++ b/packages/google-cloud-bigquery-storage/samples/quickstart.js @@ -28,9 +28,9 @@ async function main() { // See reference documentation at // https://cloud.google.com/bigquery/docs/reference/storage - const {BigQueryStorageClient} = require('@google-cloud/bigquery-storage'); + const {BigQueryReadClient} = require('@google-cloud/bigquery-storage'); - const client = new BigQueryStorageClient(); + const client = new BigQueryReadClient(); async function bigqueryStorageQuickstart() { // Get current project ID. The read session is created in this project. @@ -42,11 +42,7 @@ async function main() { const datasetId = 'usa_names'; const tableId = 'usa_1910_current'; - const tableReference = { - projectId, - datasetId, - tableId, - }; + const tableReference = `projects/${projectId}/datasets/${datasetId}/tables/${tableId}`; const parent = `projects/${myProjectId}`; @@ -69,18 +65,15 @@ async function main() { // API request. const request = { - tableReference, parent, - readOptions, - tableModifiers, - // This API can also deliver data serialized in Apache Arrow format. - // This example leverages Apache Avro. - format: 'AVRO', - /* We use a LIQUID strategy in this example because we only read from a - * single stream. Consider BALANCED if you're consuming multiple streams - * concurrently and want more consistent stream sizes. - */ - shardingStrategy: 'LIQUID', + readSession: { + table: tableReference, + // This API can also deliver data serialized in Apache Arrow format. + // This example leverages Apache Avro. + dataFormat: 'AVRO', + readOptions, + tableModifiers, + }, }; const [session] = await client.createReadSession(request); @@ -96,16 +89,14 @@ async function main() { let offset = 0; const readRowsRequest = { - // Optional stream name or offset. Offset requested must be less than the last - // row read from readRows(). Requesting a larger offset is undefined. - readPosition: { - stream: session.streams[0], - offset, - }, + // Required stream name and optional offset. Offset requested must be less than + // the last row read from readRows(). Requesting a larger offset is undefined. + readStream: session.streams[0].name, + offset, }; const names = new Set(); - const states = {}; + const states = []; /* We'll use only a single stream for reading data from the table. Because * of dynamic sharding, this will yield all the rows in the table. However, @@ -116,26 +107,33 @@ async function main() { .readRows(readRowsRequest) .on('error', console.error) .on('data', data => { - try { - const decodedData = avroType.decode( - data.avroRows.serializedBinaryRows - ); + offset = data.avroRows.serializedBinaryRows.offset; - names.add(decodedData.value.name); - - if (!states[decodedData.value.state]) { - states[decodedData.value.state] = true; - } - - offset = decodedData.offset; + try { + // Decode all rows in buffer + let pos; + do { + const decodedData = avroType.decode( + data.avroRows.serializedBinaryRows, + pos + ); + + if (decodedData.value) { + names.add(decodedData.value.name); + + if (!states.includes(decodedData.value.state)) { + states.push(decodedData.value.state); + } + } + + pos = decodedData.offset; + } while (pos > 0); } catch (error) { console.log(error); } }) .on('end', () => { - console.log( - `Got ${names.size} unique names in states: ${Object.keys(states)}` - ); + console.log(`Got ${names.size} unique names in states: ${states}`); console.log(`Last offset: ${offset}`); }); } From b94e00129a4c5a0746692158af8388c405cb72fe Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 20 Oct 2020 08:38:02 -0700 Subject: [PATCH 080/182] docs: update sample on README to latest (#120) --- .../google-cloud-bigquery-storage/README.md | 76 +++++++++---------- .../synth.metadata | 2 +- 2 files changed, 38 insertions(+), 40 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/README.md b/packages/google-cloud-bigquery-storage/README.md index 251a371a879..3a07845c979 100644 --- a/packages/google-cloud-bigquery-storage/README.md +++ b/packages/google-cloud-bigquery-storage/README.md @@ -66,9 +66,9 @@ const avro = require('avsc'); // See reference documentation at // https://cloud.google.com/bigquery/docs/reference/storage -const {BigQueryStorageClient} = require('@google-cloud/bigquery-storage'); +const {BigQueryReadClient} = require('@google-cloud/bigquery-storage'); -const client = new BigQueryStorageClient(); +const client = new BigQueryReadClient(); async function bigqueryStorageQuickstart() { // Get current project ID. The read session is created in this project. @@ -80,11 +80,7 @@ async function bigqueryStorageQuickstart() { const datasetId = 'usa_names'; const tableId = 'usa_1910_current'; - const tableReference = { - projectId, - datasetId, - tableId, - }; + const tableReference = `projects/${projectId}/datasets/${datasetId}/tables/${tableId}`; const parent = `projects/${myProjectId}`; @@ -107,18 +103,15 @@ async function bigqueryStorageQuickstart() { // API request. const request = { - tableReference, parent, - readOptions, - tableModifiers, - // This API can also deliver data serialized in Apache Arrow format. - // This example leverages Apache Avro. - format: 'AVRO', - /* We use a LIQUID strategy in this example because we only read from a - * single stream. Consider BALANCED if you're consuming multiple streams - * concurrently and want more consistent stream sizes. - */ - shardingStrategy: 'LIQUID', + readSession: { + table: tableReference, + // This API can also deliver data serialized in Apache Arrow format. + // This example leverages Apache Avro. + dataFormat: 'AVRO', + readOptions, + tableModifiers, + }, }; const [session] = await client.createReadSession(request); @@ -134,16 +127,14 @@ async function bigqueryStorageQuickstart() { let offset = 0; const readRowsRequest = { - // Optional stream name or offset. Offset requested must be less than the last - // row read from readRows(). Requesting a larger offset is undefined. - readPosition: { - stream: session.streams[0], - offset, - }, + // Required stream name and optional offset. Offset requested must be less than + // the last row read from readRows(). Requesting a larger offset is undefined. + readStream: session.streams[0].name, + offset, }; const names = new Set(); - const states = {}; + const states = []; /* We'll use only a single stream for reading data from the table. Because * of dynamic sharding, this will yield all the rows in the table. However, @@ -154,26 +145,33 @@ async function bigqueryStorageQuickstart() { .readRows(readRowsRequest) .on('error', console.error) .on('data', data => { - try { - const decodedData = avroType.decode( - data.avroRows.serializedBinaryRows - ); + offset = data.avroRows.serializedBinaryRows.offset; - names.add(decodedData.value.name); - - if (!states[decodedData.value.state]) { - states[decodedData.value.state] = true; - } - - offset = decodedData.offset; + try { + // Decode all rows in buffer + let pos; + do { + const decodedData = avroType.decode( + data.avroRows.serializedBinaryRows, + pos + ); + + if (decodedData.value) { + names.add(decodedData.value.name); + + if (!states.includes(decodedData.value.state)) { + states.push(decodedData.value.state); + } + } + + pos = decodedData.offset; + } while (pos > 0); } catch (error) { console.log(error); } }) .on('end', () => { - console.log( - `Got ${names.size} unique names in states: ${Object.keys(states)}` - ); + console.log(`Got ${names.size} unique names in states: ${states}`); console.log(`Last offset: ${offset}`); }); } diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 247e555cc14..7acfc9e587c 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "cf74b5fe028deb7c3cc9630d74ed89df62d266b0" + "sha": "d405f53a5fac9161012664d7f3f74e7dc6317476" } }, { From 35be682e3578f7e93e8f22c4d5b7f59cf140da14 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 21 Oct 2020 16:16:12 -0700 Subject: [PATCH 081/182] chore: clean up Node.js TOC for cloud-rad (#121) 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-storage/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 7acfc9e587c..f5b61381239 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "d405f53a5fac9161012664d7f3f74e7dc6317476" + "sha": "52d215f6d760856a4e0a18dc39489d2bb000bd79" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5451633881133e5573cc271a18e73b18caca8b1b" + "sha": "901ddd44e9ef7887ee681b9183bbdea99437fdcc" } } ], From 548ce083bf8bac9b828939c0a7423fcfdee6f380 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 27 Oct 2020 11:12:11 -0700 Subject: [PATCH 082/182] docs: updated code of conduct (includes update to actions) (#124) 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-storage/CODE_OF_CONDUCT.md b/packages/google-cloud-bigquery-storage/CODE_OF_CONDUCT.md index 46b2a08ea6d..2add2547a81 100644 --- a/packages/google-cloud-bigquery-storage/CODE_OF_CONDUCT.md +++ b/packages/google-cloud-bigquery-storage/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-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index f5b61381239..db8fb159bf4 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "52d215f6d760856a4e0a18dc39489d2bb000bd79" + "sha": "725361b14d6bcb5d8ed64552d82687c2db4f4b4b" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "901ddd44e9ef7887ee681b9183bbdea99437fdcc" + "sha": "89c849ba5013e45e8fb688b138f33c2ec6083dc5" } } ], From 96fdd0b7c564ad2b5b27369e267a191f5f01425a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 2 Nov 2020 15:59:03 -0800 Subject: [PATCH 083/182] build(node): add KOKORO_BUILD_ARTIFACTS_SUBDIR to env (#125) 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-storage/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index db8fb159bf4..08f1c1064e3 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "725361b14d6bcb5d8ed64552d82687c2db4f4b4b" + "sha": "10c93ec771f1715a8f97dde1840ed5071275bec8" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "89c849ba5013e45e8fb688b138f33c2ec6083dc5" + "sha": "ba9918cd22874245b55734f57470c719b577e591" } } ], From 1fcdf66d24200ab9deba65a13dd665286a48066d Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Fri, 6 Nov 2020 16:34:10 -0800 Subject: [PATCH 084/182] fix: do not modify options object, use defaultScopes (#126) Regenerated the library using [gapic-generator-typescript](https://github.com/googleapis/gapic-generator-typescript) v1.2.1. --- .../package.json | 2 +- .../src/index.ts | 2 + .../src/v1/big_query_read_client.ts | 89 ++++++++------- .../src/v1beta1/big_query_storage_client.ts | 101 +++++++++++------- .../synth.metadata | 16 +-- .../system-test/fixtures/sample/src/index.ts | 9 +- .../system-test/install.ts | 18 ++-- 7 files changed, 141 insertions(+), 96 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index d7f80ef108d..6f9873f5c5f 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -29,7 +29,7 @@ "api-documenter": "api-documenter yaml --input-folder=temp" }, "dependencies": { - "google-gax": "^2.1.0" + "google-gax": "^2.9.2" }, "devDependencies": { "@types/mocha": "^8.0.0", diff --git a/packages/google-cloud-bigquery-storage/src/index.ts b/packages/google-cloud-bigquery-storage/src/index.ts index 8716f5a6ad2..3c75be7738d 100644 --- a/packages/google-cloud-bigquery-storage/src/index.ts +++ b/packages/google-cloud-bigquery-storage/src/index.ts @@ -19,7 +19,9 @@ import * as v1 from './v1'; import * as v1beta1 from './v1beta1'; const BigQueryReadClient = v1.BigQueryReadClient; +type BigQueryReadClient = v1.BigQueryReadClient; const BigQueryStorageClient = v1beta1.BigQueryStorageClient; +type BigQueryStorageClient = v1beta1.BigQueryStorageClient; export {v1, BigQueryReadClient, v1beta1, BigQueryStorageClient}; // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index dba8fffa0d0..d3cdbc68257 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -53,8 +53,10 @@ export class BigQueryReadClient { /** * Construct an instance of BigQueryReadClient. * - * @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] @@ -74,42 +76,33 @@ export class BigQueryReadClient { * 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 BigQueryReadClient; const servicePath = - opts && opts.servicePath - ? opts.servicePath - : opts && opts.apiEndpoint - ? opts.apiEndpoint - : staticMembers.servicePath; - const port = opts && opts.port ? opts.port : staticMembers.port; - - if (!opts) { - opts = {servicePath, port}; + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? typeof window !== 'undefined'; + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; } - opts.servicePath = opts.servicePath || servicePath; - opts.port = opts.port || port; - - // users can override the config from client side, like retry codes name. - // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 - // The way to override client config for Showcase API: - // - // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} - // const showcaseClient = new showcaseClient({ projectId, customConfig }); - opts.clientConfig = opts.clientConfig || {}; - - // If we're running in browser, it's OK to omit `fallback` since - // google-gax has `browser` field in its `package.json`. - // For Electron (which does not respect `browser` field), - // pass `{fallback: true}` to the BigQueryReadClient 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 BigQueryReadClient).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. @@ -118,6 +111,11 @@ export class BigQueryReadClient { // 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) { @@ -251,6 +249,7 @@ export class BigQueryReadClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'bigquerystorage.googleapis.com'; @@ -259,6 +258,7 @@ export class BigQueryReadClient { /** * 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 'bigquerystorage.googleapis.com'; @@ -266,6 +266,7 @@ export class BigQueryReadClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -274,6 +275,7 @@ export class BigQueryReadClient { /** * The scopes needed to make gRPC calls for every method defined * in this service. + * @returns {string[]} List of default scopes. */ static get scopes() { return [ @@ -287,8 +289,7 @@ export class BigQueryReadClient { getProjectId(callback: Callback): void; /** * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. + * @returns {Promise} A promise that resolves to string containing the project ID. */ getProjectId( callback?: Callback @@ -378,7 +379,11 @@ export class BigQueryReadClient { * 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 [ReadSession]{@link google.cloud.bigquery.storage.v1.ReadSession}. - * 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.createReadSession(request); */ createReadSession( request: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, @@ -491,7 +496,11 @@ export class BigQueryReadClient { * 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 [SplitReadStreamResponse]{@link google.cloud.bigquery.storage.v1.SplitReadStreamResponse}. - * 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.splitReadStream(request); */ splitReadStream( request: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, @@ -562,6 +571,13 @@ export class BigQueryReadClient { * 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 [ReadRowsResponse]{@link google.cloud.bigquery.storage.v1.ReadRowsResponse} on 'data' event. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) + * for more details and examples. + * @example + * const stream = client.readRows(request); + * stream.on('data', (response) => { ... }); + * stream.on('end', () => { ... }); */ readRows( request?: protos.google.cloud.bigquery.storage.v1.IReadRowsRequest, @@ -731,9 +747,10 @@ export class BigQueryReadClient { } /** - * 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-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index 8964e40f5c5..937f3012e43 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -53,8 +53,10 @@ export class BigQueryStorageClient { /** * Construct an instance of BigQueryStorageClient. * - * @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] @@ -74,42 +76,33 @@ export class BigQueryStorageClient { * 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 BigQueryStorageClient; const servicePath = - opts && opts.servicePath - ? opts.servicePath - : opts && opts.apiEndpoint - ? opts.apiEndpoint - : staticMembers.servicePath; - const port = opts && opts.port ? opts.port : staticMembers.port; - - if (!opts) { - opts = {servicePath, port}; + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? typeof window !== 'undefined'; + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; } - opts.servicePath = opts.servicePath || servicePath; - opts.port = opts.port || port; - - // users can override the config from client side, like retry codes name. - // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 - // The way to override client config for Showcase API: - // - // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} - // const showcaseClient = new showcaseClient({ projectId, customConfig }); - opts.clientConfig = opts.clientConfig || {}; - - // If we're running in browser, it's OK to omit `fallback` since - // google-gax has `browser` field in its `package.json`. - // For Electron (which does not respect `browser` field), - // pass `{fallback: true}` to the BigQueryStorageClient 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 BigQueryStorageClient).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. @@ -118,6 +111,11 @@ export class BigQueryStorageClient { // 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) { @@ -254,6 +252,7 @@ export class BigQueryStorageClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'bigquerystorage.googleapis.com'; @@ -262,6 +261,7 @@ export class BigQueryStorageClient { /** * 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 'bigquerystorage.googleapis.com'; @@ -269,6 +269,7 @@ export class BigQueryStorageClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -277,6 +278,7 @@ export class BigQueryStorageClient { /** * The scopes needed to make gRPC calls for every method defined * in this service. + * @returns {string[]} List of default scopes. */ static get scopes() { return [ @@ -290,8 +292,7 @@ export class BigQueryStorageClient { 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 @@ -383,7 +384,11 @@ export class BigQueryStorageClient { * 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 [ReadSession]{@link google.cloud.bigquery.storage.v1beta1.ReadSession}. - * 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.createReadSession(request); */ createReadSession( request: protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, @@ -485,7 +490,11 @@ export class BigQueryStorageClient { * 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 [BatchCreateReadSessionStreamsResponse]{@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse}. - * 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.batchCreateReadSessionStreams(request); */ batchCreateReadSessionStreams( request: protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, @@ -596,7 +605,11 @@ export class BigQueryStorageClient { * 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.finalizeStream(request); */ finalizeStream( request: protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, @@ -710,7 +723,11 @@ export class BigQueryStorageClient { * 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 [SplitReadStreamResponse]{@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse}. - * 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.splitReadStream(request); */ splitReadStream( request: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, @@ -781,6 +798,13 @@ export class BigQueryStorageClient { * 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 [ReadRowsResponse]{@link google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} on 'data' event. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) + * for more details and examples. + * @example + * const stream = client.readRows(request); + * stream.on('data', (response) => { ... }); + * stream.on('end', () => { ... }); */ readRows( request?: protos.google.cloud.bigquery.storage.v1beta1.IReadRowsRequest, @@ -928,9 +952,10 @@ export class BigQueryStorageClient { } /** - * 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-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 08f1c1064e3..45b45bd4e5f 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -3,23 +3,15 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "10c93ec771f1715a8f97dde1840ed5071275bec8" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "4c5071b615d96ef9dfd6a63d8429090f1f2872bb", - "internalRef": "327369997" + "remote": "git@github.com:googleapis/nodejs-bigquery-storage.git", + "sha": "9b828c649de99a96418c1d580c6440016aa298a3" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ba9918cd22874245b55734f57470c719b577e591" + "sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b" } } ], @@ -96,6 +88,7 @@ "README.md", "api-extractor.json", "linkinator.config.json", + "package-lock.json.1985761200", "protos/google/cloud/bigquery/storage/v1/arrow.proto", "protos/google/cloud/bigquery/storage/v1/avro.proto", "protos/google/cloud/bigquery/storage/v1/storage.proto", @@ -110,6 +103,7 @@ "protos/protos.json", "renovate.json", "samples/README.md", + "samples/package-lock.json.1553614215", "src/v1/big_query_read_client.ts", "src/v1/big_query_read_client_config.json", "src/v1/big_query_read_proto_list.json", diff --git a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts index 5edf8f362ab..f6f97a14228 100644 --- a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts @@ -18,8 +18,15 @@ import {BigQueryReadClient} from '@google-cloud/bigquery-storage'; +// check that the client class type name can be used +function doStuffWithBigQueryReadClient(client: BigQueryReadClient) { + client.close(); +} + function main() { - new BigQueryReadClient(); + // check that the client instance can be created + const bigQueryReadClient = new BigQueryReadClient(); + doStuffWithBigQueryReadClient(bigQueryReadClient); } main(); diff --git a/packages/google-cloud-bigquery-storage/system-test/install.ts b/packages/google-cloud-bigquery-storage/system-test/install.ts index 4c1ba3eb79a..39d90f771de 100644 --- a/packages/google-cloud-bigquery-storage/system-test/install.ts +++ b/packages/google-cloud-bigquery-storage/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 7f14b1a185cc1d73fa2c23fd3e44cbc3090bc916 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:34:13 -0800 Subject: [PATCH 085/182] chore: release 2.2.2 (#127) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-bigquery-storage/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-storage/package.json | 2 +- .../google-cloud-bigquery-storage/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md index 99a9dffbcaf..052898fde8d 100644 --- a/packages/google-cloud-bigquery-storage/CHANGELOG.md +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.2.2](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.2.1...v2.2.2) (2020-11-07) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#126](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/126)) ([6f8eb24](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/6f8eb244b1b06a928641550b2390e03964a14981)) + ### [2.2.1](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.2.0...v2.2.1) (2020-07-09) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 6f9873f5c5f..b8ab8a9edeb 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "2.2.1", + "version": "2.2.2", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index 7bd231c6fed..0a655b52ca4 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^2.2.1", + "@google-cloud/bigquery-storage": "^2.2.2", "avsc": "^5.4.18", "snappy": "^6.2.3" }, From cedb1ad38bbfa71191dd081c51a903bc084217ac Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 23 Nov 2020 12:32:39 -0800 Subject: [PATCH 086/182] fix(browser): check for fetch on window --- .../protos/protos.json | 101 ++++++++++++++++-- .../src/v1/big_query_read_client.ts | 38 ++++--- .../src/v1beta1/big_query_storage_client.ts | 58 +++++----- .../synth.metadata | 14 ++- 4 files changed, 159 insertions(+), 52 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/protos/protos.json b/packages/google-cloud-bigquery-storage/protos/protos.json index ca83026b195..2c7dbe17982 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.json +++ b/packages/google-cloud-bigquery-storage/protos/protos.json @@ -73,7 +73,18 @@ "(google.api.http).post": "/v1/{read_session.table=projects/*/datasets/*/tables/*}", "(google.api.http).body": "*", "(google.api.method_signature)": "parent,read_session,max_stream_count" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{read_session.table=projects/*/datasets/*/tables/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,read_session,max_stream_count" + } + ] }, "ReadRows": { "requestType": "ReadRowsRequest", @@ -82,14 +93,31 @@ "options": { "(google.api.http).get": "/v1/{read_stream=projects/*/locations/*/sessions/*/streams/*}", "(google.api.method_signature)": "read_stream,offset" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{read_stream=projects/*/locations/*/sessions/*/streams/*}" + } + }, + { + "(google.api.method_signature)": "read_stream,offset" + } + ] }, "SplitReadStream": { "requestType": "SplitReadStreamRequest", "responseType": "SplitReadStreamResponse", "options": { "(google.api.http).get": "/v1/{name=projects/*/locations/*/sessions/*/streams/*}" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/sessions/*/streams/*}" + } + } + ] } } }, @@ -425,7 +453,22 @@ "(google.api.http).additional_bindings.post": "/v1beta1/{table_reference.dataset_id=projects/*/datasets/*}", "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "table_reference,parent,requested_streams" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{table_reference.project_id=projects/*}", + "body": "*", + "additional_bindings": { + "post": "/v1beta1/{table_reference.dataset_id=projects/*/datasets/*}", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "table_reference,parent,requested_streams" + } + ] }, "ReadRows": { "requestType": "ReadRowsRequest", @@ -434,7 +477,17 @@ "options": { "(google.api.http).get": "/v1beta1/{read_position.stream.name=projects/*/streams/*}", "(google.api.method_signature)": "read_position" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{read_position.stream.name=projects/*/streams/*}" + } + }, + { + "(google.api.method_signature)": "read_position" + } + ] }, "BatchCreateReadSessionStreams": { "requestType": "BatchCreateReadSessionStreamsRequest", @@ -443,7 +496,18 @@ "(google.api.http).post": "/v1beta1/{session.name=projects/*/sessions/*}", "(google.api.http).body": "*", "(google.api.method_signature)": "session,requested_streams" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{session.name=projects/*/sessions/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "session,requested_streams" + } + ] }, "FinalizeStream": { "requestType": "FinalizeStreamRequest", @@ -452,7 +516,18 @@ "(google.api.http).post": "/v1beta1/{stream.name=projects/*/streams/*}", "(google.api.http).body": "*", "(google.api.method_signature)": "stream" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{stream.name=projects/*/streams/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "stream" + } + ] }, "SplitReadStream": { "requestType": "SplitReadStreamRequest", @@ -460,7 +535,17 @@ "options": { "(google.api.http).get": "/v1beta1/{original_stream.name=projects/*/streams/*}", "(google.api.method_signature)": "original_stream" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{original_stream.name=projects/*/streams/*}" + } + }, + { + "(google.api.method_signature)": "original_stream" + } + ] } } }, diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index d3cdbc68257..12bf9595d6b 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -16,11 +16,17 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; import * as path from 'path'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v1/big_query_read_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './big_query_read_client_config.json'; const version = require('../../../package.json').version; @@ -76,9 +82,9 @@ export class BigQueryReadClient { * 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` @@ -91,7 +97,9 @@ export class BigQueryReadClient { 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. @@ -306,7 +314,7 @@ export class BigQueryReadClient { // ------------------- createReadSession( request: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.bigquery.storage.v1.IReadSession, @@ -319,7 +327,7 @@ export class BigQueryReadClient { >; createReadSession( request: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.bigquery.storage.v1.IReadSession, | protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest @@ -388,7 +396,7 @@ export class BigQueryReadClient { createReadSession( request: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.bigquery.storage.v1.IReadSession, | protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest @@ -414,12 +422,12 @@ export class BigQueryReadClient { ] > | 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 || {}; @@ -434,7 +442,7 @@ export class BigQueryReadClient { } splitReadStream( request: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, @@ -447,7 +455,7 @@ export class BigQueryReadClient { >; splitReadStream( request: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, | protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest @@ -505,7 +513,7 @@ export class BigQueryReadClient { splitReadStream( request: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, | protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest @@ -531,12 +539,12 @@ export class BigQueryReadClient { ] > | 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 || {}; @@ -581,7 +589,7 @@ export class BigQueryReadClient { */ readRows( request?: protos.google.cloud.bigquery.storage.v1.IReadRowsRequest, - options?: gax.CallOptions + options?: CallOptions ): gax.CancellableStream { request = request || {}; options = options || {}; diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index 937f3012e43..23912e589cc 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -16,11 +16,17 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; import * as path from 'path'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/big_query_storage_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './big_query_storage_client_config.json'; const version = require('../../../package.json').version; @@ -76,9 +82,9 @@ export class BigQueryStorageClient { * 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` @@ -91,7 +97,9 @@ export class BigQueryStorageClient { 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. @@ -309,7 +317,7 @@ export class BigQueryStorageClient { // ------------------- createReadSession( request: protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.bigquery.storage.v1beta1.IReadSession, @@ -322,7 +330,7 @@ export class BigQueryStorageClient { >; createReadSession( request: protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.bigquery.storage.v1beta1.IReadSession, | protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest @@ -393,7 +401,7 @@ export class BigQueryStorageClient { createReadSession( request: protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.bigquery.storage.v1beta1.IReadSession, | protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest @@ -419,12 +427,12 @@ export class BigQueryStorageClient { ] > | 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 || {}; @@ -440,7 +448,7 @@ export class BigQueryStorageClient { } batchCreateReadSessionStreams( request: protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, @@ -453,7 +461,7 @@ export class BigQueryStorageClient { >; batchCreateReadSessionStreams( request: protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, | protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest @@ -499,7 +507,7 @@ export class BigQueryStorageClient { batchCreateReadSessionStreams( request: protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, | protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest @@ -525,12 +533,12 @@ export class BigQueryStorageClient { ] > | 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 || {}; @@ -549,7 +557,7 @@ export class BigQueryStorageClient { } finalizeStream( request: protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.protobuf.IEmpty, @@ -562,7 +570,7 @@ export class BigQueryStorageClient { >; finalizeStream( request: protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.protobuf.IEmpty, | protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest @@ -614,7 +622,7 @@ export class BigQueryStorageClient { finalizeStream( request: protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.protobuf.IEmpty, | protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest @@ -640,12 +648,12 @@ export class BigQueryStorageClient { ] > | 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 || {}; @@ -660,7 +668,7 @@ export class BigQueryStorageClient { } splitReadStream( request: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, @@ -673,7 +681,7 @@ export class BigQueryStorageClient { >; splitReadStream( request: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, | protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest @@ -732,7 +740,7 @@ export class BigQueryStorageClient { splitReadStream( request: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, | protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest @@ -758,12 +766,12 @@ export class BigQueryStorageClient { ] > | 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 || {}; @@ -808,7 +816,7 @@ export class BigQueryStorageClient { */ readRows( request?: protos.google.cloud.bigquery.storage.v1beta1.IReadRowsRequest, - options?: gax.CallOptions + options?: CallOptions ): gax.CancellableStream { request = request || {}; options = options || {}; diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 45b45bd4e5f..a626ba33fb3 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -3,8 +3,16 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-bigquery-storage.git", - "sha": "9b828c649de99a96418c1d580c6440016aa298a3" + "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", + "sha": "9d0131d14ff5512b3bf27c4d68535f4449e7b5bb" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "2f019bf70bfe06f1e2af1b04011b0a2405190e43", + "internalRef": "343202295" } }, { @@ -88,7 +96,6 @@ "README.md", "api-extractor.json", "linkinator.config.json", - "package-lock.json.1985761200", "protos/google/cloud/bigquery/storage/v1/arrow.proto", "protos/google/cloud/bigquery/storage/v1/avro.proto", "protos/google/cloud/bigquery/storage/v1/storage.proto", @@ -103,7 +110,6 @@ "protos/protos.json", "renovate.json", "samples/README.md", - "samples/package-lock.json.1553614215", "src/v1/big_query_read_client.ts", "src/v1/big_query_read_client_config.json", "src/v1/big_query_read_proto_list.json", From 271a18b877038db93351a590303e96d6e0b6457a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 25 Nov 2020 08:34:58 -0800 Subject: [PATCH 087/182] docs: spelling correction for "targetting" (#131) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/c503f640-90ae-4547-bcc8-a154d32c609e/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/15013eff642a7e7e855aed5a29e6e83c39beba2a --- .../google-cloud-bigquery-storage/README.md | 2 +- .../synth.metadata | 87 +------------------ 2 files changed, 3 insertions(+), 86 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/README.md b/packages/google-cloud-bigquery-storage/README.md index 3a07845c979..b7ac445dad1 100644 --- a/packages/google-cloud-bigquery-storage/README.md +++ b/packages/google-cloud-bigquery-storage/README.md @@ -200,7 +200,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-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index a626ba33fb3..8b90f7e79bf 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "9d0131d14ff5512b3bf27c4d68535f4449e7b5bb" + "sha": "d837dfc841cf3e77fbc2482dbabb149e2fc4f76a" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b" + "sha": "15013eff642a7e7e855aed5a29e6e83c39beba2a" } } ], @@ -42,88 +42,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/storage/v1/arrow.proto", - "protos/google/cloud/bigquery/storage/v1/avro.proto", - "protos/google/cloud/bigquery/storage/v1/storage.proto", - "protos/google/cloud/bigquery/storage/v1/stream.proto", - "protos/google/cloud/bigquery/storage/v1beta1/arrow.proto", - "protos/google/cloud/bigquery/storage/v1beta1/avro.proto", - "protos/google/cloud/bigquery/storage/v1beta1/read_options.proto", - "protos/google/cloud/bigquery/storage/v1beta1/storage.proto", - "protos/google/cloud/bigquery/storage/v1beta1/table_reference.proto", - "protos/protos.d.ts", - "protos/protos.js", - "protos/protos.json", - "renovate.json", - "samples/README.md", - "src/v1/big_query_read_client.ts", - "src/v1/big_query_read_client_config.json", - "src/v1/big_query_read_proto_list.json", - "src/v1/index.ts", - "src/v1beta1/big_query_storage_client.ts", - "src/v1beta1/big_query_storage_client_config.json", - "src/v1beta1/big_query_storage_proto_list.json", - "src/v1beta1/index.ts", - "system-test/fixtures/sample/src/index.js", - "system-test/fixtures/sample/src/index.ts", - "system-test/install.ts", - "test/gapic_big_query_read_v1.ts", - "test/gapic_big_query_storage_v1beta1.ts", - "tsconfig.json", - "webpack.config.js" ] } \ No newline at end of file From e4ad62f9c0c99fe2d7d3a20953c15f3e75c5c72e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 2 Dec 2020 10:38:41 -0800 Subject: [PATCH 088/182] chore: release 2.2.3 (#130) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-bigquery-storage/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-storage/package.json | 2 +- .../google-cloud-bigquery-storage/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md index 052898fde8d..112ba679277 100644 --- a/packages/google-cloud-bigquery-storage/CHANGELOG.md +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.2.3](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.2.2...v2.2.3) (2020-11-25) + + +### Bug Fixes + +* **browser:** check for fetch on window ([d837dfc](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/d837dfc841cf3e77fbc2482dbabb149e2fc4f76a)) + ### [2.2.2](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.2.1...v2.2.2) (2020-11-07) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index b8ab8a9edeb..e9159681af6 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "2.2.2", + "version": "2.2.3", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index 0a655b52ca4..a40379df20f 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^2.2.2", + "@google-cloud/bigquery-storage": "^2.2.3", "avsc": "^5.4.18", "snappy": "^6.2.3" }, From 4f5be93cf340b8850b0b6a37dbb872c1e87f6dc8 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 4 Dec 2020 08:56:30 -0800 Subject: [PATCH 089/182] chore: generate GAPIC metadata JSON file (#132) 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 | 48 +++++++++++++ .../src/v1beta1/gapic_metadata.json | 68 +++++++++++++++++++ .../synth.metadata | 6 +- 3 files changed, 119 insertions(+), 3 deletions(-) create mode 100644 packages/google-cloud-bigquery-storage/src/v1/gapic_metadata.json create mode 100644 packages/google-cloud-bigquery-storage/src/v1beta1/gapic_metadata.json diff --git a/packages/google-cloud-bigquery-storage/src/v1/gapic_metadata.json b/packages/google-cloud-bigquery-storage/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..3c84159f688 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/src/v1/gapic_metadata.json @@ -0,0 +1,48 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.bigquery.storage.v1", + "libraryPackage": "@google-cloud/bigquery-storage", + "services": { + "BigQueryRead": { + "clients": { + "grpc": { + "libraryClient": "BigQueryReadClient", + "rpcs": { + "CreateReadSession": { + "methods": [ + "createReadSession" + ] + }, + "SplitReadStream": { + "methods": [ + "splitReadStream" + ] + }, + "ReadRows": { + "methods": [ + "readRows" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "BigQueryReadClient", + "rpcs": { + "CreateReadSession": { + "methods": [ + "createReadSession" + ] + }, + "SplitReadStream": { + "methods": [ + "splitReadStream" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/gapic_metadata.json b/packages/google-cloud-bigquery-storage/src/v1beta1/gapic_metadata.json new file mode 100644 index 00000000000..00d888bf605 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/gapic_metadata.json @@ -0,0 +1,68 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.bigquery.storage.v1beta1", + "libraryPackage": "@google-cloud/bigquery-storage", + "services": { + "BigQueryStorage": { + "clients": { + "grpc": { + "libraryClient": "BigQueryStorageClient", + "rpcs": { + "CreateReadSession": { + "methods": [ + "createReadSession" + ] + }, + "BatchCreateReadSessionStreams": { + "methods": [ + "batchCreateReadSessionStreams" + ] + }, + "FinalizeStream": { + "methods": [ + "finalizeStream" + ] + }, + "SplitReadStream": { + "methods": [ + "splitReadStream" + ] + }, + "ReadRows": { + "methods": [ + "readRows" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "BigQueryStorageClient", + "rpcs": { + "CreateReadSession": { + "methods": [ + "createReadSession" + ] + }, + "BatchCreateReadSessionStreams": { + "methods": [ + "batchCreateReadSessionStreams" + ] + }, + "FinalizeStream": { + "methods": [ + "finalizeStream" + ] + }, + "SplitReadStream": { + "methods": [ + "splitReadStream" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 8b90f7e79bf..70b1e3840bc 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "d837dfc841cf3e77fbc2482dbabb149e2fc4f76a" + "sha": "4f2862e8145c3cfde1bd97ccfd7cbc666ad18f83" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "2f019bf70bfe06f1e2af1b04011b0a2405190e43", - "internalRef": "343202295" + "sha": "d189e871205fea665a9648f7c4676f027495ccaf", + "internalRef": "345596855" } }, { From d1854bd093a46bb596f6afbf4c57c3eebd346e29 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 22 Dec 2020 11:46:23 -0800 Subject: [PATCH 090/182] docs: add instructions for authenticating for system tests (#133) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/9943226b-8e9b-44fd-b025-446fc572242a/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/363fe305e9ce34a6cd53951c6ee5f997094b54ee --- .../google-cloud-bigquery-storage/CONTRIBUTING.md | 15 +++++++++++++-- packages/google-cloud-bigquery-storage/README.md | 3 +-- .../google-cloud-bigquery-storage/synth.metadata | 4 ++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CONTRIBUTING.md b/packages/google-cloud-bigquery-storage/CONTRIBUTING.md index f6c4cf010e3..3281e44c984 100644 --- a/packages/google-cloud-bigquery-storage/CONTRIBUTING.md +++ b/packages/google-cloud-bigquery-storage/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 Storage 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=bigquerystorage.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-bigquery-storage/README.md b/packages/google-cloud-bigquery-storage/README.md index b7ac445dad1..c562b19865d 100644 --- a/packages/google-cloud-bigquery-storage/README.md +++ b/packages/google-cloud-bigquery-storage/README.md @@ -182,8 +182,7 @@ async function bigqueryStorageQuickstart() { ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-bigquery-storage/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-storage/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-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 70b1e3840bc..0c2dadf2c36 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "4f2862e8145c3cfde1bd97ccfd7cbc666ad18f83" + "sha": "0ce572e13d2b82409d4e187f7f2b5e1171cfbcc5" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "15013eff642a7e7e855aed5a29e6e83c39beba2a" + "sha": "363fe305e9ce34a6cd53951c6ee5f997094b54ee" } } ], From 98e7b2e45d5a51de139a0f0bdd1656632366f5d3 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 1 Jan 2021 19:41:38 -0800 Subject: [PATCH 091/182] chore: update license headers (#134) --- packages/google-cloud-bigquery-storage/.jsdoc.js | 4 ++-- packages/google-cloud-bigquery-storage/protos/protos.d.ts | 2 +- packages/google-cloud-bigquery-storage/protos/protos.js | 2 +- .../src/v1/big_query_read_client.ts | 2 +- packages/google-cloud-bigquery-storage/src/v1/index.ts | 2 +- .../src/v1beta1/big_query_storage_client.ts | 2 +- packages/google-cloud-bigquery-storage/src/v1beta1/index.ts | 2 +- packages/google-cloud-bigquery-storage/synth.metadata | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- packages/google-cloud-bigquery-storage/system-test/install.ts | 2 +- .../test/gapic_big_query_read_v1.ts | 2 +- .../test/gapic_big_query_storage_v1beta1.ts | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/.jsdoc.js b/packages/google-cloud-bigquery-storage/.jsdoc.js index ac0f1658a27..9451ad92fe9 100644 --- a/packages/google-cloud-bigquery-storage/.jsdoc.js +++ b/packages/google-cloud-bigquery-storage/.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-storage', diff --git a/packages/google-cloud-bigquery-storage/protos/protos.d.ts b/packages/google-cloud-bigquery-storage/protos/protos.d.ts index f94b251defa..a6882c87ab3 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-storage/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-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index 0927a833d1a..ea053058b23 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/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-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index 12bf9595d6b..a5d7db865c2 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_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-storage/src/v1/index.ts b/packages/google-cloud-bigquery-storage/src/v1/index.ts index c882095873b..db2de17014f 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/index.ts +++ b/packages/google-cloud-bigquery-storage/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-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index 23912e589cc..da6f81c04e4 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_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-storage/src/v1beta1/index.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/index.ts index 9b3c5a12d86..2c9b3f3f526 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/index.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 0c2dadf2c36..c547fdd0c6d 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "0ce572e13d2b82409d4e187f7f2b5e1171cfbcc5" + "sha": "89ed81d984c38439e885248cb971473ce9887a8a" } }, { diff --git a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js index a0f6f03ee57..627efaa9f20 100644 --- a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-bigquery-storage/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-storage/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts index f6f97a14228..3b55b605b29 100644 --- a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-bigquery-storage/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-storage/system-test/install.ts b/packages/google-cloud-bigquery-storage/system-test/install.ts index 39d90f771de..d2d61c0396f 100644 --- a/packages/google-cloud-bigquery-storage/system-test/install.ts +++ b/packages/google-cloud-bigquery-storage/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-storage/test/gapic_big_query_read_v1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts index fb204c5c622..6d69543ebaf 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts index 117757e569b..471cebc8ec7 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From ed760f29ea429391b563fab1c8ee465664e6f5ef Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 8 Jan 2021 18:42:17 -0800 Subject: [PATCH 092/182] feat: introduce style enumeration (#135) 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-storage/protos/protos.d.ts b/packages/google-cloud-bigquery-storage/protos/protos.d.ts index a6882c87ab3..9a211eb7968 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-storage/protos/protos.d.ts @@ -4300,6 +4300,9 @@ export namespace google { /** ResourceDescriptor singular */ singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); } /** Represents a ResourceDescriptor. */ @@ -4329,6 +4332,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 @@ -4408,6 +4414,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-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index ea053058b23..25fff2f0dcb 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/protos/protos.js @@ -10124,6 +10124,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 */ /** @@ -10136,6 +10137,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) @@ -10190,6 +10192,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 @@ -10227,6 +10237,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; }; @@ -10281,6 +10297,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; @@ -10344,6 +10370,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; }; @@ -10388,6 +10426,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; }; @@ -10404,8 +10459,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 = ""; @@ -10428,6 +10485,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; }; @@ -10458,6 +10520,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-storage/protos/protos.json b/packages/google-cloud-bigquery-storage/protos/protos.json index 2c7dbe17982..c3e23963a79 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.json +++ b/packages/google-cloud-bigquery-storage/protos/protos.json @@ -1026,6 +1026,11 @@ "singular": { "type": "string", "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 } }, "nested": { @@ -1035,6 +1040,12 @@ "ORIGINALLY_SINGLE_PATTERN": 1, "FUTURE_MULTI_PATTERN": 2 } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } } } }, @@ -1054,7 +1065,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-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index c547fdd0c6d..cedad127a34 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "89ed81d984c38439e885248cb971473ce9887a8a" + "sha": "89e1d811c8e0b5282519807b0ea1cdd3afc0ea87" } }, { From b93fb00494fccde0f4ad041565fe2872860884d8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 12 Jan 2021 18:36:35 +0000 Subject: [PATCH 093/182] chore: release 2.3.0 (#136) :robot: I have created a release \*beep\* \*boop\* --- ## [2.3.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.2.3...v2.3.0) (2021-01-09) ### Features * introduce style enumeration ([#135](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/135)) ([4a8f699](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/4a8f699472d67aae4300c458308c2fa4fa372592)) --- 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-storage/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-storage/package.json | 2 +- .../google-cloud-bigquery-storage/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md index 112ba679277..00c433bccd8 100644 --- a/packages/google-cloud-bigquery-storage/CHANGELOG.md +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.3.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.2.3...v2.3.0) (2021-01-09) + + +### Features + +* introduce style enumeration ([#135](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/135)) ([4a8f699](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/4a8f699472d67aae4300c458308c2fa4fa372592)) + ### [2.2.3](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.2.2...v2.2.3) (2020-11-25) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index e9159681af6..d2e99ee50f9 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "2.2.3", + "version": "2.3.0", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index a40379df20f..8b6433fca67 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^2.2.3", + "@google-cloud/bigquery-storage": "^2.3.0", "avsc": "^5.4.18", "snappy": "^6.2.3" }, From eedd6945c9ce1652e8834ed622c56b025e41ab1d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 27 Jan 2021 08:42:27 -0800 Subject: [PATCH 094/182] refactor(nodejs): move build cop to flakybot (#139) 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-storage/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index cedad127a34..089f2da19a6 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "89e1d811c8e0b5282519807b0ea1cdd3afc0ea87" + "sha": "9079ae02c578d3dce53abf04984bbe67aa053236" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "363fe305e9ce34a6cd53951c6ee5f997094b54ee" + "sha": "57c23fa5705499a4181095ced81f0ee0933b64f6" } } ], From cd4717e9a9baca018eff7469e32d494d0124da4b Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 2 Feb 2021 17:52:22 -0800 Subject: [PATCH 095/182] chore: update CODEOWNERS config (#140) --- .../.repo-metadata.json | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/.repo-metadata.json b/packages/google-cloud-bigquery-storage/.repo-metadata.json index 7ae251898a0..1c173eeacf9 100644 --- a/packages/google-cloud-bigquery-storage/.repo-metadata.json +++ b/packages/google-cloud-bigquery-storage/.repo-metadata.json @@ -1,13 +1,14 @@ { - "name": "bigquerystorage", - "name_pretty": "Google BigQuery Storage", - "product_documentation": "https://cloud.google.com/bigquery/docs/reference/storage", - "client_documentation": "https://googleapis.dev/nodejs/bigquerystorage/latest", - "issue_tracker": "https://b.corp.google.com/savedsearches/559654", - "release_level": "ga", - "language": "nodejs", - "repo": "googleapis/nodejs-bigquery-storage", - "distribution_name": "@google-cloud/bigquery-storage", - "api_id": "bigquerystorage.googleapis.com", - "requires_billing": true - } + "name": "bigquerystorage", + "name_pretty": "Google BigQuery Storage", + "product_documentation": "https://cloud.google.com/bigquery/docs/reference/storage", + "client_documentation": "https://googleapis.dev/nodejs/bigquerystorage/latest", + "issue_tracker": "https://b.corp.google.com/savedsearches/559654", + "release_level": "ga", + "language": "nodejs", + "repo": "googleapis/nodejs-bigquery-storage", + "distribution_name": "@google-cloud/bigquery-storage", + "api_id": "bigquerystorage.googleapis.com", + "requires_billing": true, + "codeowner_team": "@googleapis/api-bigquery" +} From 4b4113c973b1e206b133efd7bac35e180ff28e50 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 3 Feb 2021 18:06:14 -0800 Subject: [PATCH 096/182] build: adds UNORDERED_LIST enum (#141) 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. --- packages/google-cloud-bigquery-storage/protos/protos.d.ts | 3 ++- packages/google-cloud-bigquery-storage/protos/protos.js | 7 +++++++ packages/google-cloud-bigquery-storage/protos/protos.json | 3 ++- packages/google-cloud-bigquery-storage/synth.metadata | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/protos/protos.d.ts b/packages/google-cloud-bigquery-storage/protos/protos.d.ts index 9a211eb7968..e2bf17d7e22 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-storage/protos/protos.d.ts @@ -4277,7 +4277,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-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index 25fff2f0dcb..70c91d583af 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/protos/protos.js @@ -10100,6 +10100,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); @@ -10109,6 +10110,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; })(); @@ -16276,6 +16278,7 @@ case 3: case 4: case 5: + case 6: break; } } @@ -16376,6 +16379,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-storage/protos/protos.json b/packages/google-cloud-bigquery-storage/protos/protos.json index c3e23963a79..e959d1cef26 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.json +++ b/packages/google-cloud-bigquery-storage/protos/protos.json @@ -981,7 +981,8 @@ "REQUIRED": 2, "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, - "IMMUTABLE": 5 + "IMMUTABLE": 5, + "UNORDERED_LIST": 6 } }, "resourceReference": { diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 089f2da19a6..7ffc39ae2c0 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "9079ae02c578d3dce53abf04984bbe67aa053236" + "sha": "9606545d68bf4fd62ec8c3983e1ca85db10e7bc5" } }, { From c87c0451af76c7141e57997ff7548011560b7d5d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 7 Mar 2021 09:00:36 -0800 Subject: [PATCH 097/182] build: update gapic-generator-typescript to v1.2.10. (#142) 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-storage/synth.metadata | 6 +++--- packages/google-cloud-bigquery-storage/webpack.config.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index 7ffc39ae2c0..b4392c2cc14 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "9606545d68bf4fd62ec8c3983e1ca85db10e7bc5" + "sha": "2790786fb23c579b7a1ca7a3bdf91f375786f16e" } }, { "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-storage/webpack.config.js b/packages/google-cloud-bigquery-storage/webpack.config.js index 215b4b9acb9..de163617408 100644 --- a/packages/google-cloud-bigquery-storage/webpack.config.js +++ b/packages/google-cloud-bigquery-storage/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 75866097a84009aac7c1c3f7079a2daf9243c151 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 23 Mar 2021 17:52:25 +0100 Subject: [PATCH 098/182] chore(deps): update dependency sinon to v10 (#144) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^9.0.1` -> `^10.0.0`](https://renovatebot.com/diffs/npm/sinon/9.2.4/10.0.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/compatibility-slim/9.2.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/confidence-slim/9.2.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v10.0.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1000--2021-03-22) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v9.2.4...v10.0.0) ================== - Upgrade nise to 4.1.0 - Use [@​sinonjs/eslint-config](https://togithub.com/sinonjs/eslint-config)[@​4](https://togithub.com/4) => Adopts ES2017 => Drops support for IE 11, Legacy Edge and legacy Safari
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-bigquery-storage). --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index d2e99ee50f9..9ae410a2959 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -44,7 +44,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^9.0.1", + "sinon": "^10.0.0", "ts-loader": "^8.0.0", "typescript": "^3.8.3", "webpack": "^5.0.0", From c86746ffe0a87f881ac93d09859de5767386ff9c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 30 Mar 2021 10:10:17 -0700 Subject: [PATCH 099/182] feat: add a Arrow compression options (Only LZ4 for now). feat: Return schema on first ReadRowsResponse doc: clarify limit on filter string. (#145) Committer: @emkornfield PiperOrigin-RevId: 365759522 Source-Author: Google APIs Source-Date: Tue Mar 30 01:19:13 2021 -0700 Source-Repo: googleapis/googleapis Source-Sha: c539b9b08b3366ee00c0ec1950f4df711552a269 Source-Link: https://github.com/googleapis/googleapis/commit/c539b9b08b3366ee00c0ec1950f4df711552a269 --- .../cloud/bigquery/storage/v1/arrow.proto | 19 +- .../cloud/bigquery/storage/v1/avro.proto | 3 +- .../cloud/bigquery/storage/v1/storage.proto | 22 +- .../cloud/bigquery/storage/v1/stream.proto | 28 +- .../protos/protos.d.ts | 123 +++++++ .../protos/protos.js | 338 ++++++++++++++++++ .../protos/protos.json | 50 +++ .../synth.metadata | 6 +- 8 files changed, 568 insertions(+), 21 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/arrow.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/arrow.proto index 1c54eeab07f..4b240f52139 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/arrow.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/arrow.proto @@ -1,4 +1,4 @@ -// Copyright 2019 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. @@ -11,7 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; @@ -43,3 +42,19 @@ message ArrowRecordBatch { // The count of rows in `serialized_record_batch`. int64 row_count = 2; } + +// Contains options specific to Arrow Serialization. +message ArrowSerializationOptions { + // Compression codec's supported by Arrow. + enum CompressionCodec { + // If unspecified no compression will be used. + COMPRESSION_UNSPECIFIED = 0; + + // LZ4 Frame (https://github.com/lz4/lz4/blob/dev/doc/lz4_Frame_format.md) + LZ4_FRAME = 1; + } + + // The compression codec to use for Arrow buffers in serialized record + // batches. + CompressionCodec buffer_compression = 2; +} diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/avro.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/avro.proto index 9a064447b9f..dee4a6ed229 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/avro.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/avro.proto @@ -1,4 +1,4 @@ -// Copyright 2019 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. @@ -11,7 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto index 26fcd6ac25c..a5fa2b9eb86 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto @@ -1,4 +1,4 @@ -// Copyright 2019 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. @@ -11,7 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; @@ -70,7 +69,8 @@ service BigQueryRead { post: "/v1/{read_session.table=projects/*/datasets/*/tables/*}" body: "*" }; - option (google.api.method_signature) = "parent,read_session,max_stream_count"; + option (google.api.method_signature) = + "parent,read_session,max_stream_count"; } // Reads rows from the stream in the format prescribed by the ReadSession. @@ -99,7 +99,8 @@ service BigQueryRead { // original, primary, and residual, that original[0-j] = primary[0-j] and // original[j-n] = residual[0-m] once the streams have been read to // completion. - rpc SplitReadStream(SplitReadStreamRequest) returns (SplitReadStreamResponse) { + rpc SplitReadStream(SplitReadStreamRequest) + returns (SplitReadStreamResponse) { option (google.api.http) = { get: "/v1/{name=projects/*/locations/*/sessions/*/streams/*}" }; @@ -201,6 +202,19 @@ message ReadRowsResponse { // Throttling state. If unset, the latest response still describes // the current throttling status. ThrottleState throttle_state = 5; + + // The schema for the read. If read_options.selected_fields is set, the + // schema may be different from the table schema as it will only contain + // the selected fields. This schema is equivelant to the one returned by + // CreateSession. This field is only populated in the first ReadRowsResponse + // RPC. + oneof schema { + // Output only. Avro schema. + AvroSchema avro_schema = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Arrow schema. + ArrowSchema arrow_schema = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + } } // Request message for `SplitReadStream`. diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto index febad03675e..28b2ac1bbf3 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto @@ -1,4 +1,4 @@ -// Copyright 2019 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. @@ -11,7 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; @@ -72,17 +71,27 @@ message ReadSession { // "nullable_field is not NULL" // "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))" // "numeric_field BETWEEN 1.0 AND 5.0" + // + // Restricted to a maximum length for 1 MB. string row_restriction = 2; + + // Optional. Options specific to the Apache Arrow output format. + oneof output_format_serialization_options { + ArrowSerializationOptions arrow_serialization_options = 3 + [(google.api.field_behavior) = OPTIONAL]; + } } // Output only. Unique identifier for the session, in the form // `projects/{project_id}/locations/{location}/sessions/{session_id}`. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Time at which the session becomes invalid. After this time, subsequent - // requests to read this Session will return errors. The expire_time is - // automatically assigned and currently cannot be specified or updated. - google.protobuf.Timestamp expire_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Time at which the session becomes invalid. After this time, + // subsequent requests to read this Session will return errors. The + // expire_time is automatically assigned and currently cannot be specified or + // updated. + google.protobuf.Timestamp expire_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Immutable. Data format of the output data. DataFormat data_format = 3 [(google.api.field_behavior) = IMMUTABLE]; @@ -102,12 +111,11 @@ message ReadSession { // `projects/{project_id}/datasets/{dataset_id}/tables/{table_id}` string table = 6 [ (google.api.field_behavior) = IMMUTABLE, - (google.api.resource_reference) = { - type: "bigquery.googleapis.com/Table" - } + (google.api.resource_reference) = { type: "bigquery.googleapis.com/Table" } ]; - // Optional. Any modifiers which are applied when reading from the specified table. + // Optional. Any modifiers which are applied when reading from the specified + // table. TableModifiers table_modifiers = 7 [(google.api.field_behavior) = OPTIONAL]; // Optional. Read options for this session (e.g. column selection, filters). diff --git a/packages/google-cloud-bigquery-storage/protos/protos.d.ts b/packages/google-cloud-bigquery-storage/protos/protos.d.ts index e2bf17d7e22..619dc695897 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-storage/protos/protos.d.ts @@ -215,6 +215,105 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of an ArrowSerializationOptions. */ + interface IArrowSerializationOptions { + + /** ArrowSerializationOptions bufferCompression */ + bufferCompression?: (google.cloud.bigquery.storage.v1.ArrowSerializationOptions.CompressionCodec|keyof typeof google.cloud.bigquery.storage.v1.ArrowSerializationOptions.CompressionCodec|null); + } + + /** Represents an ArrowSerializationOptions. */ + class ArrowSerializationOptions implements IArrowSerializationOptions { + + /** + * Constructs a new ArrowSerializationOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.IArrowSerializationOptions); + + /** ArrowSerializationOptions bufferCompression. */ + public bufferCompression: (google.cloud.bigquery.storage.v1.ArrowSerializationOptions.CompressionCodec|keyof typeof google.cloud.bigquery.storage.v1.ArrowSerializationOptions.CompressionCodec); + + /** + * Creates a new ArrowSerializationOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ArrowSerializationOptions instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.IArrowSerializationOptions): google.cloud.bigquery.storage.v1.ArrowSerializationOptions; + + /** + * Encodes the specified ArrowSerializationOptions message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ArrowSerializationOptions.verify|verify} messages. + * @param message ArrowSerializationOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.IArrowSerializationOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ArrowSerializationOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ArrowSerializationOptions.verify|verify} messages. + * @param message ArrowSerializationOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IArrowSerializationOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ArrowSerializationOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ArrowSerializationOptions + * @throws {Error} If the payload is not a 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.storage.v1.ArrowSerializationOptions; + + /** + * Decodes an ArrowSerializationOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ArrowSerializationOptions + * @throws {Error} If the payload is 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.storage.v1.ArrowSerializationOptions; + + /** + * Verifies an ArrowSerializationOptions message. + * @param message Plain 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 ArrowSerializationOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ArrowSerializationOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.ArrowSerializationOptions; + + /** + * Creates a plain object from an ArrowSerializationOptions message. Also converts values to other types if specified. + * @param message ArrowSerializationOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.ArrowSerializationOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ArrowSerializationOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ArrowSerializationOptions { + + /** CompressionCodec enum. */ + enum CompressionCodec { + COMPRESSION_UNSPECIFIED = 0, + LZ4_FRAME = 1 + } + } + /** Properties of an AvroSchema. */ interface IAvroSchema { @@ -982,6 +1081,12 @@ export namespace google { /** ReadRowsResponse throttleState */ throttleState?: (google.cloud.bigquery.storage.v1.IThrottleState|null); + + /** ReadRowsResponse avroSchema */ + avroSchema?: (google.cloud.bigquery.storage.v1.IAvroSchema|null); + + /** ReadRowsResponse arrowSchema */ + arrowSchema?: (google.cloud.bigquery.storage.v1.IArrowSchema|null); } /** Represents a ReadRowsResponse. */ @@ -1008,9 +1113,18 @@ export namespace google { /** ReadRowsResponse throttleState. */ public throttleState?: (google.cloud.bigquery.storage.v1.IThrottleState|null); + /** ReadRowsResponse avroSchema. */ + public avroSchema?: (google.cloud.bigquery.storage.v1.IAvroSchema|null); + + /** ReadRowsResponse arrowSchema. */ + public arrowSchema?: (google.cloud.bigquery.storage.v1.IArrowSchema|null); + /** ReadRowsResponse rows. */ public rows?: ("avroRows"|"arrowRecordBatch"); + /** ReadRowsResponse schema. */ + public schema?: ("avroSchema"|"arrowSchema"); + /** * Creates a new ReadRowsResponse instance using the specified properties. * @param [properties] Properties to set @@ -1522,6 +1636,9 @@ export namespace google { /** TableReadOptions rowRestriction */ rowRestriction?: (string|null); + + /** TableReadOptions arrowSerializationOptions */ + arrowSerializationOptions?: (google.cloud.bigquery.storage.v1.IArrowSerializationOptions|null); } /** Represents a TableReadOptions. */ @@ -1539,6 +1656,12 @@ export namespace google { /** TableReadOptions rowRestriction. */ public rowRestriction: string; + /** TableReadOptions arrowSerializationOptions. */ + public arrowSerializationOptions?: (google.cloud.bigquery.storage.v1.IArrowSerializationOptions|null); + + /** TableReadOptions outputFormatSerializationOptions. */ + public outputFormatSerializationOptions?: "arrowSerializationOptions"; + /** * Creates a new TableReadOptions instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-bigquery-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index 70c91d583af..6f315f5ffad 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/protos/protos.js @@ -504,6 +504,220 @@ return ArrowRecordBatch; })(); + v1.ArrowSerializationOptions = (function() { + + /** + * Properties of an ArrowSerializationOptions. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IArrowSerializationOptions + * @property {google.cloud.bigquery.storage.v1.ArrowSerializationOptions.CompressionCodec|null} [bufferCompression] ArrowSerializationOptions bufferCompression + */ + + /** + * Constructs a new ArrowSerializationOptions. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents an ArrowSerializationOptions. + * @implements IArrowSerializationOptions + * @constructor + * @param {google.cloud.bigquery.storage.v1.IArrowSerializationOptions=} [properties] Properties to set + */ + function ArrowSerializationOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ArrowSerializationOptions bufferCompression. + * @member {google.cloud.bigquery.storage.v1.ArrowSerializationOptions.CompressionCodec} bufferCompression + * @memberof google.cloud.bigquery.storage.v1.ArrowSerializationOptions + * @instance + */ + ArrowSerializationOptions.prototype.bufferCompression = 0; + + /** + * Creates a new ArrowSerializationOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.ArrowSerializationOptions + * @static + * @param {google.cloud.bigquery.storage.v1.IArrowSerializationOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.ArrowSerializationOptions} ArrowSerializationOptions instance + */ + ArrowSerializationOptions.create = function create(properties) { + return new ArrowSerializationOptions(properties); + }; + + /** + * Encodes the specified ArrowSerializationOptions message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ArrowSerializationOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.ArrowSerializationOptions + * @static + * @param {google.cloud.bigquery.storage.v1.IArrowSerializationOptions} message ArrowSerializationOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrowSerializationOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bufferCompression != null && Object.hasOwnProperty.call(message, "bufferCompression")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.bufferCompression); + return writer; + }; + + /** + * Encodes the specified ArrowSerializationOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ArrowSerializationOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ArrowSerializationOptions + * @static + * @param {google.cloud.bigquery.storage.v1.IArrowSerializationOptions} message ArrowSerializationOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrowSerializationOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ArrowSerializationOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.ArrowSerializationOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.ArrowSerializationOptions} ArrowSerializationOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrowSerializationOptions.decode = function decode(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.storage.v1.ArrowSerializationOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.bufferCompression = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ArrowSerializationOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ArrowSerializationOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.ArrowSerializationOptions} ArrowSerializationOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrowSerializationOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArrowSerializationOptions message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.ArrowSerializationOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArrowSerializationOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bufferCompression != null && message.hasOwnProperty("bufferCompression")) + switch (message.bufferCompression) { + default: + return "bufferCompression: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ArrowSerializationOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.ArrowSerializationOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.ArrowSerializationOptions} ArrowSerializationOptions + */ + ArrowSerializationOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions(); + switch (object.bufferCompression) { + case "COMPRESSION_UNSPECIFIED": + case 0: + message.bufferCompression = 0; + break; + case "LZ4_FRAME": + case 1: + message.bufferCompression = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ArrowSerializationOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.ArrowSerializationOptions + * @static + * @param {google.cloud.bigquery.storage.v1.ArrowSerializationOptions} message ArrowSerializationOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArrowSerializationOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.bufferCompression = options.enums === String ? "COMPRESSION_UNSPECIFIED" : 0; + if (message.bufferCompression != null && message.hasOwnProperty("bufferCompression")) + object.bufferCompression = options.enums === String ? $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.CompressionCodec[message.bufferCompression] : message.bufferCompression; + return object; + }; + + /** + * Converts this ArrowSerializationOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.ArrowSerializationOptions + * @instance + * @returns {Object.} JSON object + */ + ArrowSerializationOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * CompressionCodec enum. + * @name google.cloud.bigquery.storage.v1.ArrowSerializationOptions.CompressionCodec + * @enum {number} + * @property {number} COMPRESSION_UNSPECIFIED=0 COMPRESSION_UNSPECIFIED value + * @property {number} LZ4_FRAME=1 LZ4_FRAME value + */ + ArrowSerializationOptions.CompressionCodec = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPRESSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "LZ4_FRAME"] = 1; + return values; + })(); + + return ArrowSerializationOptions; + })(); + v1.AvroSchema = (function() { /** @@ -2119,6 +2333,8 @@ * @property {number|Long|null} [rowCount] ReadRowsResponse rowCount * @property {google.cloud.bigquery.storage.v1.IStreamStats|null} [stats] ReadRowsResponse stats * @property {google.cloud.bigquery.storage.v1.IThrottleState|null} [throttleState] ReadRowsResponse throttleState + * @property {google.cloud.bigquery.storage.v1.IAvroSchema|null} [avroSchema] ReadRowsResponse avroSchema + * @property {google.cloud.bigquery.storage.v1.IArrowSchema|null} [arrowSchema] ReadRowsResponse arrowSchema */ /** @@ -2176,6 +2392,22 @@ */ ReadRowsResponse.prototype.throttleState = null; + /** + * ReadRowsResponse avroSchema. + * @member {google.cloud.bigquery.storage.v1.IAvroSchema|null|undefined} avroSchema + * @memberof google.cloud.bigquery.storage.v1.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.avroSchema = null; + + /** + * ReadRowsResponse arrowSchema. + * @member {google.cloud.bigquery.storage.v1.IArrowSchema|null|undefined} arrowSchema + * @memberof google.cloud.bigquery.storage.v1.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.arrowSchema = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -2190,6 +2422,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * ReadRowsResponse schema. + * @member {"avroSchema"|"arrowSchema"|undefined} schema + * @memberof google.cloud.bigquery.storage.v1.ReadRowsResponse + * @instance + */ + Object.defineProperty(ReadRowsResponse.prototype, "schema", { + get: $util.oneOfGetter($oneOfFields = ["avroSchema", "arrowSchema"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new ReadRowsResponse instance using the specified properties. * @function create @@ -2224,6 +2467,10 @@ $root.google.cloud.bigquery.storage.v1.ThrottleState.encode(message.throttleState, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) writer.uint32(/* id 6, wireType 0 =*/48).int64(message.rowCount); + if (message.avroSchema != null && Object.hasOwnProperty.call(message, "avroSchema")) + $root.google.cloud.bigquery.storage.v1.AvroSchema.encode(message.avroSchema, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.arrowSchema != null && Object.hasOwnProperty.call(message, "arrowSchema")) + $root.google.cloud.bigquery.storage.v1.ArrowSchema.encode(message.arrowSchema, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -2273,6 +2520,12 @@ case 5: message.throttleState = $root.google.cloud.bigquery.storage.v1.ThrottleState.decode(reader, reader.uint32()); break; + case 7: + message.avroSchema = $root.google.cloud.bigquery.storage.v1.AvroSchema.decode(reader, reader.uint32()); + break; + case 8: + message.arrowSchema = $root.google.cloud.bigquery.storage.v1.ArrowSchema.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -2340,6 +2593,24 @@ if (error) return "throttleState." + error; } + if (message.avroSchema != null && message.hasOwnProperty("avroSchema")) { + properties.schema = 1; + { + var error = $root.google.cloud.bigquery.storage.v1.AvroSchema.verify(message.avroSchema); + if (error) + return "avroSchema." + error; + } + } + if (message.arrowSchema != null && message.hasOwnProperty("arrowSchema")) { + if (properties.schema === 1) + return "schema: multiple values"; + properties.schema = 1; + { + var error = $root.google.cloud.bigquery.storage.v1.ArrowSchema.verify(message.arrowSchema); + if (error) + return "arrowSchema." + error; + } + } return null; }; @@ -2384,6 +2655,16 @@ throw TypeError(".google.cloud.bigquery.storage.v1.ReadRowsResponse.throttleState: object expected"); message.throttleState = $root.google.cloud.bigquery.storage.v1.ThrottleState.fromObject(object.throttleState); } + if (object.avroSchema != null) { + if (typeof object.avroSchema !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ReadRowsResponse.avroSchema: object expected"); + message.avroSchema = $root.google.cloud.bigquery.storage.v1.AvroSchema.fromObject(object.avroSchema); + } + if (object.arrowSchema != null) { + if (typeof object.arrowSchema !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ReadRowsResponse.arrowSchema: object expected"); + message.arrowSchema = $root.google.cloud.bigquery.storage.v1.ArrowSchema.fromObject(object.arrowSchema); + } return message; }; @@ -2428,6 +2709,16 @@ object.rowCount = options.longs === String ? String(message.rowCount) : message.rowCount; else object.rowCount = options.longs === String ? $util.Long.prototype.toString.call(message.rowCount) : options.longs === Number ? new $util.LongBits(message.rowCount.low >>> 0, message.rowCount.high >>> 0).toNumber() : message.rowCount; + if (message.avroSchema != null && message.hasOwnProperty("avroSchema")) { + object.avroSchema = $root.google.cloud.bigquery.storage.v1.AvroSchema.toObject(message.avroSchema, options); + if (options.oneofs) + object.schema = "avroSchema"; + } + if (message.arrowSchema != null && message.hasOwnProperty("arrowSchema")) { + object.arrowSchema = $root.google.cloud.bigquery.storage.v1.ArrowSchema.toObject(message.arrowSchema, options); + if (options.oneofs) + object.schema = "arrowSchema"; + } return object; }; @@ -3544,6 +3835,7 @@ * @interface ITableReadOptions * @property {Array.|null} [selectedFields] TableReadOptions selectedFields * @property {string|null} [rowRestriction] TableReadOptions rowRestriction + * @property {google.cloud.bigquery.storage.v1.IArrowSerializationOptions|null} [arrowSerializationOptions] TableReadOptions arrowSerializationOptions */ /** @@ -3578,6 +3870,28 @@ */ TableReadOptions.prototype.rowRestriction = ""; + /** + * TableReadOptions arrowSerializationOptions. + * @member {google.cloud.bigquery.storage.v1.IArrowSerializationOptions|null|undefined} arrowSerializationOptions + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @instance + */ + TableReadOptions.prototype.arrowSerializationOptions = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TableReadOptions outputFormatSerializationOptions. + * @member {"arrowSerializationOptions"|undefined} outputFormatSerializationOptions + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @instance + */ + Object.defineProperty(TableReadOptions.prototype, "outputFormatSerializationOptions", { + get: $util.oneOfGetter($oneOfFields = ["arrowSerializationOptions"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new TableReadOptions instance using the specified properties. * @function create @@ -3607,6 +3921,8 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectedFields[i]); if (message.rowRestriction != null && Object.hasOwnProperty.call(message, "rowRestriction")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.rowRestriction); + if (message.arrowSerializationOptions != null && Object.hasOwnProperty.call(message, "arrowSerializationOptions")) + $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.encode(message.arrowSerializationOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -3649,6 +3965,9 @@ case 2: message.rowRestriction = reader.string(); break; + case 3: + message.arrowSerializationOptions = $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -3684,6 +4003,7 @@ TableReadOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.selectedFields != null && message.hasOwnProperty("selectedFields")) { if (!Array.isArray(message.selectedFields)) return "selectedFields: array expected"; @@ -3694,6 +4014,14 @@ if (message.rowRestriction != null && message.hasOwnProperty("rowRestriction")) if (!$util.isString(message.rowRestriction)) return "rowRestriction: string expected"; + if (message.arrowSerializationOptions != null && message.hasOwnProperty("arrowSerializationOptions")) { + properties.outputFormatSerializationOptions = 1; + { + var error = $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.verify(message.arrowSerializationOptions); + if (error) + return "arrowSerializationOptions." + error; + } + } return null; }; @@ -3718,6 +4046,11 @@ } if (object.rowRestriction != null) message.rowRestriction = String(object.rowRestriction); + if (object.arrowSerializationOptions != null) { + if (typeof object.arrowSerializationOptions !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.arrowSerializationOptions: object expected"); + message.arrowSerializationOptions = $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.fromObject(object.arrowSerializationOptions); + } return message; }; @@ -3745,6 +4078,11 @@ } if (message.rowRestriction != null && message.hasOwnProperty("rowRestriction")) object.rowRestriction = message.rowRestriction; + if (message.arrowSerializationOptions != null && message.hasOwnProperty("arrowSerializationOptions")) { + object.arrowSerializationOptions = $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.toObject(message.arrowSerializationOptions, options); + if (options.oneofs) + object.outputFormatSerializationOptions = "arrowSerializationOptions"; + } return object; }; diff --git a/packages/google-cloud-bigquery-storage/protos/protos.json b/packages/google-cloud-bigquery-storage/protos/protos.json index e959d1cef26..5ed51835500 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.json +++ b/packages/google-cloud-bigquery-storage/protos/protos.json @@ -40,6 +40,22 @@ } } }, + "ArrowSerializationOptions": { + "fields": { + "bufferCompression": { + "type": "CompressionCodec", + "id": 2 + } + }, + "nested": { + "CompressionCodec": { + "values": { + "COMPRESSION_UNSPECIFIED": 0, + "LZ4_FRAME": 1 + } + } + } + }, "AvroSchema": { "fields": { "schema": { @@ -197,6 +213,12 @@ "avroRows", "arrowRecordBatch" ] + }, + "schema": { + "oneof": [ + "avroSchema", + "arrowSchema" + ] } }, "fields": { @@ -219,6 +241,20 @@ "throttleState": { "type": "ThrottleState", "id": 5 + }, + "avroSchema": { + "type": "AvroSchema", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "arrowSchema": { + "type": "ArrowSchema", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -347,6 +383,13 @@ } }, "TableReadOptions": { + "oneofs": { + "outputFormatSerializationOptions": { + "oneof": [ + "arrowSerializationOptions" + ] + } + }, "fields": { "selectedFields": { "rule": "repeated", @@ -356,6 +399,13 @@ "rowRestriction": { "type": "string", "id": 2 + }, + "arrowSerializationOptions": { + "type": "ArrowSerializationOptions", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } } diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata index b4392c2cc14..d7fca4f6a6b 100644 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ b/packages/google-cloud-bigquery-storage/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "2790786fb23c579b7a1ca7a3bdf91f375786f16e" + "sha": "abe5106d1faba875bc419693bc9ede1a0912f1e8" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5477122b3e8037a1dc5bc920536158edbd151dc4", - "internalRef": "361273630" + "sha": "c539b9b08b3366ee00c0ec1950f4df711552a269", + "internalRef": "365759522" } }, { From 9e67d3aaf0daebab37aa80dab32ac0236d166102 Mon Sep 17 00:00:00 2001 From: shollyman Date: Wed, 7 Apr 2021 11:13:45 -0700 Subject: [PATCH 100/182] docs: update region tag for BQ storage quickstart (#148) Tag prefix is incorrect, associating this to the wrong API. --- packages/google-cloud-bigquery-storage/samples/quickstart.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/samples/quickstart.js b/packages/google-cloud-bigquery-storage/samples/quickstart.js index 74fa5c7dfa2..481adc21785 100644 --- a/packages/google-cloud-bigquery-storage/samples/quickstart.js +++ b/packages/google-cloud-bigquery-storage/samples/quickstart.js @@ -19,7 +19,7 @@ // description: Read data from a table via read stream. // usage: node quickstart.js async function main() { - // [START bigquery_storage_quickstart] + // [START bigquerystorage_quickstart] // The read stream contains blocks of Avro-encoded bytes. We use the // 'avsc' library to decode these blocks. Install avsc with the following @@ -137,7 +137,7 @@ async function main() { console.log(`Last offset: ${offset}`); }); } - // [END bigquery_storage_quickstart] + // [END bigquerystorage_quickstart] bigqueryStorageQuickstart(); } From ee13953825f6886c1eae9f2daaa0f73ff6dbe93b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 14 Apr 2021 23:10:24 +0200 Subject: [PATCH 101/182] chore(deps): update dependency @types/sinon to v10 (#150) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/sinon](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^9.0.0` -> `^10.0.0`](https://renovatebot.com/diffs/npm/@types%2fsinon/9.0.11/10.0.0) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/compatibility-slim/9.0.11)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/confidence-slim/9.0.11)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-bigquery-storage). --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 9ae410a2959..6e8c8b0245d 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -34,7 +34,7 @@ "devDependencies": { "@types/mocha": "^8.0.0", "@types/node": "^13.7.1", - "@types/sinon": "^9.0.0", + "@types/sinon": "^10.0.0", "c8": "^7.1.0", "gts": "^2.0.0", "jsdoc": "^3.6.3", From a5ec5a7fee4e446a3a1c5c533af7c6a12a29ab7c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Apr 2021 00:56:43 +0200 Subject: [PATCH 102/182] chore(deps): update dependency ts-loader to v9 (#153) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ts-loader](https://togithub.com/TypeStrong/ts-loader) | [`^8.0.0` -> `^9.0.0`](https://renovatebot.com/diffs/npm/ts-loader/8.1.0/9.0.0) | [![age](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/compatibility-slim/8.1.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/confidence-slim/8.1.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
TypeStrong/ts-loader ### [`v9.0.0`](https://togithub.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md#v900) [Compare Source](https://togithub.com/TypeStrong/ts-loader/compare/v8.1.0...v9.0.0) Breaking changes: - minimum webpack version: 5 - minimum node version: 12 Changes: - [webpack 5 migration](https://togithub.com/TypeStrong/ts-loader/pull/1251) - thanks [@​johnnyreilly](https://togithub.com/johnnyreilly), [@​jonwallsten](https://togithub.com/jonwallsten), [@​sokra](https://togithub.com/sokra), [@​appzuka](https://togithub.com/appzuka), [@​alexander-akait](https://togithub.com/alexander-akait)
--- ### Configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-bigquery-storage). --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 6e8c8b0245d..8d18b642d4c 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -45,7 +45,7 @@ "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^10.0.0", - "ts-loader": "^8.0.0", + "ts-loader": "^9.0.0", "typescript": "^3.8.3", "webpack": "^5.0.0", "webpack-cli": "^4.0.0", From d2ccb0aa50960fc4f1e897695500a144ae9f184c Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Tue, 20 Apr 2021 10:35:37 -0700 Subject: [PATCH 103/182] chore: migrate to owl bot (#154) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: migrate to owl bot * chore: copy files from googleapis-gen e0ea8b51f30e2ff6104abd1e4c8d1eb67078c86a * chore: run the post processor * 🦉 Updates from OwlBot Co-authored-by: Owl Bot --- .../.github/.OwlBot.yaml | 30 ++++++++++++ .../.repo-metadata.json | 17 +++---- .../{synth.py => owlbot.py} | 22 ++------- .../synth.metadata | 46 ------------------- 4 files changed, 43 insertions(+), 72 deletions(-) create mode 100644 packages/google-cloud-bigquery-storage/.github/.OwlBot.yaml rename packages/google-cloud-bigquery-storage/{synth.py => owlbot.py} (51%) delete mode 100644 packages/google-cloud-bigquery-storage/synth.metadata diff --git a/packages/google-cloud-bigquery-storage/.github/.OwlBot.yaml b/packages/google-cloud-bigquery-storage/.github/.OwlBot.yaml new file mode 100644 index 00000000000..52a82ebed51 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/.github/.OwlBot.yaml @@ -0,0 +1,30 @@ +# 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-preserve-regex: + - /owl-bot-staging/v1alpha2 + - /owl-bot-staging/v1beta2 + + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/bigquery/storage/(v.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 + +begin-after-commit-hash: e0ea8b51f30e2ff6104abd1e4c8d1eb67078c86a + diff --git a/packages/google-cloud-bigquery-storage/.repo-metadata.json b/packages/google-cloud-bigquery-storage/.repo-metadata.json index 1c173eeacf9..aa908c00509 100644 --- a/packages/google-cloud-bigquery-storage/.repo-metadata.json +++ b/packages/google-cloud-bigquery-storage/.repo-metadata.json @@ -1,14 +1,15 @@ { - "name": "bigquerystorage", - "name_pretty": "Google BigQuery Storage", - "product_documentation": "https://cloud.google.com/bigquery/docs/reference/storage", - "client_documentation": "https://googleapis.dev/nodejs/bigquerystorage/latest", - "issue_tracker": "https://b.corp.google.com/savedsearches/559654", + "distribution_name": "@google-cloud/bigquery-storage", "release_level": "ga", - "language": "nodejs", + "product_documentation": "https://cloud.google.com/bigquery/docs/reference/storage", "repo": "googleapis/nodejs-bigquery-storage", - "distribution_name": "@google-cloud/bigquery-storage", - "api_id": "bigquerystorage.googleapis.com", + "default_version": "v1", + "language": "nodejs", "requires_billing": true, + "issue_tracker": "https://b.corp.google.com/savedsearches/559654", + "client_documentation": "https://googleapis.dev/nodejs/bigquerystorage/latest", + "name": "bigquerystorage", + "name_pretty": "Google BigQuery Storage", + "api_id": "bigquerystorage.googleapis.com", "codeowner_team": "@googleapis/api-bigquery" } diff --git a/packages/google-cloud-bigquery-storage/synth.py b/packages/google-cloud-bigquery-storage/owlbot.py similarity index 51% rename from packages/google-cloud-bigquery-storage/synth.py rename to packages/google-cloud-bigquery-storage/owlbot.py index 1cb8ff00d59..44b15e78f18 100644 --- a/packages/google-cloud-bigquery-storage/synth.py +++ b/packages/google-cloud-bigquery-storage/owlbot.py @@ -12,23 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. """This script is used to synthesize generated parts of this library.""" -import synthtool as s -import synthtool.gcp as gcp import synthtool.languages.node as node -import logging -logging.basicConfig(level=logging.DEBUG) -AUTOSYNTH_MULTIPLE_COMMITS = True - -# Run the gapic generator -gapic = gcp.GAPICBazel() -name = 'bigquery-storage' -versions = ['v1beta1', 'v1'] -for version in versions: - library = gapic.node_library(name, version, proto_path=f'google/cloud/bigquery/storage/{version}') - s.copy(library, excludes=['package.json', 'README.md', 'src/index.ts']) -# Copy common templates -common_templates = gcp.CommonTemplates() -templates = common_templates.node_library(source_location='build/src') -s.copy(templates, excludes=[]) -node.postprocess_gapic_library() +node.owlbot_main( + staging_excludes=['package.json', 'README.md', 'src/index.ts'], + templates_excludes=['src/index.ts'] +) diff --git a/packages/google-cloud-bigquery-storage/synth.metadata b/packages/google-cloud-bigquery-storage/synth.metadata deleted file mode 100644 index d7fca4f6a6b..00000000000 --- a/packages/google-cloud-bigquery-storage/synth.metadata +++ /dev/null @@ -1,46 +0,0 @@ -{ - "sources": [ - { - "git": { - "name": ".", - "remote": "https://github.com/googleapis/nodejs-bigquery-storage.git", - "sha": "abe5106d1faba875bc419693bc9ede1a0912f1e8" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c539b9b08b3366ee00c0ec1950f4df711552a269", - "internalRef": "365759522" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "57c23fa5705499a4181095ced81f0ee0933b64f6" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "bigquery-storage", - "apiVersion": "v1beta1", - "language": "nodejs", - "generator": "bazel" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "bigquery-storage", - "apiVersion": "v1", - "language": "nodejs", - "generator": "bazel" - } - } - ] -} \ No newline at end of file From 095a30b9f3f0a1b6ce7036132a5fc5eab8bcb0d2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 28 Apr 2021 23:28:40 +0000 Subject: [PATCH 104/182] chore: release 2.4.0 (#146) :robot: I have created a release \*beep\* \*boop\* --- ## [2.4.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.3.0...v2.4.0) (2021-04-20) ### Features * add a Arrow compression options (Only LZ4 for now). ([cd23105](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/cd23105fff40a870888ca4a8608d1b85ed6b3639)) * Return schema on first ReadRowsResponse ([cd23105](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/cd23105fff40a870888ca4a8608d1b85ed6b3639)) --- 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-storage/CHANGELOG.md | 8 ++++++++ packages/google-cloud-bigquery-storage/package.json | 2 +- .../google-cloud-bigquery-storage/samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md index 00c433bccd8..3e803182fad 100644 --- a/packages/google-cloud-bigquery-storage/CHANGELOG.md +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [2.4.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.3.0...v2.4.0) (2021-04-20) + + +### Features + +* add a Arrow compression options (Only LZ4 for now). ([cd23105](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/cd23105fff40a870888ca4a8608d1b85ed6b3639)) +* Return schema on first ReadRowsResponse ([cd23105](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/cd23105fff40a870888ca4a8608d1b85ed6b3639)) + ## [2.3.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.2.3...v2.3.0) (2021-01-09) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 8d18b642d4c..7dba8e80b7d 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "2.3.0", + "version": "2.4.0", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index 8b6433fca67..6dff5c3b325 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^2.3.0", + "@google-cloud/bigquery-storage": "^2.4.0", "avsc": "^5.4.18", "snappy": "^6.2.3" }, From 909bbe9330288a5c0187c34fd16a94103424ff21 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 6 May 2021 17:49:02 -0700 Subject: [PATCH 105/182] fix(deps): require google-gax v2.12.0 (#158) --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 7dba8e80b7d..9765cde94ea 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -29,7 +29,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 4d36a113dfc7342cbd23b763ff15fcfd85f95fb3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 10 May 2021 17:00:46 +0000 Subject: [PATCH 106/182] chore: new owl bot post processor docker image (#160) gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:f93bb861d6f12574437bb9aee426b71eafd63b419669ff0ed029f4b7e7162e3f --- .../protos/protos.d.ts | 10 +-- .../protos/protos.js | 20 +++--- .../src/v1/big_query_read_client.ts | 42 ++++++------- .../src/v1beta1/big_query_storage_client.ts | 62 +++++++++---------- .../test/gapic_big_query_read_v1.ts | 17 +++-- .../test/gapic_big_query_storage_v1beta1.ts | 32 ++++------ 6 files changed, 84 insertions(+), 99 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/protos/protos.d.ts b/packages/google-cloud-bigquery-storage/protos/protos.d.ts index 619dc695897..4ab3a82b13b 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-storage/protos/protos.d.ts @@ -4197,19 +4197,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-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index 6f315f5ffad..a948d7dd4df 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/protos/protos.js @@ -9799,43 +9799,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-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index a5d7db865c2..f25c074a4f8 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -230,13 +230,14 @@ export class BigQueryReadClient { ]; for (const methodName of bigQueryReadStubMethods) { const callPromise = this.bigQueryReadStub.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; } @@ -432,11 +433,10 @@ export class BigQueryReadClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'read_session.table': request.readSession!.table || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'read_session.table': request.readSession!.table || '', + }); this.initialize(); return this.innerApiCalls.createReadSession(request, options, callback); } @@ -549,11 +549,10 @@ export class BigQueryReadClient { 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.splitReadStream(request, options, callback); } @@ -595,11 +594,10 @@ export class BigQueryReadClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - read_stream: request.readStream || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + read_stream: request.readStream || '', + }); this.initialize(); return this.innerApiCalls.readRows(request, options); } diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index da6f81c04e4..4defcb909f4 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -233,13 +233,14 @@ export class BigQueryStorageClient { ]; for (const methodName of bigQueryStorageStubMethods) { const callPromise = this.bigQueryStorageStub.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; } @@ -437,12 +438,11 @@ export class BigQueryStorageClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'table_reference.project_id': request.tableReference!.projectId || '', - 'table_reference.dataset_id': request.tableReference!.datasetId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'table_reference.project_id': request.tableReference!.projectId || '', + 'table_reference.dataset_id': request.tableReference!.datasetId || '', + }); this.initialize(); return this.innerApiCalls.createReadSession(request, options, callback); } @@ -543,11 +543,10 @@ export class BigQueryStorageClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'session.name': request.session!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'session.name': request.session!.name || '', + }); this.initialize(); return this.innerApiCalls.batchCreateReadSessionStreams( request, @@ -658,11 +657,10 @@ export class BigQueryStorageClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'stream.name': request.stream!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'stream.name': request.stream!.name || '', + }); this.initialize(); return this.innerApiCalls.finalizeStream(request, options, callback); } @@ -776,11 +774,10 @@ export class BigQueryStorageClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'original_stream.name': request.originalStream!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'original_stream.name': request.originalStream!.name || '', + }); this.initialize(); return this.innerApiCalls.splitReadStream(request, options, callback); } @@ -822,11 +819,10 @@ export class BigQueryStorageClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'read_position.stream.name': request.readPosition!.stream!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'read_position.stream.name': request.readPosition!.stream!.name || '', + }); this.initialize(); return this.innerApiCalls.readRows(request, options); } diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts index 6d69543ebaf..e7feeb4724d 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_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; @@ -209,9 +208,8 @@ describe('v1.BigQueryReadClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.ReadSession() ); - client.innerApiCalls.createReadSession = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createReadSession = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createReadSession( request, @@ -322,9 +320,8 @@ describe('v1.BigQueryReadClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.SplitReadStreamResponse() ); - client.innerApiCalls.splitReadStream = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.splitReadStream = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.splitReadStream( request, diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts index 471cebc8ec7..b4821b15682 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.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; @@ -217,9 +216,8 @@ describe('v1beta1.BigQueryStorageClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.ReadSession() ); - client.innerApiCalls.createReadSession = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createReadSession = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createReadSession( request, @@ -303,9 +301,8 @@ describe('v1beta1.BigQueryStorageClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse() ); - client.innerApiCalls.batchCreateReadSessionStreams = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.batchCreateReadSessionStreams = + stubSimpleCall(expectedResponse); const [response] = await client.batchCreateReadSessionStreams(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -337,9 +334,8 @@ describe('v1beta1.BigQueryStorageClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse() ); - client.innerApiCalls.batchCreateReadSessionStreams = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.batchCreateReadSessionStreams = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.batchCreateReadSessionStreams( request, @@ -455,9 +451,8 @@ describe('v1beta1.BigQueryStorageClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.finalizeStream = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.finalizeStream = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.finalizeStream( request, @@ -570,9 +565,8 @@ describe('v1beta1.BigQueryStorageClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse() ); - client.innerApiCalls.splitReadStream = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.splitReadStream = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.splitReadStream( request, From 7f328c515e4bfe6ba1b84a5ad4e491f758352dc2 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:58:13 +0000 Subject: [PATCH 107/182] fix: use require() to load JSON protos (#161) 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/big_query_read_client.ts | 18 ++---------------- .../src/v1beta1/big_query_storage_client.ts | 18 ++---------------- 2 files changed, 4 insertions(+), 32 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index f25c074a4f8..02d1095fa44 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -22,6 +22,7 @@ import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; import * as path from 'path'; import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); /** * Client JSON configuration object, loaded from * `src/v1/big_query_read_client_config.json`. @@ -138,22 +139,7 @@ export class BigQueryReadClient { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath - ); + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index 4defcb909f4..d779c6da55c 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -22,6 +22,7 @@ import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; import * as path from 'path'; import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); /** * Client JSON configuration object, loaded from * `src/v1beta1/big_query_storage_client_config.json`. @@ -138,22 +139,7 @@ export class BigQueryStorageClient { 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 908534059adbf9f7ff3cc832952f8a11c9dc52a8 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 108/182] chore: update gapic-generator-typescript to v1.3.2 (#162) 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/big_query_read_client.ts | 1 - .../src/v1beta1/big_query_storage_client.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index 02d1095fa44..2fb656b8d20 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -19,7 +19,6 @@ /* global window */ import * as gax from 'google-gax'; import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; -import * as path from 'path'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index d779c6da55c..6cc1ecb78e6 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -19,7 +19,6 @@ /* global window */ import * as gax from 'google-gax'; import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; -import * as path from 'path'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); From 7ab7c805d89228de58f5e9f9f2e74965841819de Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 17 May 2021 11:01:03 -0700 Subject: [PATCH 109/182] feat: Add ZSTD compression as an option for Arrow. (#165) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add ZSTD compression as an option for Arrow. Committer: @emkornfield PiperOrigin-RevId: 374220891 Source-Link: https://github.com/googleapis/googleapis/commit/23efea9fc7bedfe53b24295ed84b5f873606edcb Source-Link: https://github.com/googleapis/googleapis-gen/commit/79c15da3a71c276e23aa2746f9fa243741763179 * 🦉 Updates from OwlBot Co-authored-by: Owl Bot --- .../cloud/bigquery/storage/v1/arrow.proto | 3 +++ .../cloud/bigquery/storage/v1/storage.proto | 6 ++--- .../cloud/bigquery/storage/v1/stream.proto | 22 +++++++++---------- .../protos/protos.d.ts | 3 ++- .../protos/protos.js | 7 ++++++ .../protos/protos.json | 3 ++- 6 files changed, 26 insertions(+), 18 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/arrow.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/arrow.proto index 4b240f52139..514b77e617c 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/arrow.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/arrow.proto @@ -52,6 +52,9 @@ message ArrowSerializationOptions { // LZ4 Frame (https://github.com/lz4/lz4/blob/dev/doc/lz4_Frame_format.md) LZ4_FRAME = 1; + + // Zstandard compression. + ZSTD = 2; } // The compression codec to use for Arrow buffers in serialized record diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto index a5fa2b9eb86..8ac56375044 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto @@ -69,8 +69,7 @@ service BigQueryRead { post: "/v1/{read_session.table=projects/*/datasets/*/tables/*}" body: "*" }; - option (google.api.method_signature) = - "parent,read_session,max_stream_count"; + option (google.api.method_signature) = "parent,read_session,max_stream_count"; } // Reads rows from the stream in the format prescribed by the ReadSession. @@ -99,8 +98,7 @@ service BigQueryRead { // original, primary, and residual, that original[0-j] = primary[0-j] and // original[j-n] = residual[0-m] once the streams have been read to // completion. - rpc SplitReadStream(SplitReadStreamRequest) - returns (SplitReadStreamResponse) { + rpc SplitReadStream(SplitReadStreamRequest) returns (SplitReadStreamResponse) { option (google.api.http) = { get: "/v1/{name=projects/*/locations/*/sessions/*/streams/*}" }; diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto index 28b2ac1bbf3..291cf4115bc 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto @@ -75,10 +75,9 @@ message ReadSession { // Restricted to a maximum length for 1 MB. string row_restriction = 2; - // Optional. Options specific to the Apache Arrow output format. oneof output_format_serialization_options { - ArrowSerializationOptions arrow_serialization_options = 3 - [(google.api.field_behavior) = OPTIONAL]; + // Optional. Options specific to the Apache Arrow output format. + ArrowSerializationOptions arrow_serialization_options = 3 [(google.api.field_behavior) = OPTIONAL]; } } @@ -86,12 +85,10 @@ message ReadSession { // `projects/{project_id}/locations/{location}/sessions/{session_id}`. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Time at which the session becomes invalid. After this time, - // subsequent requests to read this Session will return errors. The - // expire_time is automatically assigned and currently cannot be specified or - // updated. - google.protobuf.Timestamp expire_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Time at which the session becomes invalid. After this time, subsequent + // requests to read this Session will return errors. The expire_time is + // automatically assigned and currently cannot be specified or updated. + google.protobuf.Timestamp expire_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; // Immutable. Data format of the output data. DataFormat data_format = 3 [(google.api.field_behavior) = IMMUTABLE]; @@ -111,11 +108,12 @@ message ReadSession { // `projects/{project_id}/datasets/{dataset_id}/tables/{table_id}` string table = 6 [ (google.api.field_behavior) = IMMUTABLE, - (google.api.resource_reference) = { type: "bigquery.googleapis.com/Table" } + (google.api.resource_reference) = { + type: "bigquery.googleapis.com/Table" + } ]; - // Optional. Any modifiers which are applied when reading from the specified - // table. + // Optional. Any modifiers which are applied when reading from the specified table. TableModifiers table_modifiers = 7 [(google.api.field_behavior) = OPTIONAL]; // Optional. Read options for this session (e.g. column selection, filters). diff --git a/packages/google-cloud-bigquery-storage/protos/protos.d.ts b/packages/google-cloud-bigquery-storage/protos/protos.d.ts index 4ab3a82b13b..fea18b2d33b 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-storage/protos/protos.d.ts @@ -310,7 +310,8 @@ export namespace google { /** CompressionCodec enum. */ enum CompressionCodec { COMPRESSION_UNSPECIFIED = 0, - LZ4_FRAME = 1 + LZ4_FRAME = 1, + ZSTD = 2 } } diff --git a/packages/google-cloud-bigquery-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index a948d7dd4df..4ead87bfb66 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/protos/protos.js @@ -640,6 +640,7 @@ return "bufferCompression: enum value expected"; case 0: case 1: + case 2: break; } return null; @@ -666,6 +667,10 @@ case 1: message.bufferCompression = 1; break; + case "ZSTD": + case 2: + message.bufferCompression = 2; + break; } return message; }; @@ -707,11 +712,13 @@ * @enum {number} * @property {number} COMPRESSION_UNSPECIFIED=0 COMPRESSION_UNSPECIFIED value * @property {number} LZ4_FRAME=1 LZ4_FRAME value + * @property {number} ZSTD=2 ZSTD value */ ArrowSerializationOptions.CompressionCodec = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "COMPRESSION_UNSPECIFIED"] = 0; values[valuesById[1] = "LZ4_FRAME"] = 1; + values[valuesById[2] = "ZSTD"] = 2; return values; })(); diff --git a/packages/google-cloud-bigquery-storage/protos/protos.json b/packages/google-cloud-bigquery-storage/protos/protos.json index 5ed51835500..6a76834bc84 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.json +++ b/packages/google-cloud-bigquery-storage/protos/protos.json @@ -51,7 +51,8 @@ "CompressionCodec": { "values": { "COMPRESSION_UNSPECIFIED": 0, - "LZ4_FRAME": 1 + "LZ4_FRAME": 1, + "ZSTD": 2 } } } From d3f8ab8a3ad18fbe680dd40a1a24aebac93a2ea7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 21 May 2021 19:06:19 +0200 Subject: [PATCH 110/182] chore(deps): update dependency @types/node to v14 (#169) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^13.7.1` -> `^14.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/13.13.52/14.17.0) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/compatibility-slim/13.13.52)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/confidence-slim/13.13.52)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻️ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-bigquery-storage). --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 9765cde94ea..9b9f6280e25 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -33,7 +33,7 @@ }, "devDependencies": { "@types/mocha": "^8.0.0", - "@types/node": "^13.7.1", + "@types/node": "^14.0.0", "@types/sinon": "^10.0.0", "c8": "^7.1.0", "gts": "^2.0.0", From 67d44d30685c285afd8fb54207a9981e2a35df0a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 25 May 2021 17:58:23 +0200 Subject: [PATCH 111/182] chore(deps): update dependency sinon to v11 (#170) 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-storage). --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 9b9f6280e25..36bbc54cf92 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -44,7 +44,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^10.0.0", + "sinon": "^11.0.0", "ts-loader": "^9.0.0", "typescript": "^3.8.3", "webpack": "^5.0.0", From 2f78e96d4ccf32246c05bff7fc8c84476eaafa0b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 25 May 2021 20:48:56 +0000 Subject: [PATCH 112/182] fix: GoogleAdsError missing using generator version after 1.3.0 (#171) [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/big_query_read_client.ts | 2 ++ .../src/v1beta1/big_query_storage_client.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index 2fb656b8d20..ceeb38bd118 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -133,6 +133,8 @@ export class BigQueryReadClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index 6cc1ecb78e6..125c0224618 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -133,6 +133,8 @@ export class BigQueryStorageClient { } 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 8b680e41944c0d027747ffce49672ab219c9d11b 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:24:49 -0700 Subject: [PATCH 113/182] chore: release 2.5.0 (#166) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- .../google-cloud-bigquery-storage/CHANGELOG.md | 14 ++++++++++++++ .../google-cloud-bigquery-storage/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md index 3e803182fad..81243e9ac06 100644 --- a/packages/google-cloud-bigquery-storage/CHANGELOG.md +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [2.5.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.4.0...v2.5.0) (2021-06-07) + + +### Features + +* Add ZSTD compression as an option for Arrow. ([#165](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/165)) ([dc5a1d0](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/dc5a1d00f92f09dafbf0d3b1a9bf5ea4b5c43103)) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#158](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/158)) ([3347edd](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/3347edd3781d7a37ae6a50b0d6885365bc2e4b2f)) +* GoogleAdsError missing using generator version after 1.3.0 ([#171](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/171)) ([8504761](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/850476101d06f4c3f903fb10ebb6709c1a6ffa95)) +* use require() to load JSON protos ([#161](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/161)) ([a16129f](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/a16129f7a56882e3070fa79f29b8b6018e7cd651)) + ## [2.4.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.3.0...v2.4.0) (2021-04-20) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 36bbc54cf92..f0bff04eb1f 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "2.4.0", + "version": "2.5.0", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index 6dff5c3b325..398c771890a 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^2.4.0", + "@google-cloud/bigquery-storage": "^2.5.0", "avsc": "^5.4.18", "snappy": "^6.2.3" }, From a19c06348032312447d990a42b87a76de79b057b Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Thu, 10 Jun 2021 23:02:22 +0200 Subject: [PATCH 114/182] chore(nodejs): remove api-extractor dependencies (#177) --- packages/google-cloud-bigquery-storage/package.json | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index f0bff04eb1f..c578fd7a92e 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -24,9 +24,7 @@ "system-test": "c8 mocha build/system-test", "test": "c8 mocha build/test", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "precompile": "gts clean", - "api-extractor": "api-extractor run --local", - "api-documenter": "api-documenter yaml --input-folder=temp" + "precompile": "gts clean" }, "dependencies": { "google-gax": "^2.12.0" @@ -48,9 +46,7 @@ "ts-loader": "^9.0.0", "typescript": "^3.8.3", "webpack": "^5.0.0", - "webpack-cli": "^4.0.0", - "@microsoft/api-documenter": "^7.8.10", - "@microsoft/api-extractor": "^7.8.10" + "webpack-cli": "^4.0.0" }, "engines": { "node": ">=10" From faa8c61c0a6792eb30e8451941bea289052c14c2 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 22 Jun 2021 20:22:40 +0000 Subject: [PATCH 115/182] fix: make request optional in all cases (#179) ... 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/big_query_read_client.ts | 8 ++++---- .../src/v1beta1/big_query_storage_client.ts | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index ceeb38bd118..6083fd59502 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -301,7 +301,7 @@ export class BigQueryReadClient { // -- Service calls -- // ------------------- createReadSession( - request: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, + request?: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, options?: CallOptions ): Promise< [ @@ -382,7 +382,7 @@ export class BigQueryReadClient { * const [response] = await client.createReadSession(request); */ createReadSession( - request: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, + request?: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, optionsOrCallback?: | CallOptions | Callback< @@ -428,7 +428,7 @@ export class BigQueryReadClient { return this.innerApiCalls.createReadSession(request, options, callback); } splitReadStream( - request: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, + request?: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, options?: CallOptions ): Promise< [ @@ -498,7 +498,7 @@ export class BigQueryReadClient { * const [response] = await client.splitReadStream(request); */ splitReadStream( - request: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, + request?: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, optionsOrCallback?: | CallOptions | Callback< diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index 125c0224618..3168b16488b 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -304,7 +304,7 @@ export class BigQueryStorageClient { // -- Service calls -- // ------------------- createReadSession( - request: protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, + request?: protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, options?: CallOptions ): Promise< [ @@ -387,7 +387,7 @@ export class BigQueryStorageClient { * const [response] = await client.createReadSession(request); */ createReadSession( - request: protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, + request?: protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, optionsOrCallback?: | CallOptions | Callback< @@ -434,7 +434,7 @@ export class BigQueryStorageClient { return this.innerApiCalls.createReadSession(request, options, callback); } batchCreateReadSessionStreams( - request: protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, + request?: protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, options?: CallOptions ): Promise< [ @@ -492,7 +492,7 @@ export class BigQueryStorageClient { * const [response] = await client.batchCreateReadSessionStreams(request); */ batchCreateReadSessionStreams( - request: protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, + request?: protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, optionsOrCallback?: | CallOptions | Callback< @@ -542,7 +542,7 @@ export class BigQueryStorageClient { ); } finalizeStream( - request: protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, + request?: protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, options?: CallOptions ): Promise< [ @@ -606,7 +606,7 @@ export class BigQueryStorageClient { * const [response] = await client.finalizeStream(request); */ finalizeStream( - request: protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, + request?: protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, optionsOrCallback?: | CallOptions | Callback< @@ -652,7 +652,7 @@ export class BigQueryStorageClient { return this.innerApiCalls.finalizeStream(request, options, callback); } splitReadStream( - request: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, + request?: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, options?: CallOptions ): Promise< [ @@ -723,7 +723,7 @@ export class BigQueryStorageClient { * const [response] = await client.splitReadStream(request); */ splitReadStream( - request: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, + request?: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, optionsOrCallback?: | CallOptions | Callback< From 999f8e6c6323c43a4123dd84f983d5051e5ef603 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 22 Jun 2021 20:46:46 +0000 Subject: [PATCH 116/182] chore: release 2.5.1 (#180) :robot: I have created a release \*beep\* \*boop\* --- ### [2.5.1](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.5.0...v2.5.1) (2021-06-22) ### Bug Fixes * make request optional in all cases ([#179](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/179)) ([b0beaaa](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/b0beaaa280e7599f75e0a439f4ecd4a9a6c059ad)) --- 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-storage/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-storage/package.json | 2 +- .../google-cloud-bigquery-storage/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md index 81243e9ac06..41d98417af1 100644 --- a/packages/google-cloud-bigquery-storage/CHANGELOG.md +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.5.1](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.5.0...v2.5.1) (2021-06-22) + + +### Bug Fixes + +* make request optional in all cases ([#179](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/179)) ([b0beaaa](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/b0beaaa280e7599f75e0a439f4ecd4a9a6c059ad)) + ## [2.5.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.4.0...v2.5.0) (2021-06-07) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index c578fd7a92e..12cdea86558 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "2.5.0", + "version": "2.5.1", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index 398c771890a..0b30018fd0c 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^2.5.0", + "@google-cloud/bigquery-storage": "^2.5.1", "avsc": "^5.4.18", "snappy": "^6.2.3" }, From 084e3f4648a9090d68e1f03959219df4f9b2835a Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 29 Jun 2021 11:24:53 -0400 Subject: [PATCH 117/182] fix(deps): google-gax v2.17.0 with mTLS (#185) --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 12cdea86558..969bef6e40f 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -27,7 +27,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^2.12.0" + "google-gax": "^2.17.0" }, "devDependencies": { "@types/mocha": "^8.0.0", From fb2f9c191b73dcf65ef54d1f571171a7e5360686 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:10:30 +0000 Subject: [PATCH 118/182] chore: release 2.5.2 (#186) :robot: I have created a release \*beep\* \*boop\* --- ### [2.5.2](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.5.1...v2.5.2) (2021-06-30) ### Bug Fixes * **deps:** google-gax v2.17.0 with mTLS ([#185](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/185)) ([1e9b856](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/1e9b8560cb3b60a60035c965ba1dabc24ad8f0c0)) --- 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-storage/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-storage/package.json | 2 +- .../google-cloud-bigquery-storage/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md index 41d98417af1..3923e5a09c7 100644 --- a/packages/google-cloud-bigquery-storage/CHANGELOG.md +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.5.2](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.5.1...v2.5.2) (2021-06-30) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#185](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/185)) ([1e9b856](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/1e9b8560cb3b60a60035c965ba1dabc24ad8f0c0)) + ### [2.5.1](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.5.0...v2.5.1) (2021-06-22) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 969bef6e40f..ce6d01ecc34 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "2.5.1", + "version": "2.5.2", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index 0b30018fd0c..8e1550fd994 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^2.5.1", + "@google-cloud/bigquery-storage": "^2.5.2", "avsc": "^5.4.18", "snappy": "^6.2.3" }, From 777bfba9b012423fe66a321d48138a46a9e5f978 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 12 Jul 2021 17:46:26 -0400 Subject: [PATCH 119/182] fix(deps): google-gax v2.17.1 (#188) --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index ce6d01ecc34..cdfdf19eea6 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -27,7 +27,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^2.17.0" + "google-gax": "^2.17.1" }, "devDependencies": { "@types/mocha": "^8.0.0", From 64ab512c365c258c2ccc14812c4b129a9b2a0a07 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:11 +0000 Subject: [PATCH 120/182] fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#190) 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/big_query_read_client.ts | 11 ++++++++++- .../src/v1beta1/big_query_storage_client.ts | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index 6083fd59502..92ff7ef13aa 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -41,6 +41,7 @@ const version = require('../../../package.json').version; export class BigQueryReadClient { 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: {}; @@ -52,6 +53,7 @@ export class BigQueryReadClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; bigQueryReadStub?: Promise<{[name: string]: Function}>; @@ -95,6 +97,9 @@ export class BigQueryReadClient { const staticMembers = this.constructor as typeof BigQueryReadClient; 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 = @@ -177,6 +182,9 @@ export class BigQueryReadClient { // 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; } /** @@ -205,7 +213,8 @@ export class BigQueryReadClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.bigquery.storage.v1.BigQueryRead, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index 3168b16488b..0f6da277a78 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -41,6 +41,7 @@ const version = require('../../../package.json').version; export class BigQueryStorageClient { 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: {}; @@ -52,6 +53,7 @@ export class BigQueryStorageClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; bigQueryStorageStub?: Promise<{[name: string]: Function}>; @@ -95,6 +97,9 @@ export class BigQueryStorageClient { const staticMembers = this.constructor as typeof BigQueryStorageClient; 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 = @@ -177,6 +182,9 @@ export class BigQueryStorageClient { // 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; } /** @@ -206,7 +214,8 @@ export class BigQueryStorageClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.bigquery.storage.v1beta1 .BigQueryStorage, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides From 0e631afa74bd4be62abc3aeb24133c809f9a79a2 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:12:19 +0000 Subject: [PATCH 121/182] chore: release 2.5.3 (#189) :robot: I have created a release \*beep\* \*boop\* --- ### [2.5.3](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.5.2...v2.5.3) (2021-07-21) ### Bug Fixes * **deps:** google-gax v2.17.1 ([#188](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/188)) ([e49f7ee](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/e49f7ee0413948779842b3b9d4faf5addc4c4db6)) * Updating WORKSPACE files to use the newest version of the Typescript generator. ([#190](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/190)) ([8649cc6](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/8649cc6ae0a4e6ae807ba9e5af438ca0ffc9592a)) --- 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-storage/CHANGELOG.md | 8 ++++++++ packages/google-cloud-bigquery-storage/package.json | 2 +- .../google-cloud-bigquery-storage/samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md index 3923e5a09c7..efed7f17eaf 100644 --- a/packages/google-cloud-bigquery-storage/CHANGELOG.md +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [2.5.3](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.5.2...v2.5.3) (2021-07-21) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#188](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/188)) ([e49f7ee](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/e49f7ee0413948779842b3b9d4faf5addc4c4db6)) +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#190](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/190)) ([8649cc6](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/8649cc6ae0a4e6ae807ba9e5af438ca0ffc9592a)) + ### [2.5.2](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.5.1...v2.5.2) (2021-06-30) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index cdfdf19eea6..778f9d3f85e 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "2.5.2", + "version": "2.5.3", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index 8e1550fd994..a998c15bd35 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^2.5.2", + "@google-cloud/bigquery-storage": "^2.5.3", "avsc": "^5.4.18", "snappy": "^6.2.3" }, From e307cb6cca0440fbc635439b544234b7fd596a4a Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Wed, 4 Aug 2021 16:02:20 -0400 Subject: [PATCH 122/182] chore(nodejs): update client ref docs link in metadata (#195) --- packages/google-cloud-bigquery-storage/.repo-metadata.json | 2 +- packages/google-cloud-bigquery-storage/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/.repo-metadata.json b/packages/google-cloud-bigquery-storage/.repo-metadata.json index aa908c00509..4283f1fbab0 100644 --- a/packages/google-cloud-bigquery-storage/.repo-metadata.json +++ b/packages/google-cloud-bigquery-storage/.repo-metadata.json @@ -7,7 +7,7 @@ "language": "nodejs", "requires_billing": true, "issue_tracker": "https://b.corp.google.com/savedsearches/559654", - "client_documentation": "https://googleapis.dev/nodejs/bigquerystorage/latest", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/bigquery-storage/latest", "name": "bigquerystorage", "name_pretty": "Google BigQuery Storage", "api_id": "bigquerystorage.googleapis.com", diff --git a/packages/google-cloud-bigquery-storage/README.md b/packages/google-cloud-bigquery-storage/README.md index c562b19865d..7e370998a22 100644 --- a/packages/google-cloud-bigquery-storage/README.md +++ b/packages/google-cloud-bigquery-storage/README.md @@ -249,7 +249,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-bigquery-storage/blob/master/LICENSE) -[client-docs]: https://googleapis.dev/nodejs/bigquerystorage/latest +[client-docs]: https://cloud.google.com/nodejs/docs/reference/bigquery-storage/latest [product-docs]: https://cloud.google.com/bigquery/docs/reference/storage [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project From 4e69a91a4c4a67a6f44b0625cb6fed5a3c7e96bb Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 16 Aug 2021 22:46:34 -0400 Subject: [PATCH 123/182] fix(deps): google-gax v2.24.1 (#198) --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 778f9d3f85e..97f3769f9de 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -27,7 +27,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^2.17.1" + "google-gax": "^2.24.1" }, "devDependencies": { "@types/mocha": "^8.0.0", From 24d9f10fc1600f19211c3f1ec98beeb7c3b1cf95 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 17 Aug 2021 17:18:26 +0000 Subject: [PATCH 124/182] chore: release 2.5.4 (#199) :robot: I have created a release \*beep\* \*boop\* --- ### [2.5.4](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.5.3...v2.5.4) (2021-08-17) ### Bug Fixes * **deps:** google-gax v2.24.1 ([#198](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/198)) ([c6f70de](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/c6f70de43641ee7a00237884cf3f40bbf1bed502)) --- 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-storage/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-storage/package.json | 2 +- .../google-cloud-bigquery-storage/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md index efed7f17eaf..10b37dcd48e 100644 --- a/packages/google-cloud-bigquery-storage/CHANGELOG.md +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.5.4](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.5.3...v2.5.4) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#198](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/198)) ([c6f70de](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/c6f70de43641ee7a00237884cf3f40bbf1bed502)) + ### [2.5.3](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.5.2...v2.5.3) (2021-07-21) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 97f3769f9de..cb9d938c24d 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "2.5.3", + "version": "2.5.4", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index a998c15bd35..80169c9f652 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^2.5.3", + "@google-cloud/bigquery-storage": "^2.5.4", "avsc": "^5.4.18", "snappy": "^6.2.3" }, From 1c76c394879282ea0c11a0ef9d55f06c5cdbb87e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 23 Aug 2021 18:32:27 +0000 Subject: [PATCH 125/182] feat: turns on self-signed JWT feature flag (#200) - [ ] 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/big_query_read_client.ts | 6 ++++++ .../src/v1beta1/big_query_storage_client.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index 92ff7ef13aa..5c84bf9eba5 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -124,6 +124,12 @@ export class BigQueryReadClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index 0f6da277a78..0ddad79167e 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -124,6 +124,12 @@ export class BigQueryStorageClient { // 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 6b1d155d209789c7b27637e3bb1af3de8e36a85d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 23 Aug 2021 18:56:26 +0000 Subject: [PATCH 126/182] chore: release 2.6.0 (#201) :robot: I have created a release \*beep\* \*boop\* --- ## [2.6.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.5.4...v2.6.0) (2021-08-23) ### Features * turns on self-signed JWT feature flag ([#200](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/200)) ([ef2206c](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/ef2206cf1087c23d144fbc4b50363efb4c6deab2)) --- 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-storage/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-storage/package.json | 2 +- .../google-cloud-bigquery-storage/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md index 10b37dcd48e..cc2931a657f 100644 --- a/packages/google-cloud-bigquery-storage/CHANGELOG.md +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.6.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.5.4...v2.6.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#200](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/200)) ([ef2206c](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/ef2206cf1087c23d144fbc4b50363efb4c6deab2)) + ### [2.5.4](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.5.3...v2.5.4) (2021-08-17) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index cb9d938c24d..a20863fe302 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "2.5.4", + "version": "2.6.0", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index 80169c9f652..93496cebfda 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^2.5.4", + "@google-cloud/bigquery-storage": "^2.6.0", "avsc": "^5.4.18", "snappy": "^6.2.3" }, From 2906dfea183df96b92114e9a16b3541630d0bc91 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 25 Aug 2021 23:38:50 +0000 Subject: [PATCH 127/182] chore: disable renovate dependency dashboard (#1194) (#202) --- packages/google-cloud-bigquery-storage/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/README.md b/packages/google-cloud-bigquery-storage/README.md index 7e370998a22..092e780f0a9 100644 --- a/packages/google-cloud-bigquery-storage/README.md +++ b/packages/google-cloud-bigquery-storage/README.md @@ -240,8 +240,8 @@ Contributions welcome! See the [Contributing Guide](https://github.com/googleapi 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 From f7c6dfcb844105e0f2faf7a47a8b8146e32def08 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Fri, 3 Sep 2021 13:46:15 -0400 Subject: [PATCH 128/182] fix(build): migrate to main branch (#204) --- packages/google-cloud-bigquery-storage/README.md | 12 ++++++------ .../google-cloud-bigquery-storage/samples/README.md | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/README.md b/packages/google-cloud-bigquery-storage/README.md index 092e780f0a9..f7f2caa856b 100644 --- a/packages/google-cloud-bigquery-storage/README.md +++ b/packages/google-cloud-bigquery-storage/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-storage.svg)](https://www.npmjs.org/package/@google-cloud/bigquery-storage) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-bigquery-storage/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-bigquery-storage) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-bigquery-storage/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-bigquery-storage) @@ -15,7 +15,7 @@ Client for the BigQuery Storage API A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-bigquery-storage/blob/master/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/nodejs-bigquery-storage/blob/main/CHANGELOG.md). * [Google BigQuery Storage Node.js Client API Reference][client-docs] * [Google BigQuery Storage Documentation][product-docs] @@ -182,11 +182,11 @@ async function bigqueryStorageQuickstart() { ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-bigquery-storage/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-storage/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| BigQuery Storage Quickstart | [source code](https://github.com/googleapis/nodejs-bigquery-storage/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-storage&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| BigQuery Storage Quickstart | [source code](https://github.com/googleapis/nodejs-bigquery-storage/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-storage&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | @@ -235,7 +235,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-bigquery-storage/blob/master/CONTRIBUTING.md). +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-bigquery-storage/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`) @@ -247,7 +247,7 @@ to its templates in Apache Version 2.0 -See [LICENSE](https://github.com/googleapis/nodejs-bigquery-storage/blob/master/LICENSE) +See [LICENSE](https://github.com/googleapis/nodejs-bigquery-storage/blob/main/LICENSE) [client-docs]: https://cloud.google.com/nodejs/docs/reference/bigquery-storage/latest [product-docs]: https://cloud.google.com/bigquery/docs/reference/storage diff --git a/packages/google-cloud-bigquery-storage/samples/README.md b/packages/google-cloud-bigquery-storage/samples/README.md index 27ca6db4d3e..953b83c0931 100644 --- a/packages/google-cloud-bigquery-storage/samples/README.md +++ b/packages/google-cloud-bigquery-storage/samples/README.md @@ -33,7 +33,7 @@ Before running the samples, make sure you've followed the steps outlined in Read data from a table via read stream. -View the [source code](https://github.com/googleapis/nodejs-bigquery-storage/blob/master/samples/quickstart.js). +View the [source code](https://github.com/googleapis/nodejs-bigquery-storage/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-storage&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) From b6552e25540af40c3f296417fb4377318dc4acd8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 3 Sep 2021 10:59:50 -0700 Subject: [PATCH 129/182] chore: release 2.6.1 (#205) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-bigquery-storage/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-storage/package.json | 2 +- .../google-cloud-bigquery-storage/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md index cc2931a657f..8d63a600e81 100644 --- a/packages/google-cloud-bigquery-storage/CHANGELOG.md +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.6.1](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.6.0...v2.6.1) (2021-09-03) + + +### Bug Fixes + +* **build:** migrate to main branch ([#204](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/204)) ([759c9f0](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/759c9f0442f9cec7eec94055da87b17ba7ef18ad)) + ## [2.6.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.5.4...v2.6.0) (2021-08-23) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index a20863fe302..311e2882432 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "2.6.0", + "version": "2.6.1", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index 93496cebfda..57417ed5bf5 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^2.6.0", + "@google-cloud/bigquery-storage": "^2.6.1", "avsc": "^5.4.18", "snappy": "^6.2.3" }, From a8083a2e9ba85a378fc761ab24a588bc9e2e13d4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 7 Sep 2021 23:06:44 +0200 Subject: [PATCH 130/182] fix(deps): update dependency snappy to v7 (#196) --- packages/google-cloud-bigquery-storage/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index 57417ed5bf5..366a7be9f97 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -15,7 +15,7 @@ "dependencies": { "@google-cloud/bigquery-storage": "^2.6.1", "avsc": "^5.4.18", - "snappy": "^6.2.3" + "snappy": "^7.0.0" }, "devDependencies": { "c8": "^7.0.0", From e07c79c9528e9806e2198e5dd25ef43d34dda44b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 7 Sep 2021 21:12:28 +0000 Subject: [PATCH 131/182] chore: release 2.6.2 (#206) :robot: I have created a release \*beep\* \*boop\* --- ### [2.6.2](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.6.1...v2.6.2) (2021-09-07) ### Bug Fixes * **deps:** update dependency snappy to v7 ([#196](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/196)) ([37538ec](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/37538ec42815d0ce325416b4ee299ca3fb7b59fe)) --- 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-storage/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-storage/package.json | 2 +- .../google-cloud-bigquery-storage/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md index 8d63a600e81..77c6ab23ab6 100644 --- a/packages/google-cloud-bigquery-storage/CHANGELOG.md +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.6.2](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.6.1...v2.6.2) (2021-09-07) + + +### Bug Fixes + +* **deps:** update dependency snappy to v7 ([#196](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/196)) ([37538ec](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/37538ec42815d0ce325416b4ee299ca3fb7b59fe)) + ### [2.6.1](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.6.0...v2.6.1) (2021-09-03) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 311e2882432..a5bd884b166 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "2.6.1", + "version": "2.6.2", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index 366a7be9f97..d443ea9f54e 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^2.6.1", + "@google-cloud/bigquery-storage": "^2.6.2", "avsc": "^5.4.18", "snappy": "^7.0.0" }, From 34e83a5aa9d2dd69b10f3eee185f7b51cf39d12e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 15 Sep 2021 10:51:19 -0700 Subject: [PATCH 132/182] docs: Align session length with public documentation feat: Expose estimated bytes that a session will scan. (#208) Committer: @emkornfield PiperOrigin-RevId: 396849937 --- .../cloud/bigquery/storage/v1/storage.proto | 2 +- .../cloud/bigquery/storage/v1/stream.proto | 5 +++ .../protos/protos.d.ts | 6 ++++ .../protos/protos.js | 36 +++++++++++++++++++ .../protos/protos.json | 7 ++++ .../src/v1/big_query_read_client.ts | 2 +- 6 files changed, 56 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto index 8ac56375044..e86ad253cfa 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto @@ -62,7 +62,7 @@ service BigQueryRead { // limits are enforced based on the number of pre-filtered rows, so some // filters can lead to lopsided assignments. // - // Read sessions automatically expire 24 hours after they are created and do + // Read sessions automatically expire 6 hours after they are created and do // not require manual clean-up by the caller. rpc CreateReadSession(CreateReadSessionRequest) returns (ReadSession) { option (google.api.http) = { diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto index 291cf4115bc..51aeaac4655 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto @@ -126,6 +126,11 @@ message ReadSession { // in that case, the user will need to use a List method to get the streams // instead, which is not yet available. repeated ReadStream streams = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. An estimate on the number of bytes this session will scan when + // all streams are completely consumed. This estimate is based on + // metadata from the table which might be incomplete or stale. + int64 estimated_total_bytes_scanned = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Information about a single stream that gets data out of the storage system. diff --git a/packages/google-cloud-bigquery-storage/protos/protos.d.ts b/packages/google-cloud-bigquery-storage/protos/protos.d.ts index fea18b2d33b..bedf6603682 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-storage/protos/protos.d.ts @@ -1425,6 +1425,9 @@ export namespace google { /** ReadSession streams */ streams?: (google.cloud.bigquery.storage.v1.IReadStream[]|null); + + /** ReadSession estimatedTotalBytesScanned */ + estimatedTotalBytesScanned?: (number|Long|string|null); } /** Represents a ReadSession. */ @@ -1463,6 +1466,9 @@ export namespace google { /** ReadSession streams. */ public streams: google.cloud.bigquery.storage.v1.IReadStream[]; + /** ReadSession estimatedTotalBytesScanned. */ + public estimatedTotalBytesScanned: (number|Long|string); + /** ReadSession schema. */ public schema?: ("avroSchema"|"arrowSchema"); diff --git a/packages/google-cloud-bigquery-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index 4ead87bfb66..a1cde29224c 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/protos/protos.js @@ -3204,6 +3204,7 @@ * @property {google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers|null} [tableModifiers] ReadSession tableModifiers * @property {google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions|null} [readOptions] ReadSession readOptions * @property {Array.|null} [streams] ReadSession streams + * @property {number|Long|null} [estimatedTotalBytesScanned] ReadSession estimatedTotalBytesScanned */ /** @@ -3294,6 +3295,14 @@ */ ReadSession.prototype.streams = $util.emptyArray; + /** + * ReadSession estimatedTotalBytesScanned. + * @member {number|Long} estimatedTotalBytesScanned + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @instance + */ + ReadSession.prototype.estimatedTotalBytesScanned = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -3351,6 +3360,8 @@ if (message.streams != null && message.streams.length) for (var i = 0; i < message.streams.length; ++i) $root.google.cloud.bigquery.storage.v1.ReadStream.encode(message.streams[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.estimatedTotalBytesScanned != null && Object.hasOwnProperty.call(message, "estimatedTotalBytesScanned")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.estimatedTotalBytesScanned); return writer; }; @@ -3414,6 +3425,9 @@ message.streams = []; message.streams.push($root.google.cloud.bigquery.storage.v1.ReadStream.decode(reader, reader.uint32())); break; + case 12: + message.estimatedTotalBytesScanned = reader.int64(); + break; default: reader.skipType(tag & 7); break; @@ -3507,6 +3521,9 @@ return "streams." + error; } } + if (message.estimatedTotalBytesScanned != null && message.hasOwnProperty("estimatedTotalBytesScanned")) + if (!$util.isInteger(message.estimatedTotalBytesScanned) && !(message.estimatedTotalBytesScanned && $util.isInteger(message.estimatedTotalBytesScanned.low) && $util.isInteger(message.estimatedTotalBytesScanned.high))) + return "estimatedTotalBytesScanned: integer|Long expected"; return null; }; @@ -3575,6 +3592,15 @@ message.streams[i] = $root.google.cloud.bigquery.storage.v1.ReadStream.fromObject(object.streams[i]); } } + if (object.estimatedTotalBytesScanned != null) + if ($util.Long) + (message.estimatedTotalBytesScanned = $util.Long.fromValue(object.estimatedTotalBytesScanned)).unsigned = false; + else if (typeof object.estimatedTotalBytesScanned === "string") + message.estimatedTotalBytesScanned = parseInt(object.estimatedTotalBytesScanned, 10); + else if (typeof object.estimatedTotalBytesScanned === "number") + message.estimatedTotalBytesScanned = object.estimatedTotalBytesScanned; + else if (typeof object.estimatedTotalBytesScanned === "object") + message.estimatedTotalBytesScanned = new $util.LongBits(object.estimatedTotalBytesScanned.low >>> 0, object.estimatedTotalBytesScanned.high >>> 0).toNumber(); return message; }; @@ -3600,6 +3626,11 @@ object.table = ""; object.tableModifiers = null; object.readOptions = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.estimatedTotalBytesScanned = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.estimatedTotalBytesScanned = options.longs === String ? "0" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -3628,6 +3659,11 @@ for (var j = 0; j < message.streams.length; ++j) object.streams[j] = $root.google.cloud.bigquery.storage.v1.ReadStream.toObject(message.streams[j], options); } + if (message.estimatedTotalBytesScanned != null && message.hasOwnProperty("estimatedTotalBytesScanned")) + if (typeof message.estimatedTotalBytesScanned === "number") + object.estimatedTotalBytesScanned = options.longs === String ? String(message.estimatedTotalBytesScanned) : message.estimatedTotalBytesScanned; + else + object.estimatedTotalBytesScanned = options.longs === String ? $util.Long.prototype.toString.call(message.estimatedTotalBytesScanned) : options.longs === Number ? new $util.LongBits(message.estimatedTotalBytesScanned.low >>> 0, message.estimatedTotalBytesScanned.high >>> 0).toNumber() : message.estimatedTotalBytesScanned; return object; }; diff --git a/packages/google-cloud-bigquery-storage/protos/protos.json b/packages/google-cloud-bigquery-storage/protos/protos.json index 6a76834bc84..b3dca4ec481 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.json +++ b/packages/google-cloud-bigquery-storage/protos/protos.json @@ -372,6 +372,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "estimatedTotalBytesScanned": { + "type": "int64", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index 5c84bf9eba5..a722be8fec6 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -367,7 +367,7 @@ export class BigQueryReadClient { * limits are enforced based on the number of pre-filtered rows, so some * filters can lead to lopsided assignments. * - * Read sessions automatically expire 24 hours after they are created and do + * Read sessions automatically expire 6 hours after they are created and do * not require manual clean-up by the caller. * * @param {Object} request From a3fd6755636d2de7b0e220d0fdebb548114b830e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 27 Sep 2021 08:29:44 -0700 Subject: [PATCH 133/182] feat: add BigQuery Storage Write API v1 (#209) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add BigQuery Storage Write API v1 Committer: @yirutang PiperOrigin-RevId: 397350004 Source-Link: https://github.com/googleapis/googleapis/commit/b4da4fd5eee314df550791fc287c1f1950127ee4 Source-Link: https://github.com/googleapis/googleapis-gen/commit/67bcfcfa00a4113e968bac1a10d0ad0c1b7dc45b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjdiY2ZjZmEwMGE0MTEzZTk2OGJhYzFhMTBkMGFkMGMxYjdkYzQ1YiJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix: fix system tests Co-authored-by: Owl Bot Co-authored-by: Takashi Matsuo --- .../cloud/bigquery/storage/v1/protobuf.proto | 48 + .../cloud/bigquery/storage/v1/storage.proto | 361 +- .../cloud/bigquery/storage/v1/stream.proto | 48 + .../cloud/bigquery/storage/v1/table.proto | 164 + .../protos/protos.d.ts | 9719 ++++-- .../protos/protos.js | 28028 ++++++++++------ .../protos/protos.json | 1173 +- .../src/v1/big_query_read_client.ts | 126 + .../src/v1/big_query_read_client_config.json | 3 +- .../src/v1/big_query_read_proto_list.json | 4 +- .../src/v1/big_query_write_client.ts | 1183 + .../src/v1/big_query_write_client_config.json | 59 + .../src/v1/big_query_write_proto_list.json | 8 + .../src/v1/gapic_metadata.json | 69 + .../src/v1/index.ts | 1 + .../system-test/fixtures/sample/src/index.js | 1 + .../system-test/fixtures/sample/src/index.ts | 11 +- .../test/gapic_big_query_read_v1.ts | 140 + .../test/gapic_big_query_write_v1.ts | 1115 + 19 files changed, 28047 insertions(+), 14214 deletions(-) create mode 100644 packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/protobuf.proto create mode 100644 packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/table.proto create mode 100644 packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts create mode 100644 packages/google-cloud-bigquery-storage/src/v1/big_query_write_client_config.json create mode 100644 packages/google-cloud-bigquery-storage/src/v1/big_query_write_proto_list.json create mode 100644 packages/google-cloud-bigquery-storage/test/gapic_big_query_write_v1.ts diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/protobuf.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/protobuf.proto new file mode 100644 index 00000000000..f987467dd9f --- /dev/null +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/protobuf.proto @@ -0,0 +1,48 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.storage.v1; + +import "google/protobuf/descriptor.proto"; + +option csharp_namespace = "Google.Cloud.BigQuery.Storage.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1;storage"; +option java_multiple_files = true; +option java_outer_classname = "ProtoBufProto"; +option java_package = "com.google.cloud.bigquery.storage.v1"; +option php_namespace = "Google\\Cloud\\BigQuery\\Storage\\V1"; + +// ProtoSchema describes the schema of the serialized protocol buffer data rows. +message ProtoSchema { + // Descriptor for input message. The provided descriptor must be self + // contained, such that data rows sent can be fully decoded using only the + // single descriptor. For data rows that are compositions of multiple + // independent messages, this means the descriptor may need to be transformed + // to only use nested types: + // https://developers.google.com/protocol-buffers/docs/proto#nested + // + // For additional information for how proto types and values map onto BigQuery + // see: https://cloud.google.com/bigquery/docs/write-api#data_type_conversions + google.protobuf.DescriptorProto proto_descriptor = 1; +} + +message ProtoRows { + // A sequence of rows serialized as a Protocol Buffer. + // + // See https://developers.google.com/protocol-buffers/docs/overview for more + // information on deserializing this field. + repeated bytes serialized_rows = 1; +} diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto index e86ad253cfa..ab5a46cf180 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto @@ -22,7 +22,12 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/bigquery/storage/v1/arrow.proto"; import "google/cloud/bigquery/storage/v1/avro.proto"; +import "google/cloud/bigquery/storage/v1/protobuf.proto"; import "google/cloud/bigquery/storage/v1/stream.proto"; +import "google/cloud/bigquery/storage/v1/table.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/rpc/status.proto"; option csharp_namespace = "Google.Cloud.BigQuery.Storage.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1;storage"; @@ -105,6 +110,121 @@ service BigQueryRead { } } +// BigQuery Write API. +// +// The Write API can be used to write data to BigQuery. +// +// For supplementary information about the Write API, see: +// https://cloud.google.com/bigquery/docs/write-api +service BigQueryWrite { + option (google.api.default_host) = "bigquerystorage.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/bigquery," + "https://www.googleapis.com/auth/bigquery.insertdata," + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a write stream to the given table. + // Additionally, every table has a special stream named '_default' + // to which data can be written. This stream doesn't need to be created using + // CreateWriteStream. It is a stream that can be used simultaneously by any + // number of clients. Data written to this stream is considered committed as + // soon as an acknowledgement is received. + rpc CreateWriteStream(CreateWriteStreamRequest) returns (WriteStream) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/datasets/*/tables/*}" + body: "write_stream" + }; + option (google.api.method_signature) = "parent,write_stream"; + } + + // Appends data to the given stream. + // + // If `offset` is specified, the `offset` is checked against the end of + // stream. The server returns `OUT_OF_RANGE` in `AppendRowsResponse` if an + // attempt is made to append to an offset beyond the current end of the stream + // or `ALREADY_EXISTS` if user provides an `offset` that has already been + // written to. User can retry with adjusted offset within the same RPC + // connection. If `offset` is not specified, append happens at the end of the + // stream. + // + // The response contains an optional offset at which the append + // happened. No offset information will be returned for appends to a + // default stream. + // + // Responses are received in the same order in which requests are sent. + // There will be one response for each successful inserted request. Responses + // may optionally embed error information if the originating AppendRequest was + // not successfully processed. + // + // The specifics of when successfully appended data is made visible to the + // table are governed by the type of stream: + // + // * For COMMITTED streams (which includes the default stream), data is + // visible immediately upon successful append. + // + // * For BUFFERED streams, data is made visible via a subsequent `FlushRows` + // rpc which advances a cursor to a newer offset in the stream. + // + // * For PENDING streams, data is not made visible until the stream itself is + // finalized (via the `FinalizeWriteStream` rpc), and the stream is explicitly + // committed via the `BatchCommitWriteStreams` rpc. + rpc AppendRows(stream AppendRowsRequest) returns (stream AppendRowsResponse) { + option (google.api.http) = { + post: "/v1/{write_stream=projects/*/datasets/*/tables/*/streams/*}" + body: "*" + }; + option (google.api.method_signature) = "write_stream"; + } + + // Gets information about a write stream. + rpc GetWriteStream(GetWriteStreamRequest) returns (WriteStream) { + option (google.api.http) = { + post: "/v1/{name=projects/*/datasets/*/tables/*/streams/*}" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Finalize a write stream so that no new data can be appended to the + // stream. Finalize is not supported on the '_default' stream. + rpc FinalizeWriteStream(FinalizeWriteStreamRequest) returns (FinalizeWriteStreamResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/datasets/*/tables/*/streams/*}" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Atomically commits a group of `PENDING` streams that belong to the same + // `parent` table. + // + // Streams must be finalized before commit and cannot be committed multiple + // times. Once a stream is committed, data in the stream becomes available + // for read operations. + rpc BatchCommitWriteStreams(BatchCommitWriteStreamsRequest) returns (BatchCommitWriteStreamsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/datasets/*/tables/*}" + }; + option (google.api.method_signature) = "parent"; + } + + // Flushes rows to a BUFFERED stream. + // + // If users are appending rows to BUFFERED stream, flush operation is + // required in order for the rows to become available for reading. A + // Flush operation flushes up to any previously flushed offset in a BUFFERED + // stream, to the offset specified in the request. + // + // Flush is not supported on the _default stream, since it is not BUFFERED. + rpc FlushRows(FlushRowsRequest) returns (FlushRowsResponse) { + option (google.api.http) = { + post: "/v1/{write_stream=projects/*/datasets/*/tables/*/streams/*}" + body: "*" + }; + option (google.api.method_signature) = "write_stream"; + } +} + // Request message for `CreateReadSession`. message CreateReadSessionRequest { // Required. The request project that owns the session, in the form of @@ -153,7 +273,7 @@ message ThrottleState { int32 throttle_percent = 1; } -// Estimated stream statistics for a given Stream. +// Estimated stream statistics for a given read Stream. message StreamStats { message Progress { // The fraction of rows assigned to the stream that have been processed by @@ -246,3 +366,242 @@ message SplitReadStreamResponse { // value indicates that the original stream can no longer be split. ReadStream remainder_stream = 2; } + +// Request message for `CreateWriteStream`. +message CreateWriteStreamRequest { + // Required. Reference to the table to which the stream belongs, in the format + // of `projects/{project}/datasets/{dataset}/tables/{table}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquery.googleapis.com/Table" + } + ]; + + // Required. Stream to be created. + WriteStream write_stream = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for `AppendRows`. +// +// Due to the nature of AppendRows being a bidirectional streaming RPC, certain +// parts of the AppendRowsRequest need only be specified for the first request +// sent each time the gRPC network connection is opened/reopened. +message AppendRowsRequest { + // ProtoData contains the data rows and schema when constructing append + // requests. + message ProtoData { + // Proto schema used to serialize the data. This value only needs to be + // provided as part of the first request on a gRPC network connection, + // and will be ignored for subsequent requests on the connection. + ProtoSchema writer_schema = 1; + + // Serialized row data in protobuf message format. + // Currently, the backend expects the serialized rows to adhere to + // proto2 semantics when appending rows, particularly with respect to + // how default values are encoded. + ProtoRows rows = 2; + } + + // Required. The write_stream identifies the target of the append operation, and only + // needs to be specified as part of the first request on the gRPC connection. + // If provided for subsequent requests, it must match the value of the first + // request. + // + // For explicitly created write streams, the format is: + // `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` + // + // For the special default stream, the format is: + // `projects/{project}/datasets/{dataset}/tables/{table}/_default`. + string write_stream = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerystorage.googleapis.com/WriteStream" + } + ]; + + // If present, the write is only performed if the next append offset is same + // as the provided value. If not present, the write is performed at the + // current end of stream. Specifying a value for this field is not allowed + // when calling AppendRows for the '_default' stream. + google.protobuf.Int64Value offset = 2; + + // Input rows. The `writer_schema` field must be specified at the initial + // request and currently, it will be ignored if specified in following + // requests. Following requests must have data in the same format as the + // initial request. + oneof rows { + // Rows in proto format. + ProtoData proto_rows = 4; + } + + // Id set by client to annotate its identity. Only initial request setting is + // respected. + string trace_id = 6; +} + +// Response message for `AppendRows`. +message AppendRowsResponse { + // AppendResult is returned for successful append requests. + message AppendResult { + // The row offset at which the last append occurred. The offset will not be + // set if appending using default streams. + google.protobuf.Int64Value offset = 1; + } + + oneof response { + // Result if the append is successful. + AppendResult append_result = 1; + + // Error returned when problems were encountered. If present, + // it indicates rows were not accepted into the system. + // Users can retry or continue with other append requests within the + // same connection. + // + // Additional information about error signalling: + // + // ALREADY_EXISTS: Happens when an append specified an offset, and the + // backend already has received data at this offset. Typically encountered + // in retry scenarios, and can be ignored. + // + // OUT_OF_RANGE: Returned when the specified offset in the stream is beyond + // the current end of the stream. + // + // INVALID_ARGUMENT: Indicates a malformed request or data. + // + // ABORTED: Request processing is aborted because of prior failures. The + // request can be retried if previous failure is addressed. + // + // INTERNAL: Indicates server side error(s) that can be retried. + google.rpc.Status error = 2; + } + + // If backend detects a schema update, pass it to user so that user can + // use it to input new type of message. It will be empty when no schema + // updates have occurred. + TableSchema updated_schema = 3; +} + +// Request message for `GetWriteStreamRequest`. +message GetWriteStreamRequest { + // Required. Name of the stream to get, in the form of + // `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerystorage.googleapis.com/WriteStream" + } + ]; +} + +// Request message for `BatchCommitWriteStreams`. +message BatchCommitWriteStreamsRequest { + // Required. Parent table that all the streams should belong to, in the form of + // `projects/{project}/datasets/{dataset}/tables/{table}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED + ]; + + // Required. The group of streams that will be committed atomically. + repeated string write_streams = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for `BatchCommitWriteStreams`. +message BatchCommitWriteStreamsResponse { + // The time at which streams were committed in microseconds granularity. + // This field will only exist when there are no stream errors. + // **Note** if this field is not set, it means the commit was not successful. + google.protobuf.Timestamp commit_time = 1; + + // Stream level error if commit failed. Only streams with error will be in + // the list. + // If empty, there is no error and all streams are committed successfully. + // If non empty, certain streams have errors and ZERO stream is committed due + // to atomicity guarantee. + repeated StorageError stream_errors = 2; +} + +// Request message for invoking `FinalizeWriteStream`. +message FinalizeWriteStreamRequest { + // Required. Name of the stream to finalize, in the form of + // `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerystorage.googleapis.com/WriteStream" + } + ]; +} + +// Response message for `FinalizeWriteStream`. +message FinalizeWriteStreamResponse { + // Number of rows in the finalized stream. + int64 row_count = 1; +} + +// Request message for `FlushRows`. +message FlushRowsRequest { + // Required. The stream that is the target of the flush operation. + string write_stream = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquerystorage.googleapis.com/WriteStream" + } + ]; + + // Ending offset of the flush operation. Rows before this offset(including + // this offset) will be flushed. + google.protobuf.Int64Value offset = 2; +} + +// Respond message for `FlushRows`. +message FlushRowsResponse { + // The rows before this offset (including this offset) are flushed. + int64 offset = 1; +} + +// Structured custom BigQuery Storage error message. The error can be attached +// as error details in the returned rpc Status. In particular, the use of error +// codes allows more structured error handling, and reduces the need to evaluate +// unstructured error text strings. +message StorageError { + // Error code for `StorageError`. + enum StorageErrorCode { + // Default error. + STORAGE_ERROR_CODE_UNSPECIFIED = 0; + + // Table is not found in the system. + TABLE_NOT_FOUND = 1; + + // Stream is already committed. + STREAM_ALREADY_COMMITTED = 2; + + // Stream is not found. + STREAM_NOT_FOUND = 3; + + // Invalid Stream type. + // For example, you try to commit a stream that is not pending. + INVALID_STREAM_TYPE = 4; + + // Invalid Stream state. + // For example, you try to commit a stream that is not finalized or is + // garbaged. + INVALID_STREAM_STATE = 5; + + // Stream is finalized. + STREAM_FINALIZED = 6; + + // There is a schema mismatch and it is caused by user schema has extra + // field than bigquery schema. + SCHEMA_MISMATCH_EXTRA_FIELDS = 7; + } + + // BigQuery Storage specific error code. + StorageErrorCode code = 1; + + // Name of the failed entity. + string entity = 2; + + // Message that describes the error. + string error_message = 3; +} diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto index 51aeaac4655..dc62e8c00ca 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto @@ -20,6 +20,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/bigquery/storage/v1/arrow.proto"; import "google/cloud/bigquery/storage/v1/avro.proto"; +import "google/cloud/bigquery/storage/v1/table.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.BigQuery.Storage.V1"; @@ -146,3 +147,50 @@ message ReadStream { // `projects/{project_id}/locations/{location}/sessions/{session_id}/streams/{stream_id}`. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; } + +// Information about a single stream that gets data inside the storage system. +message WriteStream { + option (google.api.resource) = { + type: "bigquerystorage.googleapis.com/WriteStream" + pattern: "projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}" + }; + + // Type enum of the stream. + enum Type { + // Unknown type. + TYPE_UNSPECIFIED = 0; + + // Data will commit automatically and appear as soon as the write is + // acknowledged. + COMMITTED = 1; + + // Data is invisible until the stream is committed. + PENDING = 2; + + // Data is only visible up to the offset to which it was flushed. + BUFFERED = 3; + } + + // Output only. Name of the stream, in the form + // `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. Type of the stream. + Type type = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. Create time of the stream. For the _default stream, this is the + // creation_time of the table. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Commit time of the stream. + // If a stream is of `COMMITTED` type, then it will have a commit_time same as + // `create_time`. If the stream is of `PENDING` type, empty commit_time + // means it is not committed. + google.protobuf.Timestamp commit_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The schema of the destination table. It is only returned in + // `CreateWriteStream` response. Caller should generate data that's + // compatible with this schema to send in initial `AppendRowsRequest`. + // The table schema could go out of date during the life time of the stream. + TableSchema table_schema = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/table.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/table.proto new file mode 100644 index 00000000000..a8c6f844df5 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/table.proto @@ -0,0 +1,164 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.bigquery.storage.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.BigQuery.Storage.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1;storage"; +option java_multiple_files = true; +option java_outer_classname = "TableProto"; +option java_package = "com.google.cloud.bigquery.storage.v1"; +option php_namespace = "Google\\Cloud\\BigQuery\\Storage\\V1"; + +// Schema of a table. +message TableSchema { + // Describes the fields in a table. + repeated TableFieldSchema fields = 1; +} + +// TableFieldSchema defines a single field/column within a table schema. +message TableFieldSchema { + enum Type { + // Illegal value + TYPE_UNSPECIFIED = 0; + + // 64K, UTF8 + STRING = 1; + + // 64-bit signed + INT64 = 2; + + // 64-bit IEEE floating point + DOUBLE = 3; + + // Aggregate type + STRUCT = 4; + + // 64K, Binary + BYTES = 5; + + // 2-valued + BOOL = 6; + + // 64-bit signed usec since UTC epoch + TIMESTAMP = 7; + + // Civil date - Year, Month, Day + DATE = 8; + + // Civil time - Hour, Minute, Second, Microseconds + TIME = 9; + + // Combination of civil date and civil time + DATETIME = 10; + + // Geography object + GEOGRAPHY = 11; + + // Numeric value + NUMERIC = 12; + + // BigNumeric value + BIGNUMERIC = 13; + + // Interval + INTERVAL = 14; + + // JSON, String + JSON = 15; + } + + enum Mode { + // Illegal value + MODE_UNSPECIFIED = 0; + + NULLABLE = 1; + + REQUIRED = 2; + + REPEATED = 3; + } + + // Required. The field name. The name must contain only letters (a-z, A-Z), + // numbers (0-9), or underscores (_), and must start with a letter or + // underscore. The maximum length is 128 characters. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The field data type. + Type type = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The field mode. The default value is NULLABLE. + Mode mode = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Describes the nested schema fields if the type property is set to STRUCT. + repeated TableFieldSchema fields = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The field description. The maximum length is 1,024 characters. + string description = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maximum length of values of this field for STRINGS or BYTES. + // + // If max_length is not specified, no maximum length constraint is imposed + // on this field. + // + // If type = "STRING", then max_length represents the maximum UTF-8 + // length of strings in this field. + // + // If type = "BYTES", then max_length represents the maximum number of + // bytes in this field. + // + // It is invalid to set this field if type is not "STRING" or "BYTES". + int64 max_length = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Precision (maximum number of total digits in base 10) and scale + // (maximum number of digits in the fractional part in base 10) constraints + // for values of this field for NUMERIC or BIGNUMERIC. + // + // It is invalid to set precision or scale if type is not "NUMERIC" or + // "BIGNUMERIC". + // + // If precision and scale are not specified, no value range constraint is + // imposed on this field insofar as values are permitted by the type. + // + // Values of this NUMERIC or BIGNUMERIC field must be in this range when: + // + // * Precision (P) and scale (S) are specified: + // [-10^(P-S) + 10^(-S), 10^(P-S) - 10^(-S)] + // * Precision (P) is specified but not scale (and thus scale is + // interpreted to be equal to zero): + // [-10^P + 1, 10^P - 1]. + // + // Acceptable values for precision and scale if both are specified: + // + // * If type = "NUMERIC": + // 1 <= precision - scale <= 29 and 0 <= scale <= 9. + // * If type = "BIGNUMERIC": + // 1 <= precision - scale <= 38 and 0 <= scale <= 38. + // + // Acceptable values for precision if only precision is specified but not + // scale (and thus scale is interpreted to be equal to zero): + // + // * If type = "NUMERIC": 1 <= precision <= 29. + // * If type = "BIGNUMERIC": 1 <= precision <= 38. + // + // If scale is specified but not precision, then it is invalid. + int64 precision = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. See documentation for precision. + int64 scale = 9 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-bigquery-storage/protos/protos.d.ts b/packages/google-cloud-bigquery-storage/protos/protos.d.ts index bedf6603682..7ec3286e4e5 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-storage/protos/protos.d.ts @@ -501,6 +501,186 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a ProtoSchema. */ + interface IProtoSchema { + + /** ProtoSchema protoDescriptor */ + protoDescriptor?: (google.protobuf.IDescriptorProto|null); + } + + /** Represents a ProtoSchema. */ + class ProtoSchema implements IProtoSchema { + + /** + * Constructs a new ProtoSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.IProtoSchema); + + /** ProtoSchema protoDescriptor. */ + public protoDescriptor?: (google.protobuf.IDescriptorProto|null); + + /** + * Creates a new ProtoSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns ProtoSchema instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.IProtoSchema): google.cloud.bigquery.storage.v1.ProtoSchema; + + /** + * Encodes the specified ProtoSchema message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ProtoSchema.verify|verify} messages. + * @param message ProtoSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.IProtoSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProtoSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ProtoSchema.verify|verify} messages. + * @param message ProtoSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IProtoSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProtoSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProtoSchema + * @throws {Error} If the payload is not a 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.storage.v1.ProtoSchema; + + /** + * Decodes a ProtoSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProtoSchema + * @throws {Error} If the payload is 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.storage.v1.ProtoSchema; + + /** + * Verifies a ProtoSchema message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProtoSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProtoSchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.ProtoSchema; + + /** + * Creates a plain object from a ProtoSchema message. Also converts values to other types if specified. + * @param message ProtoSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.ProtoSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProtoSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ProtoRows. */ + interface IProtoRows { + + /** ProtoRows serializedRows */ + serializedRows?: (Uint8Array[]|null); + } + + /** Represents a ProtoRows. */ + class ProtoRows implements IProtoRows { + + /** + * Constructs a new ProtoRows. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.IProtoRows); + + /** ProtoRows serializedRows. */ + public serializedRows: Uint8Array[]; + + /** + * Creates a new ProtoRows instance using the specified properties. + * @param [properties] Properties to set + * @returns ProtoRows instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.IProtoRows): google.cloud.bigquery.storage.v1.ProtoRows; + + /** + * Encodes the specified ProtoRows message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ProtoRows.verify|verify} messages. + * @param message ProtoRows message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.IProtoRows, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProtoRows message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ProtoRows.verify|verify} messages. + * @param message ProtoRows message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IProtoRows, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProtoRows message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProtoRows + * @throws {Error} If the payload is not a 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.storage.v1.ProtoRows; + + /** + * Decodes a ProtoRows message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProtoRows + * @throws {Error} If the payload is 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.storage.v1.ProtoRows; + + /** + * Verifies a ProtoRows message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProtoRows message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProtoRows + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.ProtoRows; + + /** + * Creates a plain object from a ProtoRows message. Also converts values to other types if specified. + * @param message ProtoRows + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.ProtoRows, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProtoRows to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Represents a BigQueryRead */ class BigQueryRead extends $protobuf.rpc.Service { @@ -588,6 +768,156 @@ export namespace google { type SplitReadStreamCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1.SplitReadStreamResponse) => void; } + /** Represents a BigQueryWrite */ + class BigQueryWrite extends $protobuf.rpc.Service { + + /** + * Constructs a new BigQueryWrite 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 BigQueryWrite 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): BigQueryWrite; + + /** + * Calls CreateWriteStream. + * @param request CreateWriteStreamRequest message or plain object + * @param callback Node-style callback called with the error, if any, and WriteStream + */ + public createWriteStream(request: google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest, callback: google.cloud.bigquery.storage.v1.BigQueryWrite.CreateWriteStreamCallback): void; + + /** + * Calls CreateWriteStream. + * @param request CreateWriteStreamRequest message or plain object + * @returns Promise + */ + public createWriteStream(request: google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest): Promise; + + /** + * Calls AppendRows. + * @param request AppendRowsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AppendRowsResponse + */ + public appendRows(request: google.cloud.bigquery.storage.v1.IAppendRowsRequest, callback: google.cloud.bigquery.storage.v1.BigQueryWrite.AppendRowsCallback): void; + + /** + * Calls AppendRows. + * @param request AppendRowsRequest message or plain object + * @returns Promise + */ + public appendRows(request: google.cloud.bigquery.storage.v1.IAppendRowsRequest): Promise; + + /** + * Calls GetWriteStream. + * @param request GetWriteStreamRequest message or plain object + * @param callback Node-style callback called with the error, if any, and WriteStream + */ + public getWriteStream(request: google.cloud.bigquery.storage.v1.IGetWriteStreamRequest, callback: google.cloud.bigquery.storage.v1.BigQueryWrite.GetWriteStreamCallback): void; + + /** + * Calls GetWriteStream. + * @param request GetWriteStreamRequest message or plain object + * @returns Promise + */ + public getWriteStream(request: google.cloud.bigquery.storage.v1.IGetWriteStreamRequest): Promise; + + /** + * Calls FinalizeWriteStream. + * @param request FinalizeWriteStreamRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FinalizeWriteStreamResponse + */ + public finalizeWriteStream(request: google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest, callback: google.cloud.bigquery.storage.v1.BigQueryWrite.FinalizeWriteStreamCallback): void; + + /** + * Calls FinalizeWriteStream. + * @param request FinalizeWriteStreamRequest message or plain object + * @returns Promise + */ + public finalizeWriteStream(request: google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest): Promise; + + /** + * Calls BatchCommitWriteStreams. + * @param request BatchCommitWriteStreamsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchCommitWriteStreamsResponse + */ + public batchCommitWriteStreams(request: google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest, callback: google.cloud.bigquery.storage.v1.BigQueryWrite.BatchCommitWriteStreamsCallback): void; + + /** + * Calls BatchCommitWriteStreams. + * @param request BatchCommitWriteStreamsRequest message or plain object + * @returns Promise + */ + public batchCommitWriteStreams(request: google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest): Promise; + + /** + * Calls FlushRows. + * @param request FlushRowsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FlushRowsResponse + */ + public flushRows(request: google.cloud.bigquery.storage.v1.IFlushRowsRequest, callback: google.cloud.bigquery.storage.v1.BigQueryWrite.FlushRowsCallback): void; + + /** + * Calls FlushRows. + * @param request FlushRowsRequest message or plain object + * @returns Promise + */ + public flushRows(request: google.cloud.bigquery.storage.v1.IFlushRowsRequest): Promise; + } + + namespace BigQueryWrite { + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#createWriteStream}. + * @param error Error, if any + * @param [response] WriteStream + */ + type CreateWriteStreamCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1.WriteStream) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#appendRows}. + * @param error Error, if any + * @param [response] AppendRowsResponse + */ + type AppendRowsCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1.AppendRowsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#getWriteStream}. + * @param error Error, if any + * @param [response] WriteStream + */ + type GetWriteStreamCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1.WriteStream) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#finalizeWriteStream}. + * @param error Error, if any + * @param [response] FinalizeWriteStreamResponse + */ + type FinalizeWriteStreamCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#batchCommitWriteStreams}. + * @param error Error, if any + * @param [response] BatchCommitWriteStreamsResponse + */ + type BatchCommitWriteStreamsCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse) => void; + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#flushRows}. + * @param error Error, if any + * @param [response] FlushRowsResponse + */ + type FlushRowsCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1.FlushRowsResponse) => void; + } + /** Properties of a CreateReadSessionRequest. */ interface ICreateReadSessionRequest { @@ -1389,1233 +1719,1280 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** DataFormat enum. */ - enum DataFormat { - DATA_FORMAT_UNSPECIFIED = 0, - AVRO = 1, - ARROW = 2 - } - - /** Properties of a ReadSession. */ - interface IReadSession { - - /** ReadSession name */ - name?: (string|null); - - /** ReadSession expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** ReadSession dataFormat */ - dataFormat?: (google.cloud.bigquery.storage.v1.DataFormat|keyof typeof google.cloud.bigquery.storage.v1.DataFormat|null); - - /** ReadSession avroSchema */ - avroSchema?: (google.cloud.bigquery.storage.v1.IAvroSchema|null); - - /** ReadSession arrowSchema */ - arrowSchema?: (google.cloud.bigquery.storage.v1.IArrowSchema|null); - - /** ReadSession table */ - table?: (string|null); - - /** ReadSession tableModifiers */ - tableModifiers?: (google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers|null); - - /** ReadSession readOptions */ - readOptions?: (google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions|null); + /** Properties of a CreateWriteStreamRequest. */ + interface ICreateWriteStreamRequest { - /** ReadSession streams */ - streams?: (google.cloud.bigquery.storage.v1.IReadStream[]|null); + /** CreateWriteStreamRequest parent */ + parent?: (string|null); - /** ReadSession estimatedTotalBytesScanned */ - estimatedTotalBytesScanned?: (number|Long|string|null); + /** CreateWriteStreamRequest writeStream */ + writeStream?: (google.cloud.bigquery.storage.v1.IWriteStream|null); } - /** Represents a ReadSession. */ - class ReadSession implements IReadSession { + /** Represents a CreateWriteStreamRequest. */ + class CreateWriteStreamRequest implements ICreateWriteStreamRequest { /** - * Constructs a new ReadSession. + * Constructs a new CreateWriteStreamRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.bigquery.storage.v1.IReadSession); + constructor(properties?: google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest); - /** ReadSession name. */ - public name: string; + /** CreateWriteStreamRequest parent. */ + public parent: string; - /** ReadSession expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); + /** CreateWriteStreamRequest writeStream. */ + public writeStream?: (google.cloud.bigquery.storage.v1.IWriteStream|null); - /** ReadSession dataFormat. */ - public dataFormat: (google.cloud.bigquery.storage.v1.DataFormat|keyof typeof google.cloud.bigquery.storage.v1.DataFormat); + /** + * Creates a new CreateWriteStreamRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateWriteStreamRequest instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest): google.cloud.bigquery.storage.v1.CreateWriteStreamRequest; - /** ReadSession avroSchema. */ - public avroSchema?: (google.cloud.bigquery.storage.v1.IAvroSchema|null); + /** + * Encodes the specified CreateWriteStreamRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1.CreateWriteStreamRequest.verify|verify} messages. + * @param message CreateWriteStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** ReadSession arrowSchema. */ - public arrowSchema?: (google.cloud.bigquery.storage.v1.IArrowSchema|null); + /** + * Encodes the specified CreateWriteStreamRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.CreateWriteStreamRequest.verify|verify} messages. + * @param message CreateWriteStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** ReadSession table. */ - public table: string; + /** + * Decodes a CreateWriteStreamRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateWriteStreamRequest + * @throws {Error} If the payload is not a 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.storage.v1.CreateWriteStreamRequest; - /** ReadSession tableModifiers. */ - public tableModifiers?: (google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers|null); + /** + * Decodes a CreateWriteStreamRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateWriteStreamRequest + * @throws {Error} If the payload is 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.storage.v1.CreateWriteStreamRequest; - /** ReadSession readOptions. */ - public readOptions?: (google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions|null); + /** + * Verifies a CreateWriteStreamRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** ReadSession streams. */ - public streams: google.cloud.bigquery.storage.v1.IReadStream[]; + /** + * Creates a CreateWriteStreamRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateWriteStreamRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.CreateWriteStreamRequest; - /** ReadSession estimatedTotalBytesScanned. */ - public estimatedTotalBytesScanned: (number|Long|string); + /** + * Creates a plain object from a CreateWriteStreamRequest message. Also converts values to other types if specified. + * @param message CreateWriteStreamRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.CreateWriteStreamRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ReadSession schema. */ - public schema?: ("avroSchema"|"arrowSchema"); + /** + * Converts this CreateWriteStreamRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AppendRowsRequest. */ + interface IAppendRowsRequest { + + /** AppendRowsRequest writeStream */ + writeStream?: (string|null); + + /** AppendRowsRequest offset */ + offset?: (google.protobuf.IInt64Value|null); + + /** AppendRowsRequest protoRows */ + protoRows?: (google.cloud.bigquery.storage.v1.AppendRowsRequest.IProtoData|null); + + /** AppendRowsRequest traceId */ + traceId?: (string|null); + } + + /** Represents an AppendRowsRequest. */ + class AppendRowsRequest implements IAppendRowsRequest { /** - * Creates a new ReadSession instance using the specified properties. + * Constructs a new AppendRowsRequest. * @param [properties] Properties to set - * @returns ReadSession instance */ - public static create(properties?: google.cloud.bigquery.storage.v1.IReadSession): google.cloud.bigquery.storage.v1.ReadSession; + constructor(properties?: google.cloud.bigquery.storage.v1.IAppendRowsRequest); + + /** AppendRowsRequest writeStream. */ + public writeStream: string; + + /** AppendRowsRequest offset. */ + public offset?: (google.protobuf.IInt64Value|null); + + /** AppendRowsRequest protoRows. */ + public protoRows?: (google.cloud.bigquery.storage.v1.AppendRowsRequest.IProtoData|null); + + /** AppendRowsRequest traceId. */ + public traceId: string; + + /** AppendRowsRequest rows. */ + public rows?: "protoRows"; /** - * Encodes the specified ReadSession message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.verify|verify} messages. - * @param message ReadSession message or plain object to encode + * Creates a new AppendRowsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AppendRowsRequest instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.IAppendRowsRequest): google.cloud.bigquery.storage.v1.AppendRowsRequest; + + /** + * Encodes the specified AppendRowsRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1.AppendRowsRequest.verify|verify} messages. + * @param message AppendRowsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.bigquery.storage.v1.IReadSession, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.bigquery.storage.v1.IAppendRowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ReadSession message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.verify|verify} messages. - * @param message ReadSession message or plain object to encode + * Encodes the specified AppendRowsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.AppendRowsRequest.verify|verify} messages. + * @param message AppendRowsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IReadSession, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IAppendRowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReadSession message from the specified reader or buffer. + * Decodes an AppendRowsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ReadSession + * @returns AppendRowsRequest * @throws {Error} If the payload is not a 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.storage.v1.ReadSession; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1.AppendRowsRequest; /** - * Decodes a ReadSession message from the specified reader or buffer, length delimited. + * Decodes an AppendRowsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReadSession + * @returns AppendRowsRequest * @throws {Error} If the payload is 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.storage.v1.ReadSession; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1.AppendRowsRequest; /** - * Verifies a ReadSession message. + * Verifies an AppendRowsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ReadSession message from a plain object. Also converts values to their respective internal types. + * Creates an AppendRowsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ReadSession + * @returns AppendRowsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.ReadSession; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.AppendRowsRequest; /** - * Creates a plain object from a ReadSession message. Also converts values to other types if specified. - * @param message ReadSession + * Creates a plain object from an AppendRowsRequest message. Also converts values to other types if specified. + * @param message AppendRowsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.bigquery.storage.v1.ReadSession, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.bigquery.storage.v1.AppendRowsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ReadSession to JSON. + * Converts this AppendRowsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ReadSession { + namespace AppendRowsRequest { - /** Properties of a TableModifiers. */ - interface ITableModifiers { + /** Properties of a ProtoData. */ + interface IProtoData { - /** TableModifiers snapshotTime */ - snapshotTime?: (google.protobuf.ITimestamp|null); + /** ProtoData writerSchema */ + writerSchema?: (google.cloud.bigquery.storage.v1.IProtoSchema|null); + + /** ProtoData rows */ + rows?: (google.cloud.bigquery.storage.v1.IProtoRows|null); } - /** Represents a TableModifiers. */ - class TableModifiers implements ITableModifiers { + /** Represents a ProtoData. */ + class ProtoData implements IProtoData { /** - * Constructs a new TableModifiers. + * Constructs a new ProtoData. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers); + constructor(properties?: google.cloud.bigquery.storage.v1.AppendRowsRequest.IProtoData); - /** TableModifiers snapshotTime. */ - public snapshotTime?: (google.protobuf.ITimestamp|null); + /** ProtoData writerSchema. */ + public writerSchema?: (google.cloud.bigquery.storage.v1.IProtoSchema|null); + + /** ProtoData rows. */ + public rows?: (google.cloud.bigquery.storage.v1.IProtoRows|null); /** - * Creates a new TableModifiers instance using the specified properties. + * Creates a new ProtoData instance using the specified properties. * @param [properties] Properties to set - * @returns TableModifiers instance + * @returns ProtoData instance */ - public static create(properties?: google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers): google.cloud.bigquery.storage.v1.ReadSession.TableModifiers; + public static create(properties?: google.cloud.bigquery.storage.v1.AppendRowsRequest.IProtoData): google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData; /** - * Encodes the specified TableModifiers message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.verify|verify} messages. - * @param message TableModifiers message or plain object to encode + * Encodes the specified ProtoData message. Does not implicitly {@link google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData.verify|verify} messages. + * @param message ProtoData message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.bigquery.storage.v1.AppendRowsRequest.IProtoData, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TableModifiers message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.verify|verify} messages. - * @param message TableModifiers message or plain object to encode + * Encodes the specified ProtoData message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData.verify|verify} messages. + * @param message ProtoData message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.AppendRowsRequest.IProtoData, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TableModifiers message from the specified reader or buffer. + * Decodes a ProtoData message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TableModifiers + * @returns ProtoData * @throws {Error} If the payload is not a 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.storage.v1.ReadSession.TableModifiers; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData; /** - * Decodes a TableModifiers message from the specified reader or buffer, length delimited. + * Decodes a ProtoData message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TableModifiers + * @returns ProtoData * @throws {Error} If the payload is 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.storage.v1.ReadSession.TableModifiers; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData; /** - * Verifies a TableModifiers message. + * Verifies a ProtoData message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TableModifiers message from a plain object. Also converts values to their respective internal types. + * Creates a ProtoData message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TableModifiers + * @returns ProtoData */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.ReadSession.TableModifiers; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData; /** - * Creates a plain object from a TableModifiers message. Also converts values to other types if specified. - * @param message TableModifiers + * Creates a plain object from a ProtoData message. Also converts values to other types if specified. + * @param message ProtoData * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.bigquery.storage.v1.ReadSession.TableModifiers, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TableModifiers to JSON. + * Converts this ProtoData to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } - /** Properties of a TableReadOptions. */ - interface ITableReadOptions { + /** Properties of an AppendRowsResponse. */ + interface IAppendRowsResponse { - /** TableReadOptions selectedFields */ - selectedFields?: (string[]|null); + /** AppendRowsResponse appendResult */ + appendResult?: (google.cloud.bigquery.storage.v1.AppendRowsResponse.IAppendResult|null); - /** TableReadOptions rowRestriction */ - rowRestriction?: (string|null); + /** AppendRowsResponse error */ + error?: (google.rpc.IStatus|null); - /** TableReadOptions arrowSerializationOptions */ - arrowSerializationOptions?: (google.cloud.bigquery.storage.v1.IArrowSerializationOptions|null); + /** AppendRowsResponse updatedSchema */ + updatedSchema?: (google.cloud.bigquery.storage.v1.ITableSchema|null); + } + + /** Represents an AppendRowsResponse. */ + class AppendRowsResponse implements IAppendRowsResponse { + + /** + * Constructs a new AppendRowsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.IAppendRowsResponse); + + /** AppendRowsResponse appendResult. */ + public appendResult?: (google.cloud.bigquery.storage.v1.AppendRowsResponse.IAppendResult|null); + + /** AppendRowsResponse error. */ + public error?: (google.rpc.IStatus|null); + + /** AppendRowsResponse updatedSchema. */ + public updatedSchema?: (google.cloud.bigquery.storage.v1.ITableSchema|null); + + /** AppendRowsResponse response. */ + public response?: ("appendResult"|"error"); + + /** + * Creates a new AppendRowsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AppendRowsResponse instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.IAppendRowsResponse): google.cloud.bigquery.storage.v1.AppendRowsResponse; + + /** + * Encodes the specified AppendRowsResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1.AppendRowsResponse.verify|verify} messages. + * @param message AppendRowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.IAppendRowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AppendRowsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.AppendRowsResponse.verify|verify} messages. + * @param message AppendRowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IAppendRowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AppendRowsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AppendRowsResponse + * @throws {Error} If the payload is not a 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.storage.v1.AppendRowsResponse; + + /** + * Decodes an AppendRowsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AppendRowsResponse + * @throws {Error} If the payload is 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.storage.v1.AppendRowsResponse; + + /** + * Verifies an AppendRowsResponse message. + * @param message Plain 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 AppendRowsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AppendRowsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.AppendRowsResponse; + + /** + * Creates a plain object from an AppendRowsResponse message. Also converts values to other types if specified. + * @param message AppendRowsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.AppendRowsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AppendRowsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AppendRowsResponse { + + /** Properties of an AppendResult. */ + interface IAppendResult { + + /** AppendResult offset */ + offset?: (google.protobuf.IInt64Value|null); } - /** Represents a TableReadOptions. */ - class TableReadOptions implements ITableReadOptions { + /** Represents an AppendResult. */ + class AppendResult implements IAppendResult { /** - * Constructs a new TableReadOptions. + * Constructs a new AppendResult. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions); - - /** TableReadOptions selectedFields. */ - public selectedFields: string[]; - - /** TableReadOptions rowRestriction. */ - public rowRestriction: string; - - /** TableReadOptions arrowSerializationOptions. */ - public arrowSerializationOptions?: (google.cloud.bigquery.storage.v1.IArrowSerializationOptions|null); + constructor(properties?: google.cloud.bigquery.storage.v1.AppendRowsResponse.IAppendResult); - /** TableReadOptions outputFormatSerializationOptions. */ - public outputFormatSerializationOptions?: "arrowSerializationOptions"; + /** AppendResult offset. */ + public offset?: (google.protobuf.IInt64Value|null); /** - * Creates a new TableReadOptions instance using the specified properties. + * Creates a new AppendResult instance using the specified properties. * @param [properties] Properties to set - * @returns TableReadOptions instance + * @returns AppendResult instance */ - public static create(properties?: google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions): google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions; + public static create(properties?: google.cloud.bigquery.storage.v1.AppendRowsResponse.IAppendResult): google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult; /** - * Encodes the specified TableReadOptions message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.verify|verify} messages. - * @param message TableReadOptions message or plain object to encode + * Encodes the specified AppendResult message. Does not implicitly {@link google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult.verify|verify} messages. + * @param message AppendResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.bigquery.storage.v1.AppendRowsResponse.IAppendResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TableReadOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.verify|verify} messages. - * @param message TableReadOptions message or plain object to encode + * Encodes the specified AppendResult message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult.verify|verify} messages. + * @param message AppendResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.AppendRowsResponse.IAppendResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TableReadOptions message from the specified reader or buffer. + * Decodes an AppendResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TableReadOptions + * @returns AppendResult * @throws {Error} If the payload is not a 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.storage.v1.ReadSession.TableReadOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult; /** - * Decodes a TableReadOptions message from the specified reader or buffer, length delimited. + * Decodes an AppendResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TableReadOptions + * @returns AppendResult * @throws {Error} If the payload is 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.storage.v1.ReadSession.TableReadOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult; /** - * Verifies a TableReadOptions message. + * Verifies an AppendResult message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TableReadOptions message from a plain object. Also converts values to their respective internal types. + * Creates an AppendResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TableReadOptions + * @returns AppendResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult; /** - * Creates a plain object from a TableReadOptions message. Also converts values to other types if specified. - * @param message TableReadOptions + * Creates a plain object from an AppendResult message. Also converts values to other types if specified. + * @param message AppendResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TableReadOptions to JSON. + * Converts this AppendResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } } - /** Properties of a ReadStream. */ - interface IReadStream { + /** Properties of a GetWriteStreamRequest. */ + interface IGetWriteStreamRequest { - /** ReadStream name */ + /** GetWriteStreamRequest name */ name?: (string|null); } - /** Represents a ReadStream. */ - class ReadStream implements IReadStream { + /** Represents a GetWriteStreamRequest. */ + class GetWriteStreamRequest implements IGetWriteStreamRequest { /** - * Constructs a new ReadStream. + * Constructs a new GetWriteStreamRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.bigquery.storage.v1.IReadStream); + constructor(properties?: google.cloud.bigquery.storage.v1.IGetWriteStreamRequest); - /** ReadStream name. */ + /** GetWriteStreamRequest name. */ public name: string; /** - * Creates a new ReadStream instance using the specified properties. + * Creates a new GetWriteStreamRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ReadStream instance + * @returns GetWriteStreamRequest instance */ - public static create(properties?: google.cloud.bigquery.storage.v1.IReadStream): google.cloud.bigquery.storage.v1.ReadStream; + public static create(properties?: google.cloud.bigquery.storage.v1.IGetWriteStreamRequest): google.cloud.bigquery.storage.v1.GetWriteStreamRequest; /** - * Encodes the specified ReadStream message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadStream.verify|verify} messages. - * @param message ReadStream message or plain object to encode + * Encodes the specified GetWriteStreamRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1.GetWriteStreamRequest.verify|verify} messages. + * @param message GetWriteStreamRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.bigquery.storage.v1.IReadStream, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.bigquery.storage.v1.IGetWriteStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ReadStream message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadStream.verify|verify} messages. - * @param message ReadStream message or plain object to encode + * Encodes the specified GetWriteStreamRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.GetWriteStreamRequest.verify|verify} messages. + * @param message GetWriteStreamRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IReadStream, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IGetWriteStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReadStream message from the specified reader or buffer. + * Decodes a GetWriteStreamRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ReadStream + * @returns GetWriteStreamRequest * @throws {Error} If the payload is not a 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.storage.v1.ReadStream; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1.GetWriteStreamRequest; /** - * Decodes a ReadStream message from the specified reader or buffer, length delimited. + * Decodes a GetWriteStreamRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReadStream + * @returns GetWriteStreamRequest * @throws {Error} If the payload is 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.storage.v1.ReadStream; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1.GetWriteStreamRequest; /** - * Verifies a ReadStream message. + * Verifies a GetWriteStreamRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ReadStream message from a plain object. Also converts values to their respective internal types. + * Creates a GetWriteStreamRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ReadStream + * @returns GetWriteStreamRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.ReadStream; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.GetWriteStreamRequest; /** - * Creates a plain object from a ReadStream message. Also converts values to other types if specified. - * @param message ReadStream + * Creates a plain object from a GetWriteStreamRequest message. Also converts values to other types if specified. + * @param message GetWriteStreamRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.bigquery.storage.v1.ReadStream, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.bigquery.storage.v1.GetWriteStreamRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ReadStream to JSON. + * Converts this GetWriteStreamRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - } - /** Namespace v1beta1. */ - namespace v1beta1 { + /** Properties of a BatchCommitWriteStreamsRequest. */ + interface IBatchCommitWriteStreamsRequest { - /** Properties of an ArrowSchema. */ - interface IArrowSchema { + /** BatchCommitWriteStreamsRequest parent */ + parent?: (string|null); - /** ArrowSchema serializedSchema */ - serializedSchema?: (Uint8Array|string|null); + /** BatchCommitWriteStreamsRequest writeStreams */ + writeStreams?: (string[]|null); } - /** Represents an ArrowSchema. */ - class ArrowSchema implements IArrowSchema { + /** Represents a BatchCommitWriteStreamsRequest. */ + class BatchCommitWriteStreamsRequest implements IBatchCommitWriteStreamsRequest { /** - * Constructs a new ArrowSchema. + * Constructs a new BatchCommitWriteStreamsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.bigquery.storage.v1beta1.IArrowSchema); + constructor(properties?: google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest); - /** ArrowSchema serializedSchema. */ - public serializedSchema: (Uint8Array|string); + /** BatchCommitWriteStreamsRequest parent. */ + public parent: string; + + /** BatchCommitWriteStreamsRequest writeStreams. */ + public writeStreams: string[]; /** - * Creates a new ArrowSchema instance using the specified properties. + * Creates a new BatchCommitWriteStreamsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ArrowSchema instance + * @returns BatchCommitWriteStreamsRequest instance */ - public static create(properties?: google.cloud.bigquery.storage.v1beta1.IArrowSchema): google.cloud.bigquery.storage.v1beta1.ArrowSchema; + public static create(properties?: google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest): google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest; /** - * Encodes the specified ArrowSchema message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowSchema.verify|verify} messages. - * @param message ArrowSchema message or plain object to encode + * Encodes the specified BatchCommitWriteStreamsRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest.verify|verify} messages. + * @param message BatchCommitWriteStreamsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.bigquery.storage.v1beta1.IArrowSchema, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ArrowSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowSchema.verify|verify} messages. - * @param message ArrowSchema message or plain object to encode + * Encodes the specified BatchCommitWriteStreamsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest.verify|verify} messages. + * @param message BatchCommitWriteStreamsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IArrowSchema, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ArrowSchema message from the specified reader or buffer. + * Decodes a BatchCommitWriteStreamsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ArrowSchema + * @returns BatchCommitWriteStreamsRequest * @throws {Error} If the payload is not a 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.storage.v1beta1.ArrowSchema; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest; /** - * Decodes an ArrowSchema message from the specified reader or buffer, length delimited. + * Decodes a BatchCommitWriteStreamsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ArrowSchema + * @returns BatchCommitWriteStreamsRequest * @throws {Error} If the payload is 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.storage.v1beta1.ArrowSchema; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest; /** - * Verifies an ArrowSchema message. + * Verifies a BatchCommitWriteStreamsRequest message. * @param message Plain 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 ArrowSchema message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCommitWriteStreamsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ArrowSchema + * @returns BatchCommitWriteStreamsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.ArrowSchema; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest; /** - * Creates a plain object from an ArrowSchema message. Also converts values to other types if specified. - * @param message ArrowSchema + * Creates a plain object from a BatchCommitWriteStreamsRequest message. Also converts values to other types if specified. + * @param message BatchCommitWriteStreamsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.bigquery.storage.v1beta1.ArrowSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ArrowSchema to JSON. + * Converts this BatchCommitWriteStreamsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ArrowRecordBatch. */ - interface IArrowRecordBatch { + /** Properties of a BatchCommitWriteStreamsResponse. */ + interface IBatchCommitWriteStreamsResponse { - /** ArrowRecordBatch serializedRecordBatch */ - serializedRecordBatch?: (Uint8Array|string|null); + /** BatchCommitWriteStreamsResponse commitTime */ + commitTime?: (google.protobuf.ITimestamp|null); - /** ArrowRecordBatch rowCount */ - rowCount?: (number|Long|string|null); + /** BatchCommitWriteStreamsResponse streamErrors */ + streamErrors?: (google.cloud.bigquery.storage.v1.IStorageError[]|null); } - /** Represents an ArrowRecordBatch. */ - class ArrowRecordBatch implements IArrowRecordBatch { + /** Represents a BatchCommitWriteStreamsResponse. */ + class BatchCommitWriteStreamsResponse implements IBatchCommitWriteStreamsResponse { /** - * Constructs a new ArrowRecordBatch. + * Constructs a new BatchCommitWriteStreamsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch); + constructor(properties?: google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsResponse); - /** ArrowRecordBatch serializedRecordBatch. */ - public serializedRecordBatch: (Uint8Array|string); + /** BatchCommitWriteStreamsResponse commitTime. */ + public commitTime?: (google.protobuf.ITimestamp|null); - /** ArrowRecordBatch rowCount. */ - public rowCount: (number|Long|string); + /** BatchCommitWriteStreamsResponse streamErrors. */ + public streamErrors: google.cloud.bigquery.storage.v1.IStorageError[]; /** - * Creates a new ArrowRecordBatch instance using the specified properties. + * Creates a new BatchCommitWriteStreamsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ArrowRecordBatch instance + * @returns BatchCommitWriteStreamsResponse instance */ - public static create(properties?: google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch): google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch; + public static create(properties?: google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsResponse): google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse; /** - * Encodes the specified ArrowRecordBatch message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.verify|verify} messages. - * @param message ArrowRecordBatch message or plain object to encode + * Encodes the specified BatchCommitWriteStreamsResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse.verify|verify} messages. + * @param message BatchCommitWriteStreamsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ArrowRecordBatch message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.verify|verify} messages. - * @param message ArrowRecordBatch message or plain object to encode + * Encodes the specified BatchCommitWriteStreamsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse.verify|verify} messages. + * @param message BatchCommitWriteStreamsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ArrowRecordBatch message from the specified reader or buffer. + * Decodes a BatchCommitWriteStreamsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ArrowRecordBatch + * @returns BatchCommitWriteStreamsResponse * @throws {Error} If the payload is not a 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.storage.v1beta1.ArrowRecordBatch; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse; /** - * Decodes an ArrowRecordBatch message from the specified reader or buffer, length delimited. + * Decodes a BatchCommitWriteStreamsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ArrowRecordBatch + * @returns BatchCommitWriteStreamsResponse * @throws {Error} If the payload is 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.storage.v1beta1.ArrowRecordBatch; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse; /** - * Verifies an ArrowRecordBatch message. + * Verifies a BatchCommitWriteStreamsResponse message. * @param message Plain 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 ArrowRecordBatch message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCommitWriteStreamsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ArrowRecordBatch + * @returns BatchCommitWriteStreamsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse; /** - * Creates a plain object from an ArrowRecordBatch message. Also converts values to other types if specified. - * @param message ArrowRecordBatch + * Creates a plain object from a BatchCommitWriteStreamsResponse message. Also converts values to other types if specified. + * @param message BatchCommitWriteStreamsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ArrowRecordBatch to JSON. + * Converts this BatchCommitWriteStreamsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AvroSchema. */ - interface IAvroSchema { + /** Properties of a FinalizeWriteStreamRequest. */ + interface IFinalizeWriteStreamRequest { - /** AvroSchema schema */ - schema?: (string|null); + /** FinalizeWriteStreamRequest name */ + name?: (string|null); } - /** Represents an AvroSchema. */ - class AvroSchema implements IAvroSchema { + /** Represents a FinalizeWriteStreamRequest. */ + class FinalizeWriteStreamRequest implements IFinalizeWriteStreamRequest { /** - * Constructs a new AvroSchema. + * Constructs a new FinalizeWriteStreamRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.bigquery.storage.v1beta1.IAvroSchema); + constructor(properties?: google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest); - /** AvroSchema schema. */ - public schema: string; + /** FinalizeWriteStreamRequest name. */ + public name: string; /** - * Creates a new AvroSchema instance using the specified properties. + * Creates a new FinalizeWriteStreamRequest instance using the specified properties. * @param [properties] Properties to set - * @returns AvroSchema instance + * @returns FinalizeWriteStreamRequest instance */ - public static create(properties?: google.cloud.bigquery.storage.v1beta1.IAvroSchema): google.cloud.bigquery.storage.v1beta1.AvroSchema; + public static create(properties?: google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest): google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest; /** - * Encodes the specified AvroSchema message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroSchema.verify|verify} messages. - * @param message AvroSchema message or plain object to encode + * Encodes the specified FinalizeWriteStreamRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest.verify|verify} messages. + * @param message FinalizeWriteStreamRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.bigquery.storage.v1beta1.IAvroSchema, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AvroSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroSchema.verify|verify} messages. - * @param message AvroSchema message or plain object to encode + * Encodes the specified FinalizeWriteStreamRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest.verify|verify} messages. + * @param message FinalizeWriteStreamRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IAvroSchema, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AvroSchema message from the specified reader or buffer. + * Decodes a FinalizeWriteStreamRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AvroSchema + * @returns FinalizeWriteStreamRequest * @throws {Error} If the payload is not a 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.storage.v1beta1.AvroSchema; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest; /** - * Decodes an AvroSchema message from the specified reader or buffer, length delimited. + * Decodes a FinalizeWriteStreamRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AvroSchema + * @returns FinalizeWriteStreamRequest * @throws {Error} If the payload is 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.storage.v1beta1.AvroSchema; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest; /** - * Verifies an AvroSchema message. + * Verifies a FinalizeWriteStreamRequest message. * @param message Plain 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 AvroSchema message from a plain object. Also converts values to their respective internal types. + * Creates a FinalizeWriteStreamRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AvroSchema + * @returns FinalizeWriteStreamRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.AvroSchema; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest; /** - * Creates a plain object from an AvroSchema message. Also converts values to other types if specified. - * @param message AvroSchema + * Creates a plain object from a FinalizeWriteStreamRequest message. Also converts values to other types if specified. + * @param message FinalizeWriteStreamRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.bigquery.storage.v1beta1.AvroSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AvroSchema to JSON. + * Converts this FinalizeWriteStreamRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AvroRows. */ - interface IAvroRows { - - /** AvroRows serializedBinaryRows */ - serializedBinaryRows?: (Uint8Array|string|null); + /** Properties of a FinalizeWriteStreamResponse. */ + interface IFinalizeWriteStreamResponse { - /** AvroRows rowCount */ + /** FinalizeWriteStreamResponse rowCount */ rowCount?: (number|Long|string|null); } - /** Represents an AvroRows. */ - class AvroRows implements IAvroRows { + /** Represents a FinalizeWriteStreamResponse. */ + class FinalizeWriteStreamResponse implements IFinalizeWriteStreamResponse { /** - * Constructs a new AvroRows. + * Constructs a new FinalizeWriteStreamResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.bigquery.storage.v1beta1.IAvroRows); - - /** AvroRows serializedBinaryRows. */ - public serializedBinaryRows: (Uint8Array|string); + constructor(properties?: google.cloud.bigquery.storage.v1.IFinalizeWriteStreamResponse); - /** AvroRows rowCount. */ + /** FinalizeWriteStreamResponse rowCount. */ public rowCount: (number|Long|string); /** - * Creates a new AvroRows instance using the specified properties. + * Creates a new FinalizeWriteStreamResponse instance using the specified properties. * @param [properties] Properties to set - * @returns AvroRows instance + * @returns FinalizeWriteStreamResponse instance */ - public static create(properties?: google.cloud.bigquery.storage.v1beta1.IAvroRows): google.cloud.bigquery.storage.v1beta1.AvroRows; + public static create(properties?: google.cloud.bigquery.storage.v1.IFinalizeWriteStreamResponse): google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse; /** - * Encodes the specified AvroRows message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroRows.verify|verify} messages. - * @param message AvroRows message or plain object to encode + * Encodes the specified FinalizeWriteStreamResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse.verify|verify} messages. + * @param message FinalizeWriteStreamResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.bigquery.storage.v1beta1.IAvroRows, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.bigquery.storage.v1.IFinalizeWriteStreamResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AvroRows message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroRows.verify|verify} messages. - * @param message AvroRows message or plain object to encode + * Encodes the specified FinalizeWriteStreamResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse.verify|verify} messages. + * @param message FinalizeWriteStreamResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IAvroRows, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IFinalizeWriteStreamResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AvroRows message from the specified reader or buffer. + * Decodes a FinalizeWriteStreamResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AvroRows + * @returns FinalizeWriteStreamResponse * @throws {Error} If the payload is not a 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.storage.v1beta1.AvroRows; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse; /** - * Decodes an AvroRows message from the specified reader or buffer, length delimited. + * Decodes a FinalizeWriteStreamResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AvroRows + * @returns FinalizeWriteStreamResponse * @throws {Error} If the payload is 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.storage.v1beta1.AvroRows; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse; /** - * Verifies an AvroRows message. + * Verifies a FinalizeWriteStreamResponse message. * @param message Plain 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 AvroRows message from a plain object. Also converts values to their respective internal types. + * Creates a FinalizeWriteStreamResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AvroRows + * @returns FinalizeWriteStreamResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.AvroRows; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse; /** - * Creates a plain object from an AvroRows message. Also converts values to other types if specified. - * @param message AvroRows + * Creates a plain object from a FinalizeWriteStreamResponse message. Also converts values to other types if specified. + * @param message FinalizeWriteStreamResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.bigquery.storage.v1beta1.AvroRows, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AvroRows to JSON. + * Converts this FinalizeWriteStreamResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TableReadOptions. */ - interface ITableReadOptions { + /** Properties of a FlushRowsRequest. */ + interface IFlushRowsRequest { - /** TableReadOptions selectedFields */ - selectedFields?: (string[]|null); + /** FlushRowsRequest writeStream */ + writeStream?: (string|null); - /** TableReadOptions rowRestriction */ - rowRestriction?: (string|null); + /** FlushRowsRequest offset */ + offset?: (google.protobuf.IInt64Value|null); } - /** Represents a TableReadOptions. */ - class TableReadOptions implements ITableReadOptions { + /** Represents a FlushRowsRequest. */ + class FlushRowsRequest implements IFlushRowsRequest { /** - * Constructs a new TableReadOptions. + * Constructs a new FlushRowsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.bigquery.storage.v1beta1.ITableReadOptions); + constructor(properties?: google.cloud.bigquery.storage.v1.IFlushRowsRequest); - /** TableReadOptions selectedFields. */ - public selectedFields: string[]; + /** FlushRowsRequest writeStream. */ + public writeStream: string; - /** TableReadOptions rowRestriction. */ - public rowRestriction: string; + /** FlushRowsRequest offset. */ + public offset?: (google.protobuf.IInt64Value|null); /** - * Creates a new TableReadOptions instance using the specified properties. + * Creates a new FlushRowsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TableReadOptions instance + * @returns FlushRowsRequest instance */ - public static create(properties?: google.cloud.bigquery.storage.v1beta1.ITableReadOptions): google.cloud.bigquery.storage.v1beta1.TableReadOptions; + public static create(properties?: google.cloud.bigquery.storage.v1.IFlushRowsRequest): google.cloud.bigquery.storage.v1.FlushRowsRequest; /** - * Encodes the specified TableReadOptions message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableReadOptions.verify|verify} messages. - * @param message TableReadOptions message or plain object to encode + * Encodes the specified FlushRowsRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1.FlushRowsRequest.verify|verify} messages. + * @param message FlushRowsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.bigquery.storage.v1beta1.ITableReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.bigquery.storage.v1.IFlushRowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TableReadOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableReadOptions.verify|verify} messages. - * @param message TableReadOptions message or plain object to encode + * Encodes the specified FlushRowsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.FlushRowsRequest.verify|verify} messages. + * @param message FlushRowsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.ITableReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IFlushRowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TableReadOptions message from the specified reader or buffer. + * Decodes a FlushRowsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TableReadOptions + * @returns FlushRowsRequest * @throws {Error} If the payload is not a 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.storage.v1beta1.TableReadOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1.FlushRowsRequest; /** - * Decodes a TableReadOptions message from the specified reader or buffer, length delimited. + * Decodes a FlushRowsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TableReadOptions + * @returns FlushRowsRequest * @throws {Error} If the payload is 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.storage.v1beta1.TableReadOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1.FlushRowsRequest; /** - * Verifies a TableReadOptions message. + * Verifies a FlushRowsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TableReadOptions message from a plain object. Also converts values to their respective internal types. + * Creates a FlushRowsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TableReadOptions + * @returns FlushRowsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.TableReadOptions; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.FlushRowsRequest; /** - * Creates a plain object from a TableReadOptions message. Also converts values to other types if specified. - * @param message TableReadOptions + * Creates a plain object from a FlushRowsRequest message. Also converts values to other types if specified. + * @param message FlushRowsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.bigquery.storage.v1beta1.TableReadOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.bigquery.storage.v1.FlushRowsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TableReadOptions to JSON. + * Converts this FlushRowsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Represents a BigQueryStorage */ - class BigQueryStorage extends $protobuf.rpc.Service { + /** Properties of a FlushRowsResponse. */ + interface IFlushRowsResponse { + + /** FlushRowsResponse offset */ + offset?: (number|Long|string|null); + } + + /** Represents a FlushRowsResponse. */ + class FlushRowsResponse implements IFlushRowsResponse { /** - * Constructs a new BigQueryStorage service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Constructs a new FlushRowsResponse. + * @param [properties] Properties to set */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + constructor(properties?: google.cloud.bigquery.storage.v1.IFlushRowsResponse); + + /** FlushRowsResponse offset. */ + public offset: (number|Long|string); /** - * Creates new BigQueryStorage service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. + * Creates a new FlushRowsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FlushRowsResponse instance */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): BigQueryStorage; + public static create(properties?: google.cloud.bigquery.storage.v1.IFlushRowsResponse): google.cloud.bigquery.storage.v1.FlushRowsResponse; /** - * Calls CreateReadSession. - * @param request CreateReadSessionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ReadSession + * Encodes the specified FlushRowsResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1.FlushRowsResponse.verify|verify} messages. + * @param message FlushRowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createReadSession(request: google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, callback: google.cloud.bigquery.storage.v1beta1.BigQueryStorage.CreateReadSessionCallback): void; + public static encode(message: google.cloud.bigquery.storage.v1.IFlushRowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateReadSession. - * @param request CreateReadSessionRequest message or plain object - * @returns Promise + * Encodes the specified FlushRowsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.FlushRowsResponse.verify|verify} messages. + * @param message FlushRowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createReadSession(request: google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest): Promise; + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IFlushRowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ReadRows. - * @param request ReadRowsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ReadRowsResponse + * Decodes a FlushRowsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FlushRowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public readRows(request: google.cloud.bigquery.storage.v1beta1.IReadRowsRequest, callback: google.cloud.bigquery.storage.v1beta1.BigQueryStorage.ReadRowsCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1.FlushRowsResponse; /** - * Calls ReadRows. - * @param request ReadRowsRequest message or plain object - * @returns Promise + * Decodes a FlushRowsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FlushRowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public readRows(request: google.cloud.bigquery.storage.v1beta1.IReadRowsRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1.FlushRowsResponse; /** - * Calls BatchCreateReadSessionStreams. - * @param request BatchCreateReadSessionStreamsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchCreateReadSessionStreamsResponse + * Verifies a FlushRowsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public batchCreateReadSessionStreams(request: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, callback: google.cloud.bigquery.storage.v1beta1.BigQueryStorage.BatchCreateReadSessionStreamsCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls BatchCreateReadSessionStreams. - * @param request BatchCreateReadSessionStreamsRequest message or plain object - * @returns Promise + * Creates a FlushRowsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FlushRowsResponse */ - public batchCreateReadSessionStreams(request: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.FlushRowsResponse; /** - * Calls FinalizeStream. - * @param request FinalizeStreamRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Creates a plain object from a FlushRowsResponse message. Also converts values to other types if specified. + * @param message FlushRowsResponse + * @param [options] Conversion options + * @returns Plain object */ - public finalizeStream(request: google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, callback: google.cloud.bigquery.storage.v1beta1.BigQueryStorage.FinalizeStreamCallback): void; + public static toObject(message: google.cloud.bigquery.storage.v1.FlushRowsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls FinalizeStream. - * @param request FinalizeStreamRequest message or plain object - * @returns Promise - */ - public finalizeStream(request: google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest): Promise; - - /** - * Calls SplitReadStream. - * @param request SplitReadStreamRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SplitReadStreamResponse - */ - public splitReadStream(request: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, callback: google.cloud.bigquery.storage.v1beta1.BigQueryStorage.SplitReadStreamCallback): void; - - /** - * Calls SplitReadStream. - * @param request SplitReadStreamRequest message or plain object - * @returns Promise + * Converts this FlushRowsResponse to JSON. + * @returns JSON object */ - public splitReadStream(request: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest): Promise; + public toJSON(): { [k: string]: any }; } - namespace BigQueryStorage { - - /** - * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#createReadSession}. - * @param error Error, if any - * @param [response] ReadSession - */ - type CreateReadSessionCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1beta1.ReadSession) => void; - - /** - * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#readRows}. - * @param error Error, if any - * @param [response] ReadRowsResponse - */ - type ReadRowsCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1beta1.ReadRowsResponse) => void; - - /** - * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#batchCreateReadSessionStreams}. - * @param error Error, if any - * @param [response] BatchCreateReadSessionStreamsResponse - */ - type BatchCreateReadSessionStreamsCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse) => void; - - /** - * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#finalizeStream}. - * @param error Error, if any - * @param [response] Empty - */ - type FinalizeStreamCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + /** Properties of a StorageError. */ + interface IStorageError { - /** - * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#splitReadStream}. - * @param error Error, if any - * @param [response] SplitReadStreamResponse - */ - type SplitReadStreamCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse) => void; - } + /** StorageError code */ + code?: (google.cloud.bigquery.storage.v1.StorageError.StorageErrorCode|keyof typeof google.cloud.bigquery.storage.v1.StorageError.StorageErrorCode|null); - /** Properties of a Stream. */ - interface IStream { + /** StorageError entity */ + entity?: (string|null); - /** Stream name */ - name?: (string|null); + /** StorageError errorMessage */ + errorMessage?: (string|null); } - /** Represents a Stream. */ - class Stream implements IStream { + /** Represents a StorageError. */ + class StorageError implements IStorageError { /** - * Constructs a new Stream. + * Constructs a new StorageError. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.bigquery.storage.v1beta1.IStream); + constructor(properties?: google.cloud.bigquery.storage.v1.IStorageError); - /** Stream name. */ - public name: string; + /** StorageError code. */ + public code: (google.cloud.bigquery.storage.v1.StorageError.StorageErrorCode|keyof typeof google.cloud.bigquery.storage.v1.StorageError.StorageErrorCode); + + /** StorageError entity. */ + public entity: string; + + /** StorageError errorMessage. */ + public errorMessage: string; /** - * Creates a new Stream instance using the specified properties. + * Creates a new StorageError instance using the specified properties. * @param [properties] Properties to set - * @returns Stream instance + * @returns StorageError instance */ - public static create(properties?: google.cloud.bigquery.storage.v1beta1.IStream): google.cloud.bigquery.storage.v1beta1.Stream; + public static create(properties?: google.cloud.bigquery.storage.v1.IStorageError): google.cloud.bigquery.storage.v1.StorageError; /** - * Encodes the specified Stream message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Stream.verify|verify} messages. - * @param message Stream message or plain object to encode + * Encodes the specified StorageError message. Does not implicitly {@link google.cloud.bigquery.storage.v1.StorageError.verify|verify} messages. + * @param message StorageError message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.bigquery.storage.v1beta1.IStream, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.bigquery.storage.v1.IStorageError, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Stream message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Stream.verify|verify} messages. - * @param message Stream message or plain object to encode + * Encodes the specified StorageError message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.StorageError.verify|verify} messages. + * @param message StorageError message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IStream, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IStorageError, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Stream message from the specified reader or buffer. + * Decodes a StorageError message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Stream + * @returns StorageError * @throws {Error} If the payload is not a 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.storage.v1beta1.Stream; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1.StorageError; /** - * Decodes a Stream message from the specified reader or buffer, length delimited. + * Decodes a StorageError message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Stream + * @returns StorageError * @throws {Error} If the payload is 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.storage.v1beta1.Stream; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1.StorageError; /** - * Verifies a Stream message. + * Verifies a StorageError message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Stream message from a plain object. Also converts values to their respective internal types. + * Creates a StorageError message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Stream + * @returns StorageError */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.Stream; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.StorageError; /** - * Creates a plain object from a Stream message. Also converts values to other types if specified. - * @param message Stream + * Creates a plain object from a StorageError message. Also converts values to other types if specified. + * @param message StorageError * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.bigquery.storage.v1beta1.Stream, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.bigquery.storage.v1.StorageError, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Stream to JSON. + * Converts this StorageError to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a StreamPosition. */ - interface IStreamPosition { - - /** StreamPosition stream */ - stream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); - - /** StreamPosition offset */ - offset?: (number|Long|string|null); + namespace StorageError { + + /** StorageErrorCode enum. */ + enum StorageErrorCode { + STORAGE_ERROR_CODE_UNSPECIFIED = 0, + TABLE_NOT_FOUND = 1, + STREAM_ALREADY_COMMITTED = 2, + STREAM_NOT_FOUND = 3, + INVALID_STREAM_TYPE = 4, + INVALID_STREAM_STATE = 5, + STREAM_FINALIZED = 6, + SCHEMA_MISMATCH_EXTRA_FIELDS = 7 + } } - /** Represents a StreamPosition. */ - class StreamPosition implements IStreamPosition { - - /** - * Constructs a new StreamPosition. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.bigquery.storage.v1beta1.IStreamPosition); - - /** StreamPosition stream. */ - public stream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); - - /** StreamPosition offset. */ - public offset: (number|Long|string); - - /** - * Creates a new StreamPosition instance using the specified properties. - * @param [properties] Properties to set - * @returns StreamPosition instance - */ - public static create(properties?: google.cloud.bigquery.storage.v1beta1.IStreamPosition): google.cloud.bigquery.storage.v1beta1.StreamPosition; - - /** - * Encodes the specified StreamPosition message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamPosition.verify|verify} messages. - * @param message StreamPosition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.bigquery.storage.v1beta1.IStreamPosition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StreamPosition message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamPosition.verify|verify} messages. - * @param message StreamPosition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IStreamPosition, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StreamPosition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StreamPosition - * @throws {Error} If the payload is not a 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.storage.v1beta1.StreamPosition; - - /** - * Decodes a StreamPosition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StreamPosition - * @throws {Error} If the payload is 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.storage.v1beta1.StreamPosition; - - /** - * Verifies a StreamPosition message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StreamPosition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StreamPosition - */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.StreamPosition; - - /** - * Creates a plain object from a StreamPosition message. Also converts values to other types if specified. - * @param message StreamPosition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.bigquery.storage.v1beta1.StreamPosition, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StreamPosition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** DataFormat enum. */ + enum DataFormat { + DATA_FORMAT_UNSPECIFIED = 0, + AVRO = 1, + ARROW = 2 } /** Properties of a ReadSession. */ @@ -2627,23 +3004,29 @@ export namespace google { /** ReadSession expireTime */ expireTime?: (google.protobuf.ITimestamp|null); + /** ReadSession dataFormat */ + dataFormat?: (google.cloud.bigquery.storage.v1.DataFormat|keyof typeof google.cloud.bigquery.storage.v1.DataFormat|null); + /** ReadSession avroSchema */ - avroSchema?: (google.cloud.bigquery.storage.v1beta1.IAvroSchema|null); + avroSchema?: (google.cloud.bigquery.storage.v1.IAvroSchema|null); /** ReadSession arrowSchema */ - arrowSchema?: (google.cloud.bigquery.storage.v1beta1.IArrowSchema|null); - - /** ReadSession streams */ - streams?: (google.cloud.bigquery.storage.v1beta1.IStream[]|null); + arrowSchema?: (google.cloud.bigquery.storage.v1.IArrowSchema|null); - /** ReadSession tableReference */ - tableReference?: (google.cloud.bigquery.storage.v1beta1.ITableReference|null); + /** ReadSession table */ + table?: (string|null); /** ReadSession tableModifiers */ - tableModifiers?: (google.cloud.bigquery.storage.v1beta1.ITableModifiers|null); + tableModifiers?: (google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers|null); - /** ReadSession shardingStrategy */ - shardingStrategy?: (google.cloud.bigquery.storage.v1beta1.ShardingStrategy|keyof typeof google.cloud.bigquery.storage.v1beta1.ShardingStrategy|null); + /** ReadSession readOptions */ + readOptions?: (google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions|null); + + /** ReadSession streams */ + streams?: (google.cloud.bigquery.storage.v1.IReadStream[]|null); + + /** ReadSession estimatedTotalBytesScanned */ + estimatedTotalBytesScanned?: (number|Long|string|null); } /** Represents a ReadSession. */ @@ -2653,7 +3036,7 @@ export namespace google { * Constructs a new ReadSession. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.bigquery.storage.v1beta1.IReadSession); + constructor(properties?: google.cloud.bigquery.storage.v1.IReadSession); /** ReadSession name. */ public name: string; @@ -2661,23 +3044,29 @@ export namespace google { /** ReadSession expireTime. */ public expireTime?: (google.protobuf.ITimestamp|null); + /** ReadSession dataFormat. */ + public dataFormat: (google.cloud.bigquery.storage.v1.DataFormat|keyof typeof google.cloud.bigquery.storage.v1.DataFormat); + /** ReadSession avroSchema. */ - public avroSchema?: (google.cloud.bigquery.storage.v1beta1.IAvroSchema|null); + public avroSchema?: (google.cloud.bigquery.storage.v1.IAvroSchema|null); /** ReadSession arrowSchema. */ - public arrowSchema?: (google.cloud.bigquery.storage.v1beta1.IArrowSchema|null); - - /** ReadSession streams. */ - public streams: google.cloud.bigquery.storage.v1beta1.IStream[]; + public arrowSchema?: (google.cloud.bigquery.storage.v1.IArrowSchema|null); - /** ReadSession tableReference. */ - public tableReference?: (google.cloud.bigquery.storage.v1beta1.ITableReference|null); + /** ReadSession table. */ + public table: string; /** ReadSession tableModifiers. */ - public tableModifiers?: (google.cloud.bigquery.storage.v1beta1.ITableModifiers|null); + public tableModifiers?: (google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers|null); - /** ReadSession shardingStrategy. */ - public shardingStrategy: (google.cloud.bigquery.storage.v1beta1.ShardingStrategy|keyof typeof google.cloud.bigquery.storage.v1beta1.ShardingStrategy); + /** ReadSession readOptions. */ + public readOptions?: (google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions|null); + + /** ReadSession streams. */ + public streams: google.cloud.bigquery.storage.v1.IReadStream[]; + + /** ReadSession estimatedTotalBytesScanned. */ + public estimatedTotalBytesScanned: (number|Long|string); /** ReadSession schema. */ public schema?: ("avroSchema"|"arrowSchema"); @@ -2687,23 +3076,23 @@ export namespace google { * @param [properties] Properties to set * @returns ReadSession instance */ - public static create(properties?: google.cloud.bigquery.storage.v1beta1.IReadSession): google.cloud.bigquery.storage.v1beta1.ReadSession; + public static create(properties?: google.cloud.bigquery.storage.v1.IReadSession): google.cloud.bigquery.storage.v1.ReadSession; /** - * Encodes the specified ReadSession message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadSession.verify|verify} messages. + * Encodes the specified ReadSession message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.verify|verify} messages. * @param message ReadSession message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.bigquery.storage.v1beta1.IReadSession, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.bigquery.storage.v1.IReadSession, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ReadSession message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadSession.verify|verify} messages. + * Encodes the specified ReadSession message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.verify|verify} messages. * @param message ReadSession message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IReadSession, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IReadSession, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a ReadSession message from the specified reader or buffer. @@ -2713,7 +3102,7 @@ export namespace google { * @throws {Error} If the payload is not a 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.storage.v1beta1.ReadSession; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1.ReadSession; /** * Decodes a ReadSession message from the specified reader or buffer, length delimited. @@ -2722,7 +3111,7 @@ export namespace google { * @throws {Error} If the payload is 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.storage.v1beta1.ReadSession; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1.ReadSession; /** * Verifies a ReadSession message. @@ -2736,7 +3125,7 @@ export namespace google { * @param object Plain object * @returns ReadSession */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.ReadSession; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.ReadSession; /** * Creates a plain object from a ReadSession message. Also converts values to other types if specified. @@ -2744,7 +3133,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.bigquery.storage.v1beta1.ReadSession, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.bigquery.storage.v1.ReadSession, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this ReadSession to JSON. @@ -2753,5207 +3142,7807 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Properties of a CreateReadSessionRequest. */ - interface ICreateReadSessionRequest { + namespace ReadSession { - /** CreateReadSessionRequest tableReference */ - tableReference?: (google.cloud.bigquery.storage.v1beta1.ITableReference|null); + /** Properties of a TableModifiers. */ + interface ITableModifiers { - /** CreateReadSessionRequest parent */ - parent?: (string|null); + /** TableModifiers snapshotTime */ + snapshotTime?: (google.protobuf.ITimestamp|null); + } - /** CreateReadSessionRequest tableModifiers */ - tableModifiers?: (google.cloud.bigquery.storage.v1beta1.ITableModifiers|null); + /** Represents a TableModifiers. */ + class TableModifiers implements ITableModifiers { - /** CreateReadSessionRequest requestedStreams */ - requestedStreams?: (number|null); + /** + * Constructs a new TableModifiers. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers); - /** CreateReadSessionRequest readOptions */ - readOptions?: (google.cloud.bigquery.storage.v1beta1.ITableReadOptions|null); + /** TableModifiers snapshotTime. */ + public snapshotTime?: (google.protobuf.ITimestamp|null); - /** CreateReadSessionRequest format */ - format?: (google.cloud.bigquery.storage.v1beta1.DataFormat|keyof typeof google.cloud.bigquery.storage.v1beta1.DataFormat|null); + /** + * Creates a new TableModifiers instance using the specified properties. + * @param [properties] Properties to set + * @returns TableModifiers instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers): google.cloud.bigquery.storage.v1.ReadSession.TableModifiers; - /** CreateReadSessionRequest shardingStrategy */ - shardingStrategy?: (google.cloud.bigquery.storage.v1beta1.ShardingStrategy|keyof typeof google.cloud.bigquery.storage.v1beta1.ShardingStrategy|null); - } + /** + * Encodes the specified TableModifiers message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.verify|verify} messages. + * @param message TableModifiers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a CreateReadSessionRequest. */ - class CreateReadSessionRequest implements ICreateReadSessionRequest { + /** + * Encodes the specified TableModifiers message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.verify|verify} messages. + * @param message TableModifiers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new CreateReadSessionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest); + /** + * Decodes a TableModifiers message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableModifiers + * @throws {Error} If the payload is not a 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.storage.v1.ReadSession.TableModifiers; - /** CreateReadSessionRequest tableReference. */ - public tableReference?: (google.cloud.bigquery.storage.v1beta1.ITableReference|null); + /** + * Decodes a TableModifiers message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableModifiers + * @throws {Error} If the payload is 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.storage.v1.ReadSession.TableModifiers; - /** CreateReadSessionRequest parent. */ - public parent: string; + /** + * Verifies a TableModifiers message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** CreateReadSessionRequest tableModifiers. */ - public tableModifiers?: (google.cloud.bigquery.storage.v1beta1.ITableModifiers|null); + /** + * Creates a TableModifiers message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableModifiers + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.ReadSession.TableModifiers; - /** CreateReadSessionRequest requestedStreams. */ - public requestedStreams: number; + /** + * Creates a plain object from a TableModifiers message. Also converts values to other types if specified. + * @param message TableModifiers + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.ReadSession.TableModifiers, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** CreateReadSessionRequest readOptions. */ - public readOptions?: (google.cloud.bigquery.storage.v1beta1.ITableReadOptions|null); + /** + * Converts this TableModifiers to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** CreateReadSessionRequest format. */ - public format: (google.cloud.bigquery.storage.v1beta1.DataFormat|keyof typeof google.cloud.bigquery.storage.v1beta1.DataFormat); + /** Properties of a TableReadOptions. */ + interface ITableReadOptions { - /** CreateReadSessionRequest shardingStrategy. */ - public shardingStrategy: (google.cloud.bigquery.storage.v1beta1.ShardingStrategy|keyof typeof google.cloud.bigquery.storage.v1beta1.ShardingStrategy); + /** TableReadOptions selectedFields */ + selectedFields?: (string[]|null); + + /** TableReadOptions rowRestriction */ + rowRestriction?: (string|null); + + /** TableReadOptions arrowSerializationOptions */ + arrowSerializationOptions?: (google.cloud.bigquery.storage.v1.IArrowSerializationOptions|null); + } + + /** Represents a TableReadOptions. */ + class TableReadOptions implements ITableReadOptions { + + /** + * Constructs a new TableReadOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions); + + /** TableReadOptions selectedFields. */ + public selectedFields: string[]; + + /** TableReadOptions rowRestriction. */ + public rowRestriction: string; + + /** TableReadOptions arrowSerializationOptions. */ + public arrowSerializationOptions?: (google.cloud.bigquery.storage.v1.IArrowSerializationOptions|null); + + /** TableReadOptions outputFormatSerializationOptions. */ + public outputFormatSerializationOptions?: "arrowSerializationOptions"; + + /** + * Creates a new TableReadOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns TableReadOptions instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions): google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions; + + /** + * Encodes the specified TableReadOptions message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.verify|verify} messages. + * @param message TableReadOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableReadOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.verify|verify} messages. + * @param message TableReadOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableReadOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableReadOptions + * @throws {Error} If the payload is not a 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.storage.v1.ReadSession.TableReadOptions; + + /** + * Decodes a TableReadOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableReadOptions + * @throws {Error} If the payload is 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.storage.v1.ReadSession.TableReadOptions; + + /** + * Verifies a TableReadOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableReadOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableReadOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions; + + /** + * Creates a plain object from a TableReadOptions message. Also converts values to other types if specified. + * @param message TableReadOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableReadOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a ReadStream. */ + interface IReadStream { + + /** ReadStream name */ + name?: (string|null); + } + + /** Represents a ReadStream. */ + class ReadStream implements IReadStream { /** - * Creates a new CreateReadSessionRequest instance using the specified properties. + * Constructs a new ReadStream. * @param [properties] Properties to set - * @returns CreateReadSessionRequest instance */ - public static create(properties?: google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest): google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest; + constructor(properties?: google.cloud.bigquery.storage.v1.IReadStream); + + /** ReadStream name. */ + public name: string; /** - * Encodes the specified CreateReadSessionRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest.verify|verify} messages. - * @param message CreateReadSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Creates a new ReadStream instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadStream instance */ - public static encode(message: google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static create(properties?: google.cloud.bigquery.storage.v1.IReadStream): google.cloud.bigquery.storage.v1.ReadStream; /** - * Encodes the specified CreateReadSessionRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest.verify|verify} messages. - * @param message CreateReadSessionRequest message or plain object to encode + * Encodes the specified ReadStream message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadStream.verify|verify} messages. + * @param message ReadStream message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.bigquery.storage.v1.IReadStream, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateReadSessionRequest message from the specified reader or buffer. + * Encodes the specified ReadStream message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadStream.verify|verify} messages. + * @param message ReadStream message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IReadStream, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadStream message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateReadSessionRequest + * @returns ReadStream * @throws {Error} If the payload is not a 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.storage.v1beta1.CreateReadSessionRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1.ReadStream; /** - * Decodes a CreateReadSessionRequest message from the specified reader or buffer, length delimited. + * Decodes a ReadStream message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateReadSessionRequest + * @returns ReadStream * @throws {Error} If the payload is 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.storage.v1beta1.CreateReadSessionRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1.ReadStream; /** - * Verifies a CreateReadSessionRequest message. + * Verifies a ReadStream message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateReadSessionRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ReadStream message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateReadSessionRequest + * @returns ReadStream */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.ReadStream; /** - * Creates a plain object from a CreateReadSessionRequest message. Also converts values to other types if specified. - * @param message CreateReadSessionRequest + * Creates a plain object from a ReadStream message. Also converts values to other types if specified. + * @param message ReadStream * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.bigquery.storage.v1.ReadStream, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateReadSessionRequest to JSON. + * Converts this ReadStream to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** DataFormat enum. */ - enum DataFormat { - DATA_FORMAT_UNSPECIFIED = 0, - AVRO = 1, - ARROW = 3 - } + /** Properties of a WriteStream. */ + interface IWriteStream { - /** ShardingStrategy enum. */ - enum ShardingStrategy { - SHARDING_STRATEGY_UNSPECIFIED = 0, - LIQUID = 1, - BALANCED = 2 - } + /** WriteStream name */ + name?: (string|null); - /** Properties of a ReadRowsRequest. */ - interface IReadRowsRequest { + /** WriteStream type */ + type?: (google.cloud.bigquery.storage.v1.WriteStream.Type|keyof typeof google.cloud.bigquery.storage.v1.WriteStream.Type|null); - /** ReadRowsRequest readPosition */ - readPosition?: (google.cloud.bigquery.storage.v1beta1.IStreamPosition|null); + /** WriteStream createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** WriteStream commitTime */ + commitTime?: (google.protobuf.ITimestamp|null); + + /** WriteStream tableSchema */ + tableSchema?: (google.cloud.bigquery.storage.v1.ITableSchema|null); } - /** Represents a ReadRowsRequest. */ - class ReadRowsRequest implements IReadRowsRequest { + /** Represents a WriteStream. */ + class WriteStream implements IWriteStream { /** - * Constructs a new ReadRowsRequest. + * Constructs a new WriteStream. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.bigquery.storage.v1beta1.IReadRowsRequest); + constructor(properties?: google.cloud.bigquery.storage.v1.IWriteStream); - /** ReadRowsRequest readPosition. */ - public readPosition?: (google.cloud.bigquery.storage.v1beta1.IStreamPosition|null); + /** WriteStream name. */ + public name: string; + + /** WriteStream type. */ + public type: (google.cloud.bigquery.storage.v1.WriteStream.Type|keyof typeof google.cloud.bigquery.storage.v1.WriteStream.Type); + + /** WriteStream createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** WriteStream commitTime. */ + public commitTime?: (google.protobuf.ITimestamp|null); + + /** WriteStream tableSchema. */ + public tableSchema?: (google.cloud.bigquery.storage.v1.ITableSchema|null); /** - * Creates a new ReadRowsRequest instance using the specified properties. + * Creates a new WriteStream instance using the specified properties. * @param [properties] Properties to set - * @returns ReadRowsRequest instance + * @returns WriteStream instance */ - public static create(properties?: google.cloud.bigquery.storage.v1beta1.IReadRowsRequest): google.cloud.bigquery.storage.v1beta1.ReadRowsRequest; + public static create(properties?: google.cloud.bigquery.storage.v1.IWriteStream): google.cloud.bigquery.storage.v1.WriteStream; /** - * Encodes the specified ReadRowsRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsRequest.verify|verify} messages. - * @param message ReadRowsRequest message or plain object to encode + * Encodes the specified WriteStream message. Does not implicitly {@link google.cloud.bigquery.storage.v1.WriteStream.verify|verify} messages. + * @param message WriteStream message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.bigquery.storage.v1beta1.IReadRowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.bigquery.storage.v1.IWriteStream, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ReadRowsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsRequest.verify|verify} messages. - * @param message ReadRowsRequest message or plain object to encode + * Encodes the specified WriteStream message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.WriteStream.verify|verify} messages. + * @param message WriteStream message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IReadRowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IWriteStream, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReadRowsRequest message from the specified reader or buffer. + * Decodes a WriteStream message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ReadRowsRequest + * @returns WriteStream * @throws {Error} If the payload is not a 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.storage.v1beta1.ReadRowsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1.WriteStream; /** - * Decodes a ReadRowsRequest message from the specified reader or buffer, length delimited. + * Decodes a WriteStream message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReadRowsRequest + * @returns WriteStream * @throws {Error} If the payload is 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.storage.v1beta1.ReadRowsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1.WriteStream; /** - * Verifies a ReadRowsRequest message. + * Verifies a WriteStream message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ReadRowsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a WriteStream message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ReadRowsRequest + * @returns WriteStream */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.ReadRowsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.WriteStream; /** - * Creates a plain object from a ReadRowsRequest message. Also converts values to other types if specified. - * @param message ReadRowsRequest + * Creates a plain object from a WriteStream message. Also converts values to other types if specified. + * @param message WriteStream * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.bigquery.storage.v1beta1.ReadRowsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.bigquery.storage.v1.WriteStream, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ReadRowsRequest to JSON. + * Converts this WriteStream to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a StreamStatus. */ - interface IStreamStatus { - - /** StreamStatus estimatedRowCount */ - estimatedRowCount?: (number|Long|string|null); + namespace WriteStream { - /** StreamStatus fractionConsumed */ - fractionConsumed?: (number|null); + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + COMMITTED = 1, + PENDING = 2, + BUFFERED = 3 + } + } - /** StreamStatus progress */ - progress?: (google.cloud.bigquery.storage.v1beta1.IProgress|null); + /** Properties of a TableSchema. */ + interface ITableSchema { - /** StreamStatus isSplittable */ - isSplittable?: (boolean|null); + /** TableSchema fields */ + fields?: (google.cloud.bigquery.storage.v1.ITableFieldSchema[]|null); } - /** Represents a StreamStatus. */ - class StreamStatus implements IStreamStatus { + /** Represents a TableSchema. */ + class TableSchema implements ITableSchema { /** - * Constructs a new StreamStatus. + * Constructs a new TableSchema. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.bigquery.storage.v1beta1.IStreamStatus); - - /** StreamStatus estimatedRowCount. */ - public estimatedRowCount: (number|Long|string); - - /** StreamStatus fractionConsumed. */ - public fractionConsumed: number; + constructor(properties?: google.cloud.bigquery.storage.v1.ITableSchema); - /** StreamStatus progress. */ - public progress?: (google.cloud.bigquery.storage.v1beta1.IProgress|null); - - /** StreamStatus isSplittable. */ - public isSplittable: boolean; + /** TableSchema fields. */ + public fields: google.cloud.bigquery.storage.v1.ITableFieldSchema[]; /** - * Creates a new StreamStatus instance using the specified properties. + * Creates a new TableSchema instance using the specified properties. * @param [properties] Properties to set - * @returns StreamStatus instance + * @returns TableSchema instance */ - public static create(properties?: google.cloud.bigquery.storage.v1beta1.IStreamStatus): google.cloud.bigquery.storage.v1beta1.StreamStatus; + public static create(properties?: google.cloud.bigquery.storage.v1.ITableSchema): google.cloud.bigquery.storage.v1.TableSchema; /** - * Encodes the specified StreamStatus message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamStatus.verify|verify} messages. - * @param message StreamStatus message or plain object to encode + * Encodes the specified TableSchema message. Does not implicitly {@link google.cloud.bigquery.storage.v1.TableSchema.verify|verify} messages. + * @param message TableSchema message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.bigquery.storage.v1beta1.IStreamStatus, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.bigquery.storage.v1.ITableSchema, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified StreamStatus message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamStatus.verify|verify} messages. - * @param message StreamStatus message or plain object to encode + * Encodes the specified TableSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.TableSchema.verify|verify} messages. + * @param message TableSchema message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IStreamStatus, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.ITableSchema, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a StreamStatus message from the specified reader or buffer. + * Decodes a TableSchema message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns StreamStatus + * @returns TableSchema * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1beta1.StreamStatus; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1.TableSchema; /** - * Decodes a StreamStatus message from the specified reader or buffer, length delimited. + * Decodes a TableSchema message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns StreamStatus + * @returns TableSchema * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1beta1.StreamStatus; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1.TableSchema; /** - * Verifies a StreamStatus message. + * Verifies a TableSchema message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a StreamStatus message from a plain object. Also converts values to their respective internal types. + * Creates a TableSchema message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns StreamStatus + * @returns TableSchema */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.StreamStatus; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.TableSchema; /** - * Creates a plain object from a StreamStatus message. Also converts values to other types if specified. - * @param message StreamStatus + * Creates a plain object from a TableSchema message. Also converts values to other types if specified. + * @param message TableSchema * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.bigquery.storage.v1beta1.StreamStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.bigquery.storage.v1.TableSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this StreamStatus to JSON. + * Converts this TableSchema to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Progress. */ - interface IProgress { + /** Properties of a TableFieldSchema. */ + interface ITableFieldSchema { - /** Progress atResponseStart */ - atResponseStart?: (number|null); + /** TableFieldSchema name */ + name?: (string|null); - /** Progress atResponseEnd */ - atResponseEnd?: (number|null); + /** TableFieldSchema type */ + type?: (google.cloud.bigquery.storage.v1.TableFieldSchema.Type|keyof typeof google.cloud.bigquery.storage.v1.TableFieldSchema.Type|null); + + /** TableFieldSchema mode */ + mode?: (google.cloud.bigquery.storage.v1.TableFieldSchema.Mode|keyof typeof google.cloud.bigquery.storage.v1.TableFieldSchema.Mode|null); + + /** TableFieldSchema fields */ + fields?: (google.cloud.bigquery.storage.v1.ITableFieldSchema[]|null); + + /** TableFieldSchema description */ + description?: (string|null); + + /** TableFieldSchema maxLength */ + maxLength?: (number|Long|string|null); + + /** TableFieldSchema precision */ + precision?: (number|Long|string|null); + + /** TableFieldSchema scale */ + scale?: (number|Long|string|null); } - /** Represents a Progress. */ - class Progress implements IProgress { + /** Represents a TableFieldSchema. */ + class TableFieldSchema implements ITableFieldSchema { /** - * Constructs a new Progress. + * Constructs a new TableFieldSchema. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.bigquery.storage.v1beta1.IProgress); + constructor(properties?: google.cloud.bigquery.storage.v1.ITableFieldSchema); - /** Progress atResponseStart. */ - public atResponseStart: number; + /** TableFieldSchema name. */ + public name: string; - /** Progress atResponseEnd. */ - public atResponseEnd: number; + /** TableFieldSchema type. */ + public type: (google.cloud.bigquery.storage.v1.TableFieldSchema.Type|keyof typeof google.cloud.bigquery.storage.v1.TableFieldSchema.Type); + + /** TableFieldSchema mode. */ + public mode: (google.cloud.bigquery.storage.v1.TableFieldSchema.Mode|keyof typeof google.cloud.bigquery.storage.v1.TableFieldSchema.Mode); + + /** TableFieldSchema fields. */ + public fields: google.cloud.bigquery.storage.v1.ITableFieldSchema[]; + + /** TableFieldSchema description. */ + public description: string; + + /** TableFieldSchema maxLength. */ + public maxLength: (number|Long|string); + + /** TableFieldSchema precision. */ + public precision: (number|Long|string); + + /** TableFieldSchema scale. */ + public scale: (number|Long|string); /** - * Creates a new Progress instance using the specified properties. + * Creates a new TableFieldSchema instance using the specified properties. * @param [properties] Properties to set - * @returns Progress instance + * @returns TableFieldSchema instance */ - public static create(properties?: google.cloud.bigquery.storage.v1beta1.IProgress): google.cloud.bigquery.storage.v1beta1.Progress; + public static create(properties?: google.cloud.bigquery.storage.v1.ITableFieldSchema): google.cloud.bigquery.storage.v1.TableFieldSchema; /** - * Encodes the specified Progress message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Progress.verify|verify} messages. - * @param message Progress message or plain object to encode + * Encodes the specified TableFieldSchema message. Does not implicitly {@link google.cloud.bigquery.storage.v1.TableFieldSchema.verify|verify} messages. + * @param message TableFieldSchema message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.bigquery.storage.v1beta1.IProgress, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.bigquery.storage.v1.ITableFieldSchema, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Progress message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Progress.verify|verify} messages. - * @param message Progress message or plain object to encode + * Encodes the specified TableFieldSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.TableFieldSchema.verify|verify} messages. + * @param message TableFieldSchema message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IProgress, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.ITableFieldSchema, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Progress message from the specified reader or buffer. + * Decodes a TableFieldSchema message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Progress + * @returns TableFieldSchema * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1beta1.Progress; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1.TableFieldSchema; /** - * Decodes a Progress message from the specified reader or buffer, length delimited. + * Decodes a TableFieldSchema message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Progress + * @returns TableFieldSchema * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1beta1.Progress; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1.TableFieldSchema; /** - * Verifies a Progress message. + * Verifies a TableFieldSchema message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Progress message from a plain object. Also converts values to their respective internal types. + * Creates a TableFieldSchema message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Progress + * @returns TableFieldSchema */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.Progress; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.TableFieldSchema; /** - * Creates a plain object from a Progress message. Also converts values to other types if specified. - * @param message Progress + * Creates a plain object from a TableFieldSchema message. Also converts values to other types if specified. + * @param message TableFieldSchema * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.bigquery.storage.v1beta1.Progress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.bigquery.storage.v1.TableFieldSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Progress to JSON. + * Converts this TableFieldSchema to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ThrottleStatus. */ - interface IThrottleStatus { + namespace TableFieldSchema { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + STRING = 1, + INT64 = 2, + DOUBLE = 3, + STRUCT = 4, + BYTES = 5, + BOOL = 6, + TIMESTAMP = 7, + DATE = 8, + TIME = 9, + DATETIME = 10, + GEOGRAPHY = 11, + NUMERIC = 12, + BIGNUMERIC = 13, + INTERVAL = 14, + JSON = 15 + } - /** ThrottleStatus throttlePercent */ - throttlePercent?: (number|null); + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + NULLABLE = 1, + REQUIRED = 2, + REPEATED = 3 + } } + } - /** Represents a ThrottleStatus. */ - class ThrottleStatus implements IThrottleStatus { + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** Properties of an ArrowSchema. */ + interface IArrowSchema { + + /** ArrowSchema serializedSchema */ + serializedSchema?: (Uint8Array|string|null); + } + + /** Represents an ArrowSchema. */ + class ArrowSchema implements IArrowSchema { /** - * Constructs a new ThrottleStatus. + * Constructs a new ArrowSchema. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.bigquery.storage.v1beta1.IThrottleStatus); + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IArrowSchema); - /** ThrottleStatus throttlePercent. */ - public throttlePercent: number; + /** ArrowSchema serializedSchema. */ + public serializedSchema: (Uint8Array|string); /** - * Creates a new ThrottleStatus instance using the specified properties. + * Creates a new ArrowSchema instance using the specified properties. * @param [properties] Properties to set - * @returns ThrottleStatus instance + * @returns ArrowSchema instance */ - public static create(properties?: google.cloud.bigquery.storage.v1beta1.IThrottleStatus): google.cloud.bigquery.storage.v1beta1.ThrottleStatus; + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IArrowSchema): google.cloud.bigquery.storage.v1beta1.ArrowSchema; /** - * Encodes the specified ThrottleStatus message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ThrottleStatus.verify|verify} messages. - * @param message ThrottleStatus message or plain object to encode + * Encodes the specified ArrowSchema message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowSchema.verify|verify} messages. + * @param message ArrowSchema message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.bigquery.storage.v1beta1.IThrottleStatus, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.bigquery.storage.v1beta1.IArrowSchema, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ThrottleStatus message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ThrottleStatus.verify|verify} messages. - * @param message ThrottleStatus message or plain object to encode + * Encodes the specified ArrowSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowSchema.verify|verify} messages. + * @param message ArrowSchema message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IThrottleStatus, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IArrowSchema, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ThrottleStatus message from the specified reader or buffer. + * Decodes an ArrowSchema message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ThrottleStatus + * @returns ArrowSchema * @throws {Error} If the payload is not a 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.storage.v1beta1.ThrottleStatus; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1beta1.ArrowSchema; /** - * Decodes a ThrottleStatus message from the specified reader or buffer, length delimited. + * Decodes an ArrowSchema message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ThrottleStatus + * @returns ArrowSchema * @throws {Error} If the payload is 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.storage.v1beta1.ThrottleStatus; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1beta1.ArrowSchema; /** - * Verifies a ThrottleStatus message. + * Verifies an ArrowSchema message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ThrottleStatus message from a plain object. Also converts values to their respective internal types. + * Creates an ArrowSchema message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ThrottleStatus + * @returns ArrowSchema */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.ThrottleStatus; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.ArrowSchema; /** - * Creates a plain object from a ThrottleStatus message. Also converts values to other types if specified. - * @param message ThrottleStatus + * Creates a plain object from an ArrowSchema message. Also converts values to other types if specified. + * @param message ArrowSchema * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.bigquery.storage.v1beta1.ThrottleStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.bigquery.storage.v1beta1.ArrowSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ThrottleStatus to JSON. + * Converts this ArrowSchema to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ReadRowsResponse. */ - interface IReadRowsResponse { - - /** ReadRowsResponse avroRows */ - avroRows?: (google.cloud.bigquery.storage.v1beta1.IAvroRows|null); + /** Properties of an ArrowRecordBatch. */ + interface IArrowRecordBatch { - /** ReadRowsResponse arrowRecordBatch */ - arrowRecordBatch?: (google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch|null); + /** ArrowRecordBatch serializedRecordBatch */ + serializedRecordBatch?: (Uint8Array|string|null); - /** ReadRowsResponse rowCount */ + /** ArrowRecordBatch rowCount */ rowCount?: (number|Long|string|null); - - /** ReadRowsResponse status */ - status?: (google.cloud.bigquery.storage.v1beta1.IStreamStatus|null); - - /** ReadRowsResponse throttleStatus */ - throttleStatus?: (google.cloud.bigquery.storage.v1beta1.IThrottleStatus|null); } - /** Represents a ReadRowsResponse. */ - class ReadRowsResponse implements IReadRowsResponse { + /** Represents an ArrowRecordBatch. */ + class ArrowRecordBatch implements IArrowRecordBatch { /** - * Constructs a new ReadRowsResponse. + * Constructs a new ArrowRecordBatch. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.bigquery.storage.v1beta1.IReadRowsResponse); - - /** ReadRowsResponse avroRows. */ - public avroRows?: (google.cloud.bigquery.storage.v1beta1.IAvroRows|null); + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch); - /** ReadRowsResponse arrowRecordBatch. */ - public arrowRecordBatch?: (google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch|null); + /** ArrowRecordBatch serializedRecordBatch. */ + public serializedRecordBatch: (Uint8Array|string); - /** ReadRowsResponse rowCount. */ + /** ArrowRecordBatch rowCount. */ public rowCount: (number|Long|string); - /** ReadRowsResponse status. */ - public status?: (google.cloud.bigquery.storage.v1beta1.IStreamStatus|null); - - /** ReadRowsResponse throttleStatus. */ - public throttleStatus?: (google.cloud.bigquery.storage.v1beta1.IThrottleStatus|null); - - /** ReadRowsResponse rows. */ - public rows?: ("avroRows"|"arrowRecordBatch"); - /** - * Creates a new ReadRowsResponse instance using the specified properties. + * Creates a new ArrowRecordBatch instance using the specified properties. * @param [properties] Properties to set - * @returns ReadRowsResponse instance + * @returns ArrowRecordBatch instance */ - public static create(properties?: google.cloud.bigquery.storage.v1beta1.IReadRowsResponse): google.cloud.bigquery.storage.v1beta1.ReadRowsResponse; + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch): google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch; /** - * Encodes the specified ReadRowsResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.verify|verify} messages. - * @param message ReadRowsResponse message or plain object to encode + * Encodes the specified ArrowRecordBatch message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.verify|verify} messages. + * @param message ArrowRecordBatch message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.bigquery.storage.v1beta1.IReadRowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ReadRowsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.verify|verify} messages. - * @param message ReadRowsResponse message or plain object to encode + * Encodes the specified ArrowRecordBatch message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.verify|verify} messages. + * @param message ArrowRecordBatch message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IReadRowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReadRowsResponse message from the specified reader or buffer. + * Decodes an ArrowRecordBatch message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ReadRowsResponse + * @returns ArrowRecordBatch * @throws {Error} If the payload is not a 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.storage.v1beta1.ReadRowsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch; /** - * Decodes a ReadRowsResponse message from the specified reader or buffer, length delimited. + * Decodes an ArrowRecordBatch message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReadRowsResponse + * @returns ArrowRecordBatch * @throws {Error} If the payload is 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.storage.v1beta1.ReadRowsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch; /** - * Verifies a ReadRowsResponse message. + * Verifies an ArrowRecordBatch message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ReadRowsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ArrowRecordBatch message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ReadRowsResponse + * @returns ArrowRecordBatch */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.ReadRowsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch; /** - * Creates a plain object from a ReadRowsResponse message. Also converts values to other types if specified. - * @param message ReadRowsResponse + * Creates a plain object from an ArrowRecordBatch message. Also converts values to other types if specified. + * @param message ArrowRecordBatch * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.bigquery.storage.v1beta1.ReadRowsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ReadRowsResponse to JSON. + * Converts this ArrowRecordBatch to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchCreateReadSessionStreamsRequest. */ - interface IBatchCreateReadSessionStreamsRequest { - - /** BatchCreateReadSessionStreamsRequest session */ - session?: (google.cloud.bigquery.storage.v1beta1.IReadSession|null); + /** Properties of an AvroSchema. */ + interface IAvroSchema { - /** BatchCreateReadSessionStreamsRequest requestedStreams */ - requestedStreams?: (number|null); + /** AvroSchema schema */ + schema?: (string|null); } - /** Represents a BatchCreateReadSessionStreamsRequest. */ - class BatchCreateReadSessionStreamsRequest implements IBatchCreateReadSessionStreamsRequest { + /** Represents an AvroSchema. */ + class AvroSchema implements IAvroSchema { /** - * Constructs a new BatchCreateReadSessionStreamsRequest. + * Constructs a new AvroSchema. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest); - - /** BatchCreateReadSessionStreamsRequest session. */ - public session?: (google.cloud.bigquery.storage.v1beta1.IReadSession|null); + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IAvroSchema); - /** BatchCreateReadSessionStreamsRequest requestedStreams. */ - public requestedStreams: number; + /** AvroSchema schema. */ + public schema: string; /** - * Creates a new BatchCreateReadSessionStreamsRequest instance using the specified properties. + * Creates a new AvroSchema instance using the specified properties. * @param [properties] Properties to set - * @returns BatchCreateReadSessionStreamsRequest instance + * @returns AvroSchema instance */ - public static create(properties?: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest): google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest; + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IAvroSchema): google.cloud.bigquery.storage.v1beta1.AvroSchema; /** - * Encodes the specified BatchCreateReadSessionStreamsRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest.verify|verify} messages. - * @param message BatchCreateReadSessionStreamsRequest message or plain object to encode + * Encodes the specified AvroSchema message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroSchema.verify|verify} messages. + * @param message AvroSchema message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.bigquery.storage.v1beta1.IAvroSchema, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchCreateReadSessionStreamsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest.verify|verify} messages. - * @param message BatchCreateReadSessionStreamsRequest message or plain object to encode + * Encodes the specified AvroSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroSchema.verify|verify} messages. + * @param message AvroSchema message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IAvroSchema, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchCreateReadSessionStreamsRequest message from the specified reader or buffer. + * Decodes an AvroSchema message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchCreateReadSessionStreamsRequest + * @returns AvroSchema * @throws {Error} If the payload is not a 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.storage.v1beta1.BatchCreateReadSessionStreamsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1beta1.AvroSchema; /** - * Decodes a BatchCreateReadSessionStreamsRequest message from the specified reader or buffer, length delimited. + * Decodes an AvroSchema message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchCreateReadSessionStreamsRequest + * @returns AvroSchema * @throws {Error} If the payload is 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.storage.v1beta1.BatchCreateReadSessionStreamsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1beta1.AvroSchema; /** - * Verifies a BatchCreateReadSessionStreamsRequest message. + * Verifies an AvroSchema message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchCreateReadSessionStreamsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AvroSchema message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchCreateReadSessionStreamsRequest + * @returns AvroSchema */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.AvroSchema; /** - * Creates a plain object from a BatchCreateReadSessionStreamsRequest message. Also converts values to other types if specified. - * @param message BatchCreateReadSessionStreamsRequest + * Creates a plain object from an AvroSchema message. Also converts values to other types if specified. + * @param message AvroSchema * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.bigquery.storage.v1beta1.AvroSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchCreateReadSessionStreamsRequest to JSON. + * Converts this AvroSchema to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchCreateReadSessionStreamsResponse. */ - interface IBatchCreateReadSessionStreamsResponse { + /** Properties of an AvroRows. */ + interface IAvroRows { - /** BatchCreateReadSessionStreamsResponse streams */ - streams?: (google.cloud.bigquery.storage.v1beta1.IStream[]|null); + /** AvroRows serializedBinaryRows */ + serializedBinaryRows?: (Uint8Array|string|null); + + /** AvroRows rowCount */ + rowCount?: (number|Long|string|null); } - /** Represents a BatchCreateReadSessionStreamsResponse. */ - class BatchCreateReadSessionStreamsResponse implements IBatchCreateReadSessionStreamsResponse { + /** Represents an AvroRows. */ + class AvroRows implements IAvroRows { /** - * Constructs a new BatchCreateReadSessionStreamsResponse. + * Constructs a new AvroRows. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse); + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IAvroRows); - /** BatchCreateReadSessionStreamsResponse streams. */ - public streams: google.cloud.bigquery.storage.v1beta1.IStream[]; + /** AvroRows serializedBinaryRows. */ + public serializedBinaryRows: (Uint8Array|string); + + /** AvroRows rowCount. */ + public rowCount: (number|Long|string); /** - * Creates a new BatchCreateReadSessionStreamsResponse instance using the specified properties. + * Creates a new AvroRows instance using the specified properties. * @param [properties] Properties to set - * @returns BatchCreateReadSessionStreamsResponse instance + * @returns AvroRows instance */ - public static create(properties?: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse): google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse; + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IAvroRows): google.cloud.bigquery.storage.v1beta1.AvroRows; /** - * Encodes the specified BatchCreateReadSessionStreamsResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse.verify|verify} messages. - * @param message BatchCreateReadSessionStreamsResponse message or plain object to encode + * Encodes the specified AvroRows message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroRows.verify|verify} messages. + * @param message AvroRows message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.bigquery.storage.v1beta1.IAvroRows, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchCreateReadSessionStreamsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse.verify|verify} messages. - * @param message BatchCreateReadSessionStreamsResponse message or plain object to encode + * Encodes the specified AvroRows message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroRows.verify|verify} messages. + * @param message AvroRows message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IAvroRows, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchCreateReadSessionStreamsResponse message from the specified reader or buffer. + * Decodes an AvroRows message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchCreateReadSessionStreamsResponse + * @returns AvroRows * @throws {Error} If the payload is not a 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.storage.v1beta1.BatchCreateReadSessionStreamsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1beta1.AvroRows; /** - * Decodes a BatchCreateReadSessionStreamsResponse message from the specified reader or buffer, length delimited. + * Decodes an AvroRows message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchCreateReadSessionStreamsResponse + * @returns AvroRows * @throws {Error} If the payload is 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.storage.v1beta1.BatchCreateReadSessionStreamsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1beta1.AvroRows; /** - * Verifies a BatchCreateReadSessionStreamsResponse message. + * Verifies an AvroRows message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchCreateReadSessionStreamsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AvroRows message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchCreateReadSessionStreamsResponse + * @returns AvroRows */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.AvroRows; /** - * Creates a plain object from a BatchCreateReadSessionStreamsResponse message. Also converts values to other types if specified. - * @param message BatchCreateReadSessionStreamsResponse + * Creates a plain object from an AvroRows message. Also converts values to other types if specified. + * @param message AvroRows * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.bigquery.storage.v1beta1.AvroRows, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchCreateReadSessionStreamsResponse to JSON. + * Converts this AvroRows to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a FinalizeStreamRequest. */ - interface IFinalizeStreamRequest { + /** Properties of a TableReadOptions. */ + interface ITableReadOptions { - /** FinalizeStreamRequest stream */ - stream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + /** TableReadOptions selectedFields */ + selectedFields?: (string[]|null); + + /** TableReadOptions rowRestriction */ + rowRestriction?: (string|null); } - /** Represents a FinalizeStreamRequest. */ - class FinalizeStreamRequest implements IFinalizeStreamRequest { + /** Represents a TableReadOptions. */ + class TableReadOptions implements ITableReadOptions { /** - * Constructs a new FinalizeStreamRequest. + * Constructs a new TableReadOptions. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest); + constructor(properties?: google.cloud.bigquery.storage.v1beta1.ITableReadOptions); - /** FinalizeStreamRequest stream. */ - public stream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + /** TableReadOptions selectedFields. */ + public selectedFields: string[]; + + /** TableReadOptions rowRestriction. */ + public rowRestriction: string; /** - * Creates a new FinalizeStreamRequest instance using the specified properties. + * Creates a new TableReadOptions instance using the specified properties. * @param [properties] Properties to set - * @returns FinalizeStreamRequest instance + * @returns TableReadOptions instance */ - public static create(properties?: google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest): google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest; + public static create(properties?: google.cloud.bigquery.storage.v1beta1.ITableReadOptions): google.cloud.bigquery.storage.v1beta1.TableReadOptions; /** - * Encodes the specified FinalizeStreamRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest.verify|verify} messages. - * @param message FinalizeStreamRequest message or plain object to encode + * Encodes the specified TableReadOptions message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableReadOptions.verify|verify} messages. + * @param message TableReadOptions message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.bigquery.storage.v1beta1.ITableReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FinalizeStreamRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest.verify|verify} messages. - * @param message FinalizeStreamRequest message or plain object to encode + * Encodes the specified TableReadOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableReadOptions.verify|verify} messages. + * @param message TableReadOptions message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.ITableReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FinalizeStreamRequest message from the specified reader or buffer. + * Decodes a TableReadOptions message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FinalizeStreamRequest + * @returns TableReadOptions * @throws {Error} If the payload is not a 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.storage.v1beta1.FinalizeStreamRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1beta1.TableReadOptions; /** - * Decodes a FinalizeStreamRequest message from the specified reader or buffer, length delimited. + * Decodes a TableReadOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FinalizeStreamRequest + * @returns TableReadOptions * @throws {Error} If the payload is 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.storage.v1beta1.FinalizeStreamRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1beta1.TableReadOptions; /** - * Verifies a FinalizeStreamRequest message. + * Verifies a TableReadOptions message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a FinalizeStreamRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TableReadOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FinalizeStreamRequest + * @returns TableReadOptions */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.TableReadOptions; /** - * Creates a plain object from a FinalizeStreamRequest message. Also converts values to other types if specified. - * @param message FinalizeStreamRequest + * Creates a plain object from a TableReadOptions message. Also converts values to other types if specified. + * @param message TableReadOptions * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.bigquery.storage.v1beta1.TableReadOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FinalizeStreamRequest to JSON. + * Converts this TableReadOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SplitReadStreamRequest. */ - interface ISplitReadStreamRequest { + /** Represents a BigQueryStorage */ + class BigQueryStorage extends $protobuf.rpc.Service { - /** SplitReadStreamRequest originalStream */ - originalStream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + /** + * Constructs a new BigQueryStorage 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); - /** SplitReadStreamRequest fraction */ - fraction?: (number|null); - } + /** + * Creates new BigQueryStorage 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): BigQueryStorage; - /** Represents a SplitReadStreamRequest. */ - class SplitReadStreamRequest implements ISplitReadStreamRequest { + /** + * Calls CreateReadSession. + * @param request CreateReadSessionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReadSession + */ + public createReadSession(request: google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, callback: google.cloud.bigquery.storage.v1beta1.BigQueryStorage.CreateReadSessionCallback): void; /** - * Constructs a new SplitReadStreamRequest. - * @param [properties] Properties to set + * Calls CreateReadSession. + * @param request CreateReadSessionRequest message or plain object + * @returns Promise */ - constructor(properties?: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest); + public createReadSession(request: google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest): Promise; - /** SplitReadStreamRequest originalStream. */ - public originalStream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + /** + * Calls ReadRows. + * @param request ReadRowsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReadRowsResponse + */ + public readRows(request: google.cloud.bigquery.storage.v1beta1.IReadRowsRequest, callback: google.cloud.bigquery.storage.v1beta1.BigQueryStorage.ReadRowsCallback): void; - /** SplitReadStreamRequest fraction. */ - public fraction: number; + /** + * Calls ReadRows. + * @param request ReadRowsRequest message or plain object + * @returns Promise + */ + public readRows(request: google.cloud.bigquery.storage.v1beta1.IReadRowsRequest): Promise; /** - * Creates a new SplitReadStreamRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SplitReadStreamRequest instance + * Calls BatchCreateReadSessionStreams. + * @param request BatchCreateReadSessionStreamsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchCreateReadSessionStreamsResponse */ - public static create(properties?: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest): google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest; + public batchCreateReadSessionStreams(request: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, callback: google.cloud.bigquery.storage.v1beta1.BigQueryStorage.BatchCreateReadSessionStreamsCallback): void; /** - * Encodes the specified SplitReadStreamRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest.verify|verify} messages. - * @param message SplitReadStreamRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls BatchCreateReadSessionStreams. + * @param request BatchCreateReadSessionStreamsRequest message or plain object + * @returns Promise */ - public static encode(message: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public batchCreateReadSessionStreams(request: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest): Promise; /** - * Encodes the specified SplitReadStreamRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest.verify|verify} messages. - * @param message SplitReadStreamRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls FinalizeStream. + * @param request FinalizeStreamRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public finalizeStream(request: google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, callback: google.cloud.bigquery.storage.v1beta1.BigQueryStorage.FinalizeStreamCallback): void; /** - * Decodes a SplitReadStreamRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SplitReadStreamRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls FinalizeStream. + * @param request FinalizeStreamRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest; + public finalizeStream(request: google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest): Promise; /** - * Decodes a SplitReadStreamRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SplitReadStreamRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls SplitReadStream. + * @param request SplitReadStreamRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SplitReadStreamResponse */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest; + public splitReadStream(request: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, callback: google.cloud.bigquery.storage.v1beta1.BigQueryStorage.SplitReadStreamCallback): void; /** - * Verifies a SplitReadStreamRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls SplitReadStream. + * @param request SplitReadStreamRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public splitReadStream(request: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest): Promise; + } + + namespace BigQueryStorage { /** - * Creates a SplitReadStreamRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SplitReadStreamRequest + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#createReadSession}. + * @param error Error, if any + * @param [response] ReadSession */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest; + type CreateReadSessionCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1beta1.ReadSession) => void; /** - * Creates a plain object from a SplitReadStreamRequest message. Also converts values to other types if specified. - * @param message SplitReadStreamRequest - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#readRows}. + * @param error Error, if any + * @param [response] ReadRowsResponse */ - public static toObject(message: google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type ReadRowsCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1beta1.ReadRowsResponse) => void; /** - * Converts this SplitReadStreamRequest to JSON. - * @returns JSON object + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#batchCreateReadSessionStreams}. + * @param error Error, if any + * @param [response] BatchCreateReadSessionStreamsResponse */ - public toJSON(): { [k: string]: any }; - } + type BatchCreateReadSessionStreamsCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse) => void; - /** Properties of a SplitReadStreamResponse. */ - interface ISplitReadStreamResponse { + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#finalizeStream}. + * @param error Error, if any + * @param [response] Empty + */ + type FinalizeStreamCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - /** SplitReadStreamResponse primaryStream */ - primaryStream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#splitReadStream}. + * @param error Error, if any + * @param [response] SplitReadStreamResponse + */ + type SplitReadStreamCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse) => void; + } - /** SplitReadStreamResponse remainderStream */ - remainderStream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + /** Properties of a Stream. */ + interface IStream { + + /** Stream name */ + name?: (string|null); } - /** Represents a SplitReadStreamResponse. */ - class SplitReadStreamResponse implements ISplitReadStreamResponse { + /** Represents a Stream. */ + class Stream implements IStream { /** - * Constructs a new SplitReadStreamResponse. + * Constructs a new Stream. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse); - - /** SplitReadStreamResponse primaryStream. */ - public primaryStream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IStream); - /** SplitReadStreamResponse remainderStream. */ - public remainderStream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + /** Stream name. */ + public name: string; /** - * Creates a new SplitReadStreamResponse instance using the specified properties. + * Creates a new Stream instance using the specified properties. * @param [properties] Properties to set - * @returns SplitReadStreamResponse instance + * @returns Stream instance */ - public static create(properties?: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse): google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse; + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IStream): google.cloud.bigquery.storage.v1beta1.Stream; /** - * Encodes the specified SplitReadStreamResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse.verify|verify} messages. - * @param message SplitReadStreamResponse message or plain object to encode + * Encodes the specified Stream message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Stream.verify|verify} messages. + * @param message Stream message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.bigquery.storage.v1beta1.IStream, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SplitReadStreamResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse.verify|verify} messages. - * @param message SplitReadStreamResponse message or plain object to encode + * Encodes the specified Stream message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Stream.verify|verify} messages. + * @param message Stream message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IStream, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SplitReadStreamResponse message from the specified reader or buffer. + * Decodes a Stream message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SplitReadStreamResponse + * @returns Stream * @throws {Error} If the payload is not a 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.storage.v1beta1.SplitReadStreamResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1beta1.Stream; /** - * Decodes a SplitReadStreamResponse message from the specified reader or buffer, length delimited. + * Decodes a Stream message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SplitReadStreamResponse + * @returns Stream * @throws {Error} If the payload is 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.storage.v1beta1.SplitReadStreamResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1beta1.Stream; /** - * Verifies a SplitReadStreamResponse message. + * Verifies a Stream message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SplitReadStreamResponse message from a plain object. Also converts values to their respective internal types. + * Creates a Stream message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SplitReadStreamResponse + * @returns Stream */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.Stream; /** - * Creates a plain object from a SplitReadStreamResponse message. Also converts values to other types if specified. - * @param message SplitReadStreamResponse + * Creates a plain object from a Stream message. Also converts values to other types if specified. + * @param message Stream * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.bigquery.storage.v1beta1.Stream, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SplitReadStreamResponse to JSON. + * Converts this Stream to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TableReference. */ - interface ITableReference { - - /** TableReference projectId */ - projectId?: (string|null); + /** Properties of a StreamPosition. */ + interface IStreamPosition { - /** TableReference datasetId */ - datasetId?: (string|null); + /** StreamPosition stream */ + stream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); - /** TableReference tableId */ - tableId?: (string|null); + /** StreamPosition offset */ + offset?: (number|Long|string|null); } - /** Represents a TableReference. */ - class TableReference implements ITableReference { + /** Represents a StreamPosition. */ + class StreamPosition implements IStreamPosition { /** - * Constructs a new TableReference. + * Constructs a new StreamPosition. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.bigquery.storage.v1beta1.ITableReference); - - /** TableReference projectId. */ - public projectId: string; + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IStreamPosition); - /** TableReference datasetId. */ - public datasetId: string; + /** StreamPosition stream. */ + public stream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); - /** TableReference tableId. */ - public tableId: string; + /** StreamPosition offset. */ + public offset: (number|Long|string); /** - * Creates a new TableReference instance using the specified properties. + * Creates a new StreamPosition instance using the specified properties. * @param [properties] Properties to set - * @returns TableReference instance + * @returns StreamPosition instance */ - public static create(properties?: google.cloud.bigquery.storage.v1beta1.ITableReference): google.cloud.bigquery.storage.v1beta1.TableReference; + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IStreamPosition): google.cloud.bigquery.storage.v1beta1.StreamPosition; /** - * Encodes the specified TableReference message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableReference.verify|verify} messages. - * @param message TableReference message or plain object to encode + * Encodes the specified StreamPosition message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamPosition.verify|verify} messages. + * @param message StreamPosition message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.bigquery.storage.v1beta1.ITableReference, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.bigquery.storage.v1beta1.IStreamPosition, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TableReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableReference.verify|verify} messages. - * @param message TableReference message or plain object to encode + * Encodes the specified StreamPosition message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamPosition.verify|verify} messages. + * @param message StreamPosition message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.ITableReference, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IStreamPosition, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TableReference message from the specified reader or buffer. + * Decodes a StreamPosition message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TableReference + * @returns StreamPosition * @throws {Error} If the payload is not a 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.storage.v1beta1.TableReference; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1beta1.StreamPosition; /** - * Decodes a TableReference message from the specified reader or buffer, length delimited. + * Decodes a StreamPosition message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TableReference + * @returns StreamPosition * @throws {Error} If the payload is 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.storage.v1beta1.TableReference; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1beta1.StreamPosition; /** - * Verifies a TableReference message. + * Verifies a StreamPosition message. * @param message Plain object 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. + * Creates a StreamPosition message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TableReference + * @returns StreamPosition */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.TableReference; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.StreamPosition; /** - * Creates a plain object from a TableReference message. Also converts values to other types if specified. - * @param message TableReference + * Creates a plain object from a StreamPosition message. Also converts values to other types if specified. + * @param message StreamPosition * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.bigquery.storage.v1beta1.TableReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.bigquery.storage.v1beta1.StreamPosition, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TableReference to JSON. + * Converts this StreamPosition to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TableModifiers. */ - interface ITableModifiers { + /** Properties of a ReadSession. */ + interface IReadSession { - /** TableModifiers snapshotTime */ - snapshotTime?: (google.protobuf.ITimestamp|null); + /** ReadSession name */ + name?: (string|null); + + /** ReadSession expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** ReadSession avroSchema */ + avroSchema?: (google.cloud.bigquery.storage.v1beta1.IAvroSchema|null); + + /** ReadSession arrowSchema */ + arrowSchema?: (google.cloud.bigquery.storage.v1beta1.IArrowSchema|null); + + /** ReadSession streams */ + streams?: (google.cloud.bigquery.storage.v1beta1.IStream[]|null); + + /** ReadSession tableReference */ + tableReference?: (google.cloud.bigquery.storage.v1beta1.ITableReference|null); + + /** ReadSession tableModifiers */ + tableModifiers?: (google.cloud.bigquery.storage.v1beta1.ITableModifiers|null); + + /** ReadSession shardingStrategy */ + shardingStrategy?: (google.cloud.bigquery.storage.v1beta1.ShardingStrategy|keyof typeof google.cloud.bigquery.storage.v1beta1.ShardingStrategy|null); } - /** Represents a TableModifiers. */ - class TableModifiers implements ITableModifiers { + /** Represents a ReadSession. */ + class ReadSession implements IReadSession { /** - * Constructs a new TableModifiers. + * Constructs a new ReadSession. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.bigquery.storage.v1beta1.ITableModifiers); + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IReadSession); - /** TableModifiers snapshotTime. */ - public snapshotTime?: (google.protobuf.ITimestamp|null); + /** ReadSession name. */ + public name: string; + + /** ReadSession expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** ReadSession avroSchema. */ + public avroSchema?: (google.cloud.bigquery.storage.v1beta1.IAvroSchema|null); + + /** ReadSession arrowSchema. */ + public arrowSchema?: (google.cloud.bigquery.storage.v1beta1.IArrowSchema|null); + + /** ReadSession streams. */ + public streams: google.cloud.bigquery.storage.v1beta1.IStream[]; + + /** ReadSession tableReference. */ + public tableReference?: (google.cloud.bigquery.storage.v1beta1.ITableReference|null); + + /** ReadSession tableModifiers. */ + public tableModifiers?: (google.cloud.bigquery.storage.v1beta1.ITableModifiers|null); + + /** ReadSession shardingStrategy. */ + public shardingStrategy: (google.cloud.bigquery.storage.v1beta1.ShardingStrategy|keyof typeof google.cloud.bigquery.storage.v1beta1.ShardingStrategy); + + /** ReadSession schema. */ + public schema?: ("avroSchema"|"arrowSchema"); /** - * Creates a new TableModifiers instance using the specified properties. + * Creates a new ReadSession instance using the specified properties. * @param [properties] Properties to set - * @returns TableModifiers instance + * @returns ReadSession instance */ - public static create(properties?: google.cloud.bigquery.storage.v1beta1.ITableModifiers): google.cloud.bigquery.storage.v1beta1.TableModifiers; + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IReadSession): google.cloud.bigquery.storage.v1beta1.ReadSession; /** - * Encodes the specified TableModifiers message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableModifiers.verify|verify} messages. - * @param message TableModifiers message or plain object to encode + * Encodes the specified ReadSession message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadSession.verify|verify} messages. + * @param message ReadSession message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.bigquery.storage.v1beta1.ITableModifiers, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.bigquery.storage.v1beta1.IReadSession, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TableModifiers message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableModifiers.verify|verify} messages. - * @param message TableModifiers message or plain object to encode + * Encodes the specified ReadSession message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadSession.verify|verify} messages. + * @param message ReadSession message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.ITableModifiers, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IReadSession, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TableModifiers message from the specified reader or buffer. + * Decodes a ReadSession message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TableModifiers + * @returns ReadSession * @throws {Error} If the payload is not a 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.storage.v1beta1.TableModifiers; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.storage.v1beta1.ReadSession; /** - * Decodes a TableModifiers message from the specified reader or buffer, length delimited. + * Decodes a ReadSession message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TableModifiers + * @returns ReadSession * @throws {Error} If the payload is 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.storage.v1beta1.TableModifiers; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.storage.v1beta1.ReadSession; /** - * Verifies a TableModifiers message. + * Verifies a ReadSession message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TableModifiers message from a plain object. Also converts values to their respective internal types. + * Creates a ReadSession message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TableModifiers + * @returns ReadSession */ - public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.TableModifiers; + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.ReadSession; /** - * Creates a plain object from a TableModifiers message. Also converts values to other types if specified. - * @param message TableModifiers + * Creates a plain object from a ReadSession message. Also converts values to other types if specified. + * @param message ReadSession * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.bigquery.storage.v1beta1.TableModifiers, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.bigquery.storage.v1beta1.ReadSession, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TableModifiers to JSON. + * Converts this ReadSession to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - } - } - } - } - /** Namespace api. */ - namespace api { + /** Properties of a CreateReadSessionRequest. */ + interface ICreateReadSessionRequest { - /** Properties of a Http. */ - interface IHttp { + /** CreateReadSessionRequest tableReference */ + tableReference?: (google.cloud.bigquery.storage.v1beta1.ITableReference|null); - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); + /** CreateReadSessionRequest parent */ + parent?: (string|null); - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); - } + /** CreateReadSessionRequest tableModifiers */ + tableModifiers?: (google.cloud.bigquery.storage.v1beta1.ITableModifiers|null); - /** Represents a Http. */ - class Http implements IHttp { + /** CreateReadSessionRequest requestedStreams */ + requestedStreams?: (number|null); - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); + /** CreateReadSessionRequest readOptions */ + readOptions?: (google.cloud.bigquery.storage.v1beta1.ITableReadOptions|null); - /** Http rules. */ - public rules: google.api.IHttpRule[]; + /** CreateReadSessionRequest format */ + format?: (google.cloud.bigquery.storage.v1beta1.DataFormat|keyof typeof google.cloud.bigquery.storage.v1beta1.DataFormat|null); - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; + /** CreateReadSessionRequest shardingStrategy */ + shardingStrategy?: (google.cloud.bigquery.storage.v1beta1.ShardingStrategy|keyof typeof google.cloud.bigquery.storage.v1beta1.ShardingStrategy|null); + } + + /** Represents a CreateReadSessionRequest. */ + class CreateReadSessionRequest implements ICreateReadSessionRequest { + + /** + * Constructs a new CreateReadSessionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest); + + /** CreateReadSessionRequest tableReference. */ + public tableReference?: (google.cloud.bigquery.storage.v1beta1.ITableReference|null); + + /** CreateReadSessionRequest parent. */ + public parent: string; + + /** CreateReadSessionRequest tableModifiers. */ + public tableModifiers?: (google.cloud.bigquery.storage.v1beta1.ITableModifiers|null); + + /** CreateReadSessionRequest requestedStreams. */ + public requestedStreams: number; + + /** CreateReadSessionRequest readOptions. */ + public readOptions?: (google.cloud.bigquery.storage.v1beta1.ITableReadOptions|null); + + /** CreateReadSessionRequest format. */ + public format: (google.cloud.bigquery.storage.v1beta1.DataFormat|keyof typeof google.cloud.bigquery.storage.v1beta1.DataFormat); + + /** CreateReadSessionRequest shardingStrategy. */ + public shardingStrategy: (google.cloud.bigquery.storage.v1beta1.ShardingStrategy|keyof typeof google.cloud.bigquery.storage.v1beta1.ShardingStrategy); + + /** + * Creates a new CreateReadSessionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateReadSessionRequest instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest): google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest; + + /** + * Encodes the specified CreateReadSessionRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest.verify|verify} messages. + * @param message CreateReadSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateReadSessionRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest.verify|verify} messages. + * @param message CreateReadSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateReadSessionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateReadSessionRequest + * @throws {Error} If the payload is not a 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.storage.v1beta1.CreateReadSessionRequest; + + /** + * Decodes a CreateReadSessionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateReadSessionRequest + * @throws {Error} If the payload is 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.storage.v1beta1.CreateReadSessionRequest; + + /** + * Verifies a CreateReadSessionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateReadSessionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateReadSessionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest; + + /** + * Creates a plain object from a CreateReadSessionRequest message. Also converts values to other types if specified. + * @param message CreateReadSessionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateReadSessionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** DataFormat enum. */ + enum DataFormat { + DATA_FORMAT_UNSPECIFIED = 0, + AVRO = 1, + ARROW = 3 + } + + /** ShardingStrategy enum. */ + enum ShardingStrategy { + SHARDING_STRATEGY_UNSPECIFIED = 0, + LIQUID = 1, + BALANCED = 2 + } + + /** Properties of a ReadRowsRequest. */ + interface IReadRowsRequest { + + /** ReadRowsRequest readPosition */ + readPosition?: (google.cloud.bigquery.storage.v1beta1.IStreamPosition|null); + } + + /** Represents a ReadRowsRequest. */ + class ReadRowsRequest implements IReadRowsRequest { + + /** + * Constructs a new ReadRowsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IReadRowsRequest); + + /** ReadRowsRequest readPosition. */ + public readPosition?: (google.cloud.bigquery.storage.v1beta1.IStreamPosition|null); + + /** + * Creates a new ReadRowsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadRowsRequest instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IReadRowsRequest): google.cloud.bigquery.storage.v1beta1.ReadRowsRequest; + + /** + * Encodes the specified ReadRowsRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsRequest.verify|verify} messages. + * @param message ReadRowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.IReadRowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadRowsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsRequest.verify|verify} messages. + * @param message ReadRowsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IReadRowsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadRowsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadRowsRequest + * @throws {Error} If the payload is not a 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.storage.v1beta1.ReadRowsRequest; + + /** + * Decodes a ReadRowsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadRowsRequest + * @throws {Error} If the payload is 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.storage.v1beta1.ReadRowsRequest; + + /** + * Verifies a ReadRowsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadRowsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadRowsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.ReadRowsRequest; + + /** + * Creates a plain object from a ReadRowsRequest message. Also converts values to other types if specified. + * @param message ReadRowsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.ReadRowsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadRowsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StreamStatus. */ + interface IStreamStatus { + + /** StreamStatus estimatedRowCount */ + estimatedRowCount?: (number|Long|string|null); + + /** StreamStatus fractionConsumed */ + fractionConsumed?: (number|null); + + /** StreamStatus progress */ + progress?: (google.cloud.bigquery.storage.v1beta1.IProgress|null); + + /** StreamStatus isSplittable */ + isSplittable?: (boolean|null); + } + + /** Represents a StreamStatus. */ + class StreamStatus implements IStreamStatus { + + /** + * Constructs a new StreamStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IStreamStatus); + + /** StreamStatus estimatedRowCount. */ + public estimatedRowCount: (number|Long|string); + + /** StreamStatus fractionConsumed. */ + public fractionConsumed: number; + + /** StreamStatus progress. */ + public progress?: (google.cloud.bigquery.storage.v1beta1.IProgress|null); + + /** StreamStatus isSplittable. */ + public isSplittable: boolean; + + /** + * Creates a new StreamStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamStatus instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IStreamStatus): google.cloud.bigquery.storage.v1beta1.StreamStatus; + + /** + * Encodes the specified StreamStatus message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamStatus.verify|verify} messages. + * @param message StreamStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.IStreamStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamStatus message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamStatus.verify|verify} messages. + * @param message StreamStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IStreamStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamStatus + * @throws {Error} If the payload is not a 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.storage.v1beta1.StreamStatus; + + /** + * Decodes a StreamStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamStatus + * @throws {Error} If the payload is 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.storage.v1beta1.StreamStatus; + + /** + * Verifies a StreamStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.StreamStatus; + + /** + * Creates a plain object from a StreamStatus message. Also converts values to other types if specified. + * @param message StreamStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.StreamStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Progress. */ + interface IProgress { + + /** Progress atResponseStart */ + atResponseStart?: (number|null); + + /** Progress atResponseEnd */ + atResponseEnd?: (number|null); + } + + /** Represents a Progress. */ + class Progress implements IProgress { + + /** + * Constructs a new Progress. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IProgress); + + /** Progress atResponseStart. */ + public atResponseStart: number; + + /** Progress atResponseEnd. */ + public atResponseEnd: number; + + /** + * Creates a new Progress instance using the specified properties. + * @param [properties] Properties to set + * @returns Progress instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IProgress): google.cloud.bigquery.storage.v1beta1.Progress; + + /** + * Encodes the specified Progress message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Progress.verify|verify} messages. + * @param message Progress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.IProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Progress message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Progress.verify|verify} messages. + * @param message Progress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IProgress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Progress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Progress + * @throws {Error} If the payload is not a 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.storage.v1beta1.Progress; + + /** + * Decodes a Progress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Progress + * @throws {Error} If the payload is 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.storage.v1beta1.Progress; + + /** + * Verifies a Progress message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Progress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Progress + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.Progress; + + /** + * Creates a plain object from a Progress message. Also converts values to other types if specified. + * @param message Progress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.Progress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Progress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ThrottleStatus. */ + interface IThrottleStatus { + + /** ThrottleStatus throttlePercent */ + throttlePercent?: (number|null); + } + + /** Represents a ThrottleStatus. */ + class ThrottleStatus implements IThrottleStatus { + + /** + * Constructs a new ThrottleStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IThrottleStatus); + + /** ThrottleStatus throttlePercent. */ + public throttlePercent: number; + + /** + * Creates a new ThrottleStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ThrottleStatus instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IThrottleStatus): google.cloud.bigquery.storage.v1beta1.ThrottleStatus; + + /** + * Encodes the specified ThrottleStatus message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ThrottleStatus.verify|verify} messages. + * @param message ThrottleStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.IThrottleStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ThrottleStatus message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ThrottleStatus.verify|verify} messages. + * @param message ThrottleStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IThrottleStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThrottleStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ThrottleStatus + * @throws {Error} If the payload is not a 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.storage.v1beta1.ThrottleStatus; + + /** + * Decodes a ThrottleStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ThrottleStatus + * @throws {Error} If the payload is 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.storage.v1beta1.ThrottleStatus; + + /** + * Verifies a ThrottleStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ThrottleStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ThrottleStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.ThrottleStatus; + + /** + * Creates a plain object from a ThrottleStatus message. Also converts values to other types if specified. + * @param message ThrottleStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.ThrottleStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ThrottleStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReadRowsResponse. */ + interface IReadRowsResponse { + + /** ReadRowsResponse avroRows */ + avroRows?: (google.cloud.bigquery.storage.v1beta1.IAvroRows|null); + + /** ReadRowsResponse arrowRecordBatch */ + arrowRecordBatch?: (google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch|null); + + /** ReadRowsResponse rowCount */ + rowCount?: (number|Long|string|null); + + /** ReadRowsResponse status */ + status?: (google.cloud.bigquery.storage.v1beta1.IStreamStatus|null); + + /** ReadRowsResponse throttleStatus */ + throttleStatus?: (google.cloud.bigquery.storage.v1beta1.IThrottleStatus|null); + } + + /** Represents a ReadRowsResponse. */ + class ReadRowsResponse implements IReadRowsResponse { + + /** + * Constructs a new ReadRowsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IReadRowsResponse); + + /** ReadRowsResponse avroRows. */ + public avroRows?: (google.cloud.bigquery.storage.v1beta1.IAvroRows|null); + + /** ReadRowsResponse arrowRecordBatch. */ + public arrowRecordBatch?: (google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch|null); + + /** ReadRowsResponse rowCount. */ + public rowCount: (number|Long|string); + + /** ReadRowsResponse status. */ + public status?: (google.cloud.bigquery.storage.v1beta1.IStreamStatus|null); + + /** ReadRowsResponse throttleStatus. */ + public throttleStatus?: (google.cloud.bigquery.storage.v1beta1.IThrottleStatus|null); + + /** ReadRowsResponse rows. */ + public rows?: ("avroRows"|"arrowRecordBatch"); + + /** + * Creates a new ReadRowsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadRowsResponse instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IReadRowsResponse): google.cloud.bigquery.storage.v1beta1.ReadRowsResponse; + + /** + * Encodes the specified ReadRowsResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.verify|verify} messages. + * @param message ReadRowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.IReadRowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadRowsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.verify|verify} messages. + * @param message ReadRowsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IReadRowsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadRowsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadRowsResponse + * @throws {Error} If the payload is not a 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.storage.v1beta1.ReadRowsResponse; + + /** + * Decodes a ReadRowsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadRowsResponse + * @throws {Error} If the payload is 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.storage.v1beta1.ReadRowsResponse; + + /** + * Verifies a ReadRowsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadRowsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadRowsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.ReadRowsResponse; + + /** + * Creates a plain object from a ReadRowsResponse message. Also converts values to other types if specified. + * @param message ReadRowsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.ReadRowsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadRowsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchCreateReadSessionStreamsRequest. */ + interface IBatchCreateReadSessionStreamsRequest { + + /** BatchCreateReadSessionStreamsRequest session */ + session?: (google.cloud.bigquery.storage.v1beta1.IReadSession|null); + + /** BatchCreateReadSessionStreamsRequest requestedStreams */ + requestedStreams?: (number|null); + } + + /** Represents a BatchCreateReadSessionStreamsRequest. */ + class BatchCreateReadSessionStreamsRequest implements IBatchCreateReadSessionStreamsRequest { + + /** + * Constructs a new BatchCreateReadSessionStreamsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest); + + /** BatchCreateReadSessionStreamsRequest session. */ + public session?: (google.cloud.bigquery.storage.v1beta1.IReadSession|null); + + /** BatchCreateReadSessionStreamsRequest requestedStreams. */ + public requestedStreams: number; + + /** + * Creates a new BatchCreateReadSessionStreamsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateReadSessionStreamsRequest instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest): google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest; + + /** + * Encodes the specified BatchCreateReadSessionStreamsRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest.verify|verify} messages. + * @param message BatchCreateReadSessionStreamsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateReadSessionStreamsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest.verify|verify} messages. + * @param message BatchCreateReadSessionStreamsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateReadSessionStreamsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateReadSessionStreamsRequest + * @throws {Error} If the payload is not a 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.storage.v1beta1.BatchCreateReadSessionStreamsRequest; + + /** + * Decodes a BatchCreateReadSessionStreamsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateReadSessionStreamsRequest + * @throws {Error} If the payload is 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.storage.v1beta1.BatchCreateReadSessionStreamsRequest; + + /** + * Verifies a BatchCreateReadSessionStreamsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateReadSessionStreamsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateReadSessionStreamsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest; + + /** + * Creates a plain object from a BatchCreateReadSessionStreamsRequest message. Also converts values to other types if specified. + * @param message BatchCreateReadSessionStreamsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateReadSessionStreamsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BatchCreateReadSessionStreamsResponse. */ + interface IBatchCreateReadSessionStreamsResponse { + + /** BatchCreateReadSessionStreamsResponse streams */ + streams?: (google.cloud.bigquery.storage.v1beta1.IStream[]|null); + } + + /** Represents a BatchCreateReadSessionStreamsResponse. */ + class BatchCreateReadSessionStreamsResponse implements IBatchCreateReadSessionStreamsResponse { + + /** + * Constructs a new BatchCreateReadSessionStreamsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse); + + /** BatchCreateReadSessionStreamsResponse streams. */ + public streams: google.cloud.bigquery.storage.v1beta1.IStream[]; + + /** + * Creates a new BatchCreateReadSessionStreamsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateReadSessionStreamsResponse instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse): google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse; + + /** + * Encodes the specified BatchCreateReadSessionStreamsResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse.verify|verify} messages. + * @param message BatchCreateReadSessionStreamsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateReadSessionStreamsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse.verify|verify} messages. + * @param message BatchCreateReadSessionStreamsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateReadSessionStreamsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateReadSessionStreamsResponse + * @throws {Error} If the payload is not a 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.storage.v1beta1.BatchCreateReadSessionStreamsResponse; + + /** + * Decodes a BatchCreateReadSessionStreamsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateReadSessionStreamsResponse + * @throws {Error} If the payload is 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.storage.v1beta1.BatchCreateReadSessionStreamsResponse; + + /** + * Verifies a BatchCreateReadSessionStreamsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateReadSessionStreamsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateReadSessionStreamsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse; + + /** + * Creates a plain object from a BatchCreateReadSessionStreamsResponse message. Also converts values to other types if specified. + * @param message BatchCreateReadSessionStreamsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateReadSessionStreamsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FinalizeStreamRequest. */ + interface IFinalizeStreamRequest { + + /** FinalizeStreamRequest stream */ + stream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + } + + /** Represents a FinalizeStreamRequest. */ + class FinalizeStreamRequest implements IFinalizeStreamRequest { + + /** + * Constructs a new FinalizeStreamRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest); + + /** FinalizeStreamRequest stream. */ + public stream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + + /** + * Creates a new FinalizeStreamRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FinalizeStreamRequest instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest): google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest; + + /** + * Encodes the specified FinalizeStreamRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest.verify|verify} messages. + * @param message FinalizeStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FinalizeStreamRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest.verify|verify} messages. + * @param message FinalizeStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FinalizeStreamRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FinalizeStreamRequest + * @throws {Error} If the payload is not a 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.storage.v1beta1.FinalizeStreamRequest; + + /** + * Decodes a FinalizeStreamRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FinalizeStreamRequest + * @throws {Error} If the payload is 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.storage.v1beta1.FinalizeStreamRequest; + + /** + * Verifies a FinalizeStreamRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FinalizeStreamRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FinalizeStreamRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest; + + /** + * Creates a plain object from a FinalizeStreamRequest message. Also converts values to other types if specified. + * @param message FinalizeStreamRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FinalizeStreamRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SplitReadStreamRequest. */ + interface ISplitReadStreamRequest { + + /** SplitReadStreamRequest originalStream */ + originalStream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + + /** SplitReadStreamRequest fraction */ + fraction?: (number|null); + } + + /** Represents a SplitReadStreamRequest. */ + class SplitReadStreamRequest implements ISplitReadStreamRequest { + + /** + * Constructs a new SplitReadStreamRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest); + + /** SplitReadStreamRequest originalStream. */ + public originalStream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + + /** SplitReadStreamRequest fraction. */ + public fraction: number; + + /** + * Creates a new SplitReadStreamRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SplitReadStreamRequest instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest): google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest; + + /** + * Encodes the specified SplitReadStreamRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest.verify|verify} messages. + * @param message SplitReadStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SplitReadStreamRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest.verify|verify} messages. + * @param message SplitReadStreamRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SplitReadStreamRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SplitReadStreamRequest + * @throws {Error} If the payload is not a 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.storage.v1beta1.SplitReadStreamRequest; + + /** + * Decodes a SplitReadStreamRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SplitReadStreamRequest + * @throws {Error} If the payload is 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.storage.v1beta1.SplitReadStreamRequest; + + /** + * Verifies a SplitReadStreamRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SplitReadStreamRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SplitReadStreamRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest; + + /** + * Creates a plain object from a SplitReadStreamRequest message. Also converts values to other types if specified. + * @param message SplitReadStreamRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SplitReadStreamRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SplitReadStreamResponse. */ + interface ISplitReadStreamResponse { + + /** SplitReadStreamResponse primaryStream */ + primaryStream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + + /** SplitReadStreamResponse remainderStream */ + remainderStream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + } + + /** Represents a SplitReadStreamResponse. */ + class SplitReadStreamResponse implements ISplitReadStreamResponse { + + /** + * Constructs a new SplitReadStreamResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse); + + /** SplitReadStreamResponse primaryStream. */ + public primaryStream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + + /** SplitReadStreamResponse remainderStream. */ + public remainderStream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); + + /** + * Creates a new SplitReadStreamResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SplitReadStreamResponse instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse): google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse; + + /** + * Encodes the specified SplitReadStreamResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse.verify|verify} messages. + * @param message SplitReadStreamResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SplitReadStreamResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse.verify|verify} messages. + * @param message SplitReadStreamResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SplitReadStreamResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SplitReadStreamResponse + * @throws {Error} If the payload is not a 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.storage.v1beta1.SplitReadStreamResponse; + + /** + * Decodes a SplitReadStreamResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SplitReadStreamResponse + * @throws {Error} If the payload is 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.storage.v1beta1.SplitReadStreamResponse; + + /** + * Verifies a SplitReadStreamResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SplitReadStreamResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SplitReadStreamResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse; + + /** + * Creates a plain object from a SplitReadStreamResponse message. Also converts values to other types if specified. + * @param message SplitReadStreamResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SplitReadStreamResponse 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.storage.v1beta1.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.storage.v1beta1.ITableReference): google.cloud.bigquery.storage.v1beta1.TableReference; + + /** + * Encodes the specified TableReference message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.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.storage.v1beta1.ITableReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.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.storage.v1beta1.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.storage.v1beta1.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.storage.v1beta1.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.storage.v1beta1.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.storage.v1beta1.TableReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TableModifiers. */ + interface ITableModifiers { + + /** TableModifiers snapshotTime */ + snapshotTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TableModifiers. */ + class TableModifiers implements ITableModifiers { + + /** + * Constructs a new TableModifiers. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.ITableModifiers); + + /** TableModifiers snapshotTime. */ + public snapshotTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TableModifiers instance using the specified properties. + * @param [properties] Properties to set + * @returns TableModifiers instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1beta1.ITableModifiers): google.cloud.bigquery.storage.v1beta1.TableModifiers; + + /** + * Encodes the specified TableModifiers message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableModifiers.verify|verify} messages. + * @param message TableModifiers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1beta1.ITableModifiers, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableModifiers message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableModifiers.verify|verify} messages. + * @param message TableModifiers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1beta1.ITableModifiers, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableModifiers message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableModifiers + * @throws {Error} If the payload is not a 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.storage.v1beta1.TableModifiers; + + /** + * Decodes a TableModifiers message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableModifiers + * @throws {Error} If the payload is 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.storage.v1beta1.TableModifiers; + + /** + * Verifies a TableModifiers message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableModifiers message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableModifiers + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1beta1.TableModifiers; + + /** + * Creates a plain object from a TableModifiers message. Also converts values to other types if specified. + * @param message TableModifiers + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1beta1.TableModifiers, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableModifiers 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 Http instance using the specified properties. + * Creates a new FileOptions instance using the specified properties. * @param [properties] Properties to set - * @returns Http instance + * @returns FileOptions instance */ - public static create(properties?: google.api.IHttp): google.api.Http; + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode + * 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.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IFileOptions, 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 + * 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.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Http message from the specified reader or buffer. + * 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 Http + * @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.api.Http; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes a FileOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Http + * @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.api.Http; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; /** - * Verifies a Http message. + * 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 Http message from a plain object. Also converts values to their respective internal types. + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Http + * @returns FileOptions */ - public static fromObject(object: { [k: string]: any }): google.api.Http; + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http + * 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.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Http to JSON. + * Converts this FileOptions 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); + namespace FileOptions { - /** HttpRule put */ - put?: (string|null); + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } - /** HttpRule post */ - post?: (string|null); + /** Properties of a MessageOptions. */ + interface IMessageOptions { - /** HttpRule delete */ - "delete"?: (string|null); + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); - /** HttpRule patch */ - patch?: (string|null); + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); + /** MessageOptions deprecated */ + deprecated?: (boolean|null); - /** HttpRule body */ - body?: (string|null); + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); - /** HttpRule responseBody */ - responseBody?: (string|null); + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); } - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { /** - * Constructs a new HttpRule. + * Constructs a new MessageOptions. * @param [properties] Properties to set */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule get. */ - public get?: (string|null); - - /** HttpRule put. */ - public put?: (string|null); - - /** HttpRule post. */ - public post?: (string|null); - - /** HttpRule delete. */ - public delete?: (string|null); - - /** HttpRule patch. */ - public patch?: (string|null); + constructor(properties?: google.protobuf.IMessageOptions); - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; - /** HttpRule body. */ - public body: string; + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; - /** HttpRule responseBody. */ - public responseBody: string; + /** MessageOptions deprecated. */ + public deprecated: boolean; - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; + /** MessageOptions mapEntry. */ + public mapEntry: boolean; - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new MessageOptions instance using the specified properties. * @param [properties] Properties to set - * @returns HttpRule instance + * @returns MessageOptions instance */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode + * 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.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IMessageOptions, 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 + * 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.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HttpRule message from the specified reader or buffer. + * 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 HttpRule + * @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.api.HttpRule; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HttpRule + * @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.api.HttpRule; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; /** - * Verifies a HttpRule message. + * 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 HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HttpRule + * @returns MessageOptions */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule + * 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.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HttpRule to JSON. + * Converts this MessageOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { + /** Properties of a FieldOptions. */ + interface IFieldOptions { - /** CustomHttpPattern kind */ - kind?: (string|null); + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - /** CustomHttpPattern path */ - path?: (string|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 CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { /** - * Constructs a new CustomHttpPattern. + * Constructs a new FieldOptions. * @param [properties] Properties to set */ - constructor(properties?: google.api.ICustomHttpPattern); + constructor(properties?: google.protobuf.IFieldOptions); - /** CustomHttpPattern kind. */ - public kind: string; + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - /** CustomHttpPattern path. */ - public path: string; + /** 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 CustomHttpPattern instance using the specified properties. + * Creates a new FieldOptions instance using the specified properties. * @param [properties] Properties to set - * @returns CustomHttpPattern instance + * @returns FieldOptions instance */ - public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode + * Encodes the specified 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.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode + * Encodes the specified 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.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * 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 CustomHttpPattern + * @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.api.CustomHttpPattern; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern + * @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.api.CustomHttpPattern; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; /** - * Verifies a CustomHttpPattern message. + * 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CustomHttpPattern + * @returns FieldOptions */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern + * Creates a plain object from a 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.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CustomHttpPattern to JSON. + * Converts this FieldOptions 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, - UNORDERED_LIST = 6 - } - - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { - - /** ResourceDescriptor type */ - type?: (string|null); - - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); - - /** ResourceDescriptor nameField */ - nameField?: (string|null); + namespace FieldOptions { - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } - /** ResourceDescriptor plural */ - plural?: (string|null); + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } - /** ResourceDescriptor singular */ - singular?: (string|null); + /** Properties of an OneofOptions. */ + interface IOneofOptions { - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { /** - * Constructs a new ResourceDescriptor. + * Constructs a new OneofOptions. * @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; + constructor(properties?: google.protobuf.IOneofOptions); - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new ResourceDescriptor instance using the specified properties. + * Creates a new OneofOptions instance using the specified properties. * @param [properties] Properties to set - * @returns ResourceDescriptor instance + * @returns OneofOptions instance */ - public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode + * 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.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IOneofOptions, 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 + * 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.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * 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 ResourceDescriptor + * @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.api.ResourceDescriptor; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor + * @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.api.ResourceDescriptor; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; /** - * Verifies a ResourceDescriptor message. + * 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 a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceDescriptor + * @returns OneofOptions */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor + * 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.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceDescriptor to JSON. + * Converts this OneofOptions 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 - } - - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } + /** Properties of an EnumOptions. */ + interface IEnumOptions { - /** Properties of a ResourceReference. */ - interface IResourceReference { + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); - /** ResourceReference type */ - type?: (string|null); + /** EnumOptions deprecated */ + deprecated?: (boolean|null); - /** ResourceReference childType */ - childType?: (string|null); + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { /** - * Constructs a new ResourceReference. + * Constructs a new EnumOptions. * @param [properties] Properties to set */ - constructor(properties?: google.api.IResourceReference); + constructor(properties?: google.protobuf.IEnumOptions); - /** ResourceReference type. */ - public type: string; + /** EnumOptions allowAlias. */ + public allowAlias: boolean; - /** ResourceReference childType. */ - public childType: string; + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new ResourceReference instance using the specified properties. + * Creates a new EnumOptions instance using the specified properties. * @param [properties] Properties to set - * @returns ResourceReference instance + * @returns EnumOptions instance */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode + * 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.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IEnumOptions, 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 + * 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.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * 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 ResourceReference + * @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.api.ResourceReference; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourceReference + * @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.api.ResourceReference; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; /** - * Verifies a ResourceReference message. + * 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 a ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceReference + * @returns EnumOptions */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference + * 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.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceReference to JSON. + * Converts this EnumOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - } - /** Namespace protobuf. */ - namespace protobuf { + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); } - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { /** - * Constructs a new FileDescriptorSet. + * Constructs a new EnumValueOptions. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IFileDescriptorSet); + constructor(properties?: google.protobuf.IEnumValueOptions); - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new FileDescriptorSet instance using the specified properties. + * Creates a new EnumValueOptions instance using the specified properties. * @param [properties] Properties to set - * @returns FileDescriptorSet instance + * @returns EnumValueOptions instance */ - public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode + * 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.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IEnumValueOptions, 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 + * 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.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. + * 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 FileDescriptorSet + * @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.FileDescriptorSet; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet + * @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.FileDescriptorSet; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; /** - * Verifies a FileDescriptorSet message. + * 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 a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FileDescriptorSet + * @returns EnumValueOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet + * 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.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FileDescriptorSet to JSON. + * Converts this EnumValueOptions 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); + /** Properties of a ServiceOptions. */ + interface IServiceOptions { - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); - /** FileDescriptorProto syntax */ - syntax?: (string|null); + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); } - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { /** - * Constructs a new FileDescriptorProto. + * Constructs a new ServiceOptions. * @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); + constructor(properties?: google.protobuf.IServiceOptions); - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + /** ServiceOptions deprecated. */ + public deprecated: boolean; - /** FileDescriptorProto syntax. */ - public syntax: string; + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new FileDescriptorProto instance using the specified properties. + * Creates a new ServiceOptions instance using the specified properties. * @param [properties] Properties to set - * @returns FileDescriptorProto instance + * @returns ServiceOptions instance */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode + * 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.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IServiceOptions, 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 + * 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.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. + * 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 FileDescriptorProto + * @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.FileDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto + * @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.FileDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; /** - * Verifies a FileDescriptorProto message. + * 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 FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FileDescriptorProto + * @returns ServiceOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto + * 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.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FileDescriptorProto to JSON. + * Converts this ServiceOptions 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); + /** Properties of a MethodOptions. */ + interface IMethodOptions { - /** DescriptorProto name. */ - public name: string; + /** MethodOptions deprecated */ + deprecated?: (boolean|null); - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + } - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); + /** MethodOptions deprecated. */ + public deprecated: boolean; - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - /** DescriptorProto reservedName. */ - public reservedName: string[]; + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; /** - * Creates a new DescriptorProto instance using the specified properties. + * Creates a new MethodOptions instance using the specified properties. * @param [properties] Properties to set - * @returns DescriptorProto instance + * @returns MethodOptions instance */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode + * 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.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IMethodOptions, 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 + * 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.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DescriptorProto message from the specified reader or buffer. + * 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 DescriptorProto + * @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.DescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DescriptorProto + * @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.DescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; /** - * Verifies a DescriptorProto message. + * 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 DescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DescriptorProto + * @returns MethodOptions */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto + * 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.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DescriptorProto to JSON. + * Converts this MethodOptions 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); + namespace MethodOptions { - /** ReservedRange end */ - end?: (number|null); + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 } + } - /** 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; + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { - /** - * 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; + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - /** - * 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); + /** UninterpretedOption identifierValue */ + identifierValue?: (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; + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); - /** - * 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 }; + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); } - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { /** - * Constructs a new ExtensionRangeOptions. + * Constructs a new UninterpretedOption. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); + constructor(properties?: google.protobuf.IUninterpretedOption); - /** ExtensionRangeOptions uninterpretedOption. */ - public uninterpretedOption: 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 ExtensionRangeOptions instance using the specified properties. + * Creates a new UninterpretedOption instance using the specified properties. * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance + * @returns UninterpretedOption instance */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IUninterpretedOption, 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 + * 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.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * Decodes an UninterpretedOption message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExtensionRangeOptions + * @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.ExtensionRangeOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions + * @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.ExtensionRangeOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; /** - * Verifies an ExtensionRangeOptions message. + * Verifies an UninterpretedOption message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExtensionRangeOptions + * @returns UninterpretedOption */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions + * 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.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExtensionRangeOptions to JSON. + * Converts this UninterpretedOption 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); + namespace UninterpretedOption { - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + /** Properties of a NamePart. */ + interface INamePart { - /** FieldDescriptorProto typeName */ - typeName?: (string|null); + /** NamePart namePart */ + namePart: string; - /** FieldDescriptorProto extendee */ - extendee?: (string|null); + /** NamePart isExtension */ + isExtension: boolean; + } - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); + /** Represents a NamePart. */ + class NamePart implements INamePart { - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); + /** NamePart namePart. */ + public namePart: string; - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); + /** NamePart isExtension. */ + public isExtension: boolean; - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } + /** + * 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; - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { + /** + * 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; - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); + /** + * 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; - /** FieldDescriptorProto name. */ - public name: string; + /** + * 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; - /** FieldDescriptorProto number. */ - public number: number; + /** + * 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; - /** FieldDescriptorProto label. */ - public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + /** + * 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); - /** FieldDescriptorProto type. */ - public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + /** + * 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; - /** FieldDescriptorProto typeName. */ - public typeName: string; + /** + * 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 }; - /** FieldDescriptorProto extendee. */ - public extendee: string; + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } - /** FieldDescriptorProto jsonName. */ - public jsonName: string; + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; /** - * Creates a new FieldDescriptorProto instance using the specified properties. + * Creates a new SourceCodeInfo instance using the specified properties. * @param [properties] Properties to set - * @returns FieldDescriptorProto instance + * @returns SourceCodeInfo instance */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.ISourceCodeInfo, 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 + * 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.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * Decodes a SourceCodeInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto + * @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.FieldDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto + * @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.FieldDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; /** - * Verifies a FieldDescriptorProto message. + * Verifies a SourceCodeInfo message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FieldDescriptorProto + * @returns SourceCodeInfo */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto + * 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.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FieldDescriptorProto to JSON. + * Converts this SourceCodeInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace FieldDescriptorProto { + namespace SourceCodeInfo { - /** 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 - } + /** Properties of a Location. */ + interface ILocation { - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REQUIRED = 2, - LABEL_REPEATED = 3 - } - } + /** Location path */ + path?: (number[]|null); - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { + /** Location span */ + span?: (number[]|null); - /** OneofDescriptorProto name */ - name?: (string|null); + /** Location leadingComments */ + leadingComments?: (string|null); - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } + /** Location trailingComments */ + trailingComments?: (string|null); - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); + /** Represents a Location. */ + class Location implements ILocation { - /** OneofDescriptorProto name. */ - public name: string; + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); + /** Location path. */ + public path: number[]; - /** - * 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; + /** Location span. */ + public span: number[]; - /** - * 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; + /** Location leadingComments. */ + public leadingComments: string; - /** - * 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; + /** Location trailingComments. */ + public trailingComments: string; - /** - * 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; + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; - /** - * 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; + /** + * 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; - /** - * 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); + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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 }; + /** + * 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; - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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; - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { + /** + * 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); - /** EnumDescriptorProto name */ - name?: (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; - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + /** + * 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 }; - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); } - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { /** - * Constructs a new EnumDescriptorProto. + * Constructs a new GeneratedCodeInfo. * @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[]; + constructor(properties?: google.protobuf.IGeneratedCodeInfo); - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; /** - * Creates a new EnumDescriptorProto instance using the specified properties. + * Creates a new GeneratedCodeInfo instance using the specified properties. * @param [properties] Properties to set - * @returns EnumDescriptorProto instance + * @returns GeneratedCodeInfo instance */ - public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode + * 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.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IGeneratedCodeInfo, 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 + * 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.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto + * @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.EnumDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto + * @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.EnumDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; /** - * Verifies an EnumDescriptorProto message. + * Verifies a GeneratedCodeInfo message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EnumDescriptorProto + * @returns GeneratedCodeInfo */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto + * 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.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EnumDescriptorProto to JSON. + * Converts this GeneratedCodeInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace EnumDescriptorProto { + namespace GeneratedCodeInfo { - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { + /** Properties of an Annotation. */ + interface IAnnotation { - /** EnumReservedRange start */ - start?: (number|null); + /** Annotation path */ + path?: (number[]|null); - /** EnumReservedRange end */ + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ end?: (number|null); } - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { + /** Represents an Annotation. */ + class Annotation implements IAnnotation { /** - * Constructs a new EnumReservedRange. + * Constructs a new Annotation. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - /** EnumReservedRange start. */ - public start: number; + /** Annotation path. */ + public path: number[]; - /** EnumReservedRange end. */ + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ public end: number; /** - * Creates a new EnumReservedRange instance using the specified properties. + * Creates a new Annotation instance using the specified properties. * @param [properties] Properties to set - * @returns EnumReservedRange instance + * @returns Annotation instance */ - public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; /** - * 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 + * 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.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, 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 + * 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.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EnumReservedRange message from the specified reader or buffer. + * Decodes an Annotation message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EnumReservedRange + * @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.EnumDescriptorProto.EnumReservedRange; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * Decodes an Annotation message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EnumReservedRange + * @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.EnumDescriptorProto.EnumReservedRange; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; /** - * Verifies an EnumReservedRange message. + * Verifies an Annotation message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EnumReservedRange + * @returns Annotation */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @param message EnumReservedRange + * 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.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EnumReservedRange to JSON. + * Converts this Annotation to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } } - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); + /** Properties of a Timestamp. */ + interface ITimestamp { - /** EnumValueDescriptorProto number */ - number?: (number|null); + /** Timestamp seconds */ + seconds?: (number|Long|string|null); - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); + /** Timestamp nanos */ + nanos?: (number|null); } - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { /** - * Constructs a new EnumValueDescriptorProto. + * Constructs a new Timestamp. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; + constructor(properties?: google.protobuf.ITimestamp); - /** EnumValueDescriptorProto number. */ - public number: number; + /** Timestamp seconds. */ + public seconds: (number|Long|string); - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); + /** Timestamp nanos. */ + public nanos: number; /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. + * Creates a new Timestamp instance using the specified properties. * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance + * @returns Timestamp instance */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode + * 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.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.ITimestamp, 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 + * 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.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * 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 EnumValueDescriptorProto + * @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.EnumValueDescriptorProto; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a Timestamp message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto + * @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.EnumValueDescriptorProto; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; /** - * Verifies an EnumValueDescriptorProto message. + * 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 an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EnumValueDescriptorProto + * @returns Timestamp */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto + * 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.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EnumValueDescriptorProto to JSON. + * Converts this Timestamp 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); + /** Properties of a DoubleValue. */ + interface IDoubleValue { - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); + /** DoubleValue value */ + value?: (number|null); } - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { /** - * Constructs a new ServiceDescriptorProto. + * Constructs a new DoubleValue. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; + constructor(properties?: google.protobuf.IDoubleValue); - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); + /** DoubleValue value. */ + public value: number; /** - * Creates a new ServiceDescriptorProto instance using the specified properties. + * Creates a new DoubleValue instance using the specified properties. * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance + * @returns DoubleValue instance */ - public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue 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; + public static encode(message: google.protobuf.IDoubleValue, 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 + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue 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; + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * Decodes a DoubleValue message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ServiceDescriptorProto + * @returns DoubleValue * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto + * @returns DoubleValue * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; /** - * Verifies a ServiceDescriptorProto message. + * Verifies a DoubleValue message. * @param message Plain object 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. + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ServiceDescriptorProto + * @returns DoubleValue */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ServiceDescriptorProto to JSON. + * Converts this DoubleValue 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); + /** Properties of a FloatValue. */ + interface IFloatValue { - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); + /** FloatValue value */ + value?: (number|null); } - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { /** - * Constructs a new MethodDescriptorProto. + * Constructs a new FloatValue. * @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; + constructor(properties?: google.protobuf.IFloatValue); - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; + /** FloatValue value. */ + public value: number; /** - * Creates a new MethodDescriptorProto instance using the specified properties. + * Creates a new FloatValue instance using the specified properties. * @param [properties] Properties to set - * @returns MethodDescriptorProto instance + * @returns FloatValue instance */ - public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue 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; + public static encode(message: google.protobuf.IFloatValue, 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 + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue 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; + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * Decodes a FloatValue message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto + * @returns FloatValue * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a FloatValue message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto + * @returns FloatValue * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; /** - * Verifies a MethodDescriptorProto message. + * Verifies a FloatValue message. * @param message Plain object 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. + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MethodDescriptorProto + * @returns FloatValue */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MethodDescriptorProto to JSON. + * Converts this FloatValue 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); + /** Properties of an Int64Value. */ + interface IInt64Value { - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + /** Int64Value value */ + value?: (number|Long|string|null); } - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { /** - * Constructs a new FileOptions. + * Constructs a new Int64Value. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IFileOptions); + constructor(properties?: google.protobuf.IInt64Value); - /** 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; + /** Int64Value value. */ + public value: (number|Long|string); - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileOptions phpGenericServices. */ - public phpGenericServices: boolean; + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not 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.Int64Value; - /** FileOptions deprecated. */ - public deprecated: boolean; + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload 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.Int64Value; - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; + /** + * Verifies an Int64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; + /** Properties of a UInt64Value. */ + interface IUInt64Value { - /** FileOptions phpNamespace. */ - public phpNamespace: string; + /** UInt64Value value */ + value?: (number|Long|string|null); + } - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { - /** FileOptions rubyPackage. */ - public rubyPackage: string; + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** UInt64Value value. */ + public value: (number|Long|string); /** - * Creates a new FileOptions instance using the specified properties. + * Creates a new UInt64Value instance using the specified properties. * @param [properties] Properties to set - * @returns FileOptions instance + * @returns UInt64Value instance */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value 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; + public static encode(message: google.protobuf.IUInt64Value, 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 + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value 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; + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FileOptions message from the specified reader or buffer. + * Decodes a UInt64Value message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FileOptions + * @returns UInt64Value * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FileOptions + * @returns UInt64Value * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; /** - * Verifies a FileOptions message. + * Verifies a UInt64Value message. * @param message Plain object 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. + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FileOptions + * @returns UInt64Value */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FileOptions to JSON. + * Converts this UInt64Value 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); + /** Properties of an Int32Value. */ + interface IInt32Value { - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); + /** Int32Value value */ + value?: (number|null); } - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { /** - * Constructs a new MessageOptions. + * Constructs a new Int32Value. * @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; + constructor(properties?: google.protobuf.IInt32Value); - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** Int32Value value. */ + public value: number; /** - * Creates a new MessageOptions instance using the specified properties. + * Creates a new Int32Value instance using the specified properties. * @param [properties] Properties to set - * @returns MessageOptions instance + * @returns Int32Value instance */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value 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; + public static encode(message: google.protobuf.IInt32Value, 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 + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value 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; + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MessageOptions message from the specified reader or buffer. + * Decodes an Int32Value message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MessageOptions + * @returns Int32Value * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * Decodes an Int32Value message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MessageOptions + * @returns Int32Value * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; /** - * Verifies a MessageOptions message. + * Verifies an Int32Value message. * @param message Plain object 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. + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MessageOptions + * @returns Int32Value */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MessageOptions to JSON. + * Converts this Int32Value to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a FieldOptions. */ - interface IFieldOptions { + /** Properties of a UInt32Value. */ + interface IUInt32Value { - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + /** UInt32Value value */ + value?: (number|null); + } - /** FieldOptions packed */ - packed?: (boolean|null); + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); - /** FieldOptions lazy */ - lazy?: (boolean|null); + /** UInt32Value value. */ + public value: number; - /** FieldOptions deprecated */ - deprecated?: (boolean|null); + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; - /** FieldOptions weak */ - weak?: (boolean|null); + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not 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.UInt32Value; - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - } + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload 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.UInt32Value; - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value */ - constructor(properties?: google.protobuf.IFieldOptions); + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; - /** FieldOptions ctype. */ - public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** FieldOptions packed. */ - public packed: boolean; + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FieldOptions jstype. */ - public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + /** Properties of a BoolValue. */ + interface IBoolValue { - /** FieldOptions lazy. */ - public lazy: boolean; + /** BoolValue value */ + value?: (boolean|null); + } - /** FieldOptions deprecated. */ - public deprecated: boolean; + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { - /** FieldOptions weak. */ - public weak: boolean; + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** BoolValue value. */ + public value: boolean; /** - * Creates a new FieldOptions instance using the specified properties. + * Creates a new BoolValue instance using the specified properties. * @param [properties] Properties to set - * @returns FieldOptions instance + * @returns BoolValue instance */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue 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; + public static encode(message: google.protobuf.IBoolValue, 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 + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue 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; + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FieldOptions message from the specified reader or buffer. + * Decodes a BoolValue message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FieldOptions + * @returns BoolValue * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * Decodes a BoolValue message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FieldOptions + * @returns BoolValue * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; /** - * Verifies a FieldOptions message. + * Verifies a BoolValue message. * @param message Plain object 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. + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FieldOptions + * @returns BoolValue */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FieldOptions to JSON. + * Converts this BoolValue 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 { + /** Properties of a StringValue. */ + interface IStringValue { - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** StringValue value */ + value?: (string|null); } - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { + /** Represents a StringValue. */ + class StringValue implements IStringValue { /** - * Constructs a new OneofOptions. + * Constructs a new StringValue. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; /** - * Creates a new OneofOptions instance using the specified properties. + * Creates a new StringValue instance using the specified properties. * @param [properties] Properties to set - * @returns OneofOptions instance + * @returns StringValue instance */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue 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; + public static encode(message: google.protobuf.IStringValue, 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 + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue 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; + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OneofOptions message from the specified reader or buffer. + * Decodes a StringValue message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OneofOptions + * @returns StringValue * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * Decodes a StringValue message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OneofOptions + * @returns StringValue * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; /** - * Verifies an OneofOptions message. + * Verifies a StringValue message. * @param message Plain 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. + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OneofOptions + * @returns StringValue */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OneofOptions to JSON. + * Converts this StringValue 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); + /** Properties of a BytesValue. */ + interface IBytesValue { - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** BytesValue value */ + value?: (Uint8Array|string|null); } - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { /** - * Constructs a new EnumOptions. + * Constructs a new BytesValue. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; + constructor(properties?: google.protobuf.IBytesValue); - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** BytesValue value. */ + public value: (Uint8Array|string); /** - * Creates a new EnumOptions instance using the specified properties. + * Creates a new BytesValue instance using the specified properties. * @param [properties] Properties to set - * @returns EnumOptions instance + * @returns BytesValue instance */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue 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; + public static encode(message: google.protobuf.IBytesValue, 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 + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue 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; + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EnumOptions message from the specified reader or buffer. + * Decodes a BytesValue message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EnumOptions + * @returns BytesValue * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * Decodes a BytesValue message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EnumOptions + * @returns BytesValue * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; /** - * Verifies an EnumOptions message. + * Verifies a BytesValue message. * @param message Plain 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. + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EnumOptions + * @returns BytesValue */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EnumOptions to JSON. + * Converts this BytesValue to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { + /** Properties of an Any. */ + interface IAny { - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); + /** Any type_url */ + type_url?: (string|null); - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** Any value */ + value?: (Uint8Array|string|null); } - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { + /** Represents an Any. */ + class Any implements IAny { /** - * Constructs a new EnumValueOptions. + * Constructs a new Any. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IEnumValueOptions); + constructor(properties?: google.protobuf.IAny); - /** EnumValueOptions deprecated. */ - public deprecated: boolean; + /** Any type_url. */ + public type_url: string; - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** Any value. */ + public value: (Uint8Array|string); /** - * Creates a new EnumValueOptions instance using the specified properties. + * Creates a new Any instance using the specified properties. * @param [properties] Properties to set - * @returns EnumValueOptions instance + * @returns Any instance */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode + * 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.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IAny, 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 + * 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.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EnumValueOptions message from the specified reader or buffer. + * 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 EnumValueOptions + * @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.EnumValueOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * Decodes an Any message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EnumValueOptions + * @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.EnumValueOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; /** - * Verifies an EnumValueOptions message. + * 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 EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * Creates an Any message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EnumValueOptions + * @returns Any */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions + * 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.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EnumValueOptions to JSON. + * Converts this Any 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); + /** Properties of an Empty. */ + interface IEmpty { } - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { + /** Represents an Empty. */ + class Empty implements IEmpty { /** - * Constructs a new ServiceOptions. + * Constructs a new Empty. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + constructor(properties?: google.protobuf.IEmpty); /** - * Creates a new ServiceOptions instance using the specified properties. + * Creates a new Empty instance using the specified properties. * @param [properties] Properties to set - * @returns ServiceOptions instance + * @returns Empty instance */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode + * Encodes the specified 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.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode + * Encodes the specified 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.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ServiceOptions message from the specified reader or buffer. + * Decodes an Empty message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ServiceOptions + * @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.ServiceOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * Decodes an Empty message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ServiceOptions + * @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.ServiceOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; /** - * Verifies a ServiceOptions message. + * Verifies an Empty message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * Creates an Empty message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ServiceOptions + * @returns Empty */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions + * Creates a plain object from an 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.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ServiceOptions to JSON. + * Converts this Empty 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); + /** Namespace api. */ + namespace api { - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** Properties of a Http. */ + interface IHttp { - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); } - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { + /** Represents a Http. */ + class Http implements IHttp { /** - * Constructs a new MethodOptions. + * Constructs a new Http. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; + constructor(properties?: google.api.IHttp); - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + /** Http rules. */ + public rules: google.api.IHttpRule[]; - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; /** - * Creates a new MethodOptions instance using the specified properties. + * Creates a new Http instance using the specified properties. * @param [properties] Properties to set - * @returns MethodOptions instance + * @returns Http instance */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + public static create(properties?: google.api.IHttp): google.api.Http; /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode + * Encodes the specified 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.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode + * Encodes the specified 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.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MethodOptions message from the specified reader or buffer. + * Decodes a Http message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MethodOptions + * @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.protobuf.MethodOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * Decodes a Http message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MethodOptions + * @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.protobuf.MethodOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; /** - * Verifies a MethodOptions message. + * Verifies a Http message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * Creates a Http message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MethodOptions + * @returns Http */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + public static fromObject(object: { [k: string]: any }): google.api.Http; /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions + * Creates a plain object from a 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.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MethodOptions to JSON. + * Converts this Http to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace MethodOptions { + /** Properties of a HttpRule. */ + interface IHttpRule { - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } + /** HttpRule selector */ + selector?: (string|null); - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { + /** HttpRule get */ + get?: (string|null); - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + /** HttpRule put */ + put?: (string|null); - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); + /** HttpRule post */ + post?: (string|null); - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); + /** HttpRule delete */ + "delete"?: (string|null); - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); + /** HttpRule patch */ + patch?: (string|null); - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|string|null); + /** HttpRule body */ + body?: (string|null); - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); } - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { /** - * Constructs a new UninterpretedOption. + * Constructs a new HttpRule. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IUninterpretedOption); + constructor(properties?: google.api.IHttpRule); - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; + /** HttpRule selector. */ + public selector: string; - /** UninterpretedOption identifierValue. */ - public identifierValue: string; + /** HttpRule get. */ + public get?: (string|null); - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long|string); + /** HttpRule put. */ + public put?: (string|null); - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); + /** HttpRule post. */ + public post?: (string|null); - /** UninterpretedOption doubleValue. */ - public doubleValue: number; + /** HttpRule delete. */ + public delete?: (string|null); - /** UninterpretedOption stringValue. */ - public stringValue: (Uint8Array|string); + /** HttpRule patch. */ + public patch?: (string|null); - /** UninterpretedOption aggregateValue. */ - public aggregateValue: 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 UninterpretedOption instance using the specified properties. + * Creates a new HttpRule instance using the specified properties. * @param [properties] Properties to set - * @returns UninterpretedOption instance + * @returns HttpRule instance */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode + * 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.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode + * Encodes the specified 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.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UninterpretedOption message from the specified reader or buffer. + * 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 UninterpretedOption + * @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.protobuf.UninterpretedOption; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * Decodes a HttpRule message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UninterpretedOption + * @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.protobuf.UninterpretedOption; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; /** - * Verifies an UninterpretedOption message. + * 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 an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UninterpretedOption + * @returns HttpRule */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption + * Creates a plain object from a 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.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UninterpretedOption to JSON. + * Converts this HttpRule 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 }; - } + */ + public toJSON(): { [k: string]: any }; } - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); } - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { /** - * Constructs a new SourceCodeInfo. + * Constructs a new CustomHttpPattern. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.ISourceCodeInfo); + constructor(properties?: google.api.ICustomHttpPattern); - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; /** - * Creates a new SourceCodeInfo instance using the specified properties. + * Creates a new CustomHttpPattern instance using the specified properties. * @param [properties] Properties to set - * @returns SourceCodeInfo instance + * @returns CustomHttpPattern instance */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode + * Encodes the specified 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.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode + * Encodes the specified 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.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. + * 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 SourceCodeInfo + * @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.protobuf.SourceCodeInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo + * @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.protobuf.SourceCodeInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; /** - * Verifies a SourceCodeInfo message. + * 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 SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SourceCodeInfo + * @returns CustomHttpPattern */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo + * 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.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SourceCodeInfo to JSON. + * Converts this CustomHttpPattern 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[]; + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6 + } - /** Location leadingComments. */ - public leadingComments: string; + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { - /** Location trailingComments. */ - public trailingComments: string; + /** ResourceDescriptor type */ + type?: (string|null); - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + /** ResourceDescriptor nameField */ + nameField?: (string|null); - /** - * 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; + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); - /** - * 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; + /** ResourceDescriptor plural */ + plural?: (string|null); - /** - * 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; + /** ResourceDescriptor singular */ + singular?: (string|null); - /** - * 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; + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } - /** - * 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); + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { - /** - * 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; + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); - /** - * 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 }; + /** ResourceDescriptor type. */ + public type: string; - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** ResourceDescriptor pattern. */ + public pattern: string[]; - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { + /** ResourceDescriptor nameField. */ + public nameField: string; - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { + /** ResourceDescriptor plural. */ + public plural: string; - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); + /** ResourceDescriptor singular. */ + public singular: string; - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; /** - * Creates a new GeneratedCodeInfo instance using the specified properties. + * Creates a new ResourceDescriptor instance using the specified properties. * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance + * @returns ResourceDescriptor instance */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode + * Encodes the specified 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.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode + * Encodes the specified 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.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * 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 GeneratedCodeInfo + * @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.protobuf.GeneratedCodeInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo + * @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.protobuf.GeneratedCodeInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; /** - * Verifies a GeneratedCodeInfo message. + * 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 GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GeneratedCodeInfo + * @returns ResourceDescriptor */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo + * Creates a plain object from a 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.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GeneratedCodeInfo to JSON. + * Converts this ResourceDescriptor 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); + namespace ResourceDescriptor { - /** Annotation end */ - end?: (number|null); + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 } - /** 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 }; + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 } } - /** Properties of a Timestamp. */ - interface ITimestamp { + /** Properties of a ResourceReference. */ + interface IResourceReference { - /** Timestamp seconds */ - seconds?: (number|Long|string|null); + /** ResourceReference type */ + type?: (string|null); - /** Timestamp nanos */ - nanos?: (number|null); + /** ResourceReference childType */ + childType?: (string|null); } - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { /** - * Constructs a new Timestamp. + * Constructs a new ResourceReference. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.ITimestamp); + constructor(properties?: google.api.IResourceReference); - /** Timestamp seconds. */ - public seconds: (number|Long|string); + /** ResourceReference type. */ + public type: string; - /** Timestamp nanos. */ - public nanos: number; + /** ResourceReference childType. */ + public childType: string; /** - * Creates a new Timestamp instance using the specified properties. + * Creates a new ResourceReference instance using the specified properties. * @param [properties] Properties to set - * @returns Timestamp instance + * @returns ResourceReference instance */ - public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode + * Encodes the specified 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.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode + * Encodes the specified 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.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Timestamp message from the specified reader or buffer. + * 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 Timestamp + * @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.protobuf.Timestamp; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Timestamp + * @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.protobuf.Timestamp; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; /** - * Verifies a Timestamp message. + * 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 Timestamp message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Timestamp + * @returns ResourceReference */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp + * Creates a plain object from a 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.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Timestamp to JSON. + * Converts this ResourceReference to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } - /** Properties of an Empty. */ - interface IEmpty { + /** 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 an Empty. */ - class Empty implements IEmpty { + /** Represents a Status. */ + class Status implements IStatus { /** - * Constructs a new Empty. + * Constructs a new Status. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IEmpty); + 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 Empty instance using the specified properties. + * Creates a new Status instance using the specified properties. * @param [properties] Properties to set - * @returns Empty instance + * @returns Status instance */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + public static create(properties?: google.rpc.IStatus): google.rpc.Status; /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode + * Encodes the specified 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.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode + * Encodes the specified 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.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Empty message from the specified reader or buffer. + * 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 Empty + * @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.protobuf.Empty; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; /** - * Decodes an Empty message from the specified reader or buffer, length delimited. + * Decodes a Status message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Empty + * @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.protobuf.Empty; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; /** - * Verifies an Empty message. + * 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 an Empty message from a plain object. Also converts values to their respective internal types. + * Creates a Status message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Empty + * @returns Status */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + public static fromObject(object: { [k: string]: any }): google.rpc.Status; /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty + * Creates a plain object from a 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.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Empty to JSON. + * Converts this Status to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; diff --git a/packages/google-cloud-bigquery-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index a1cde29224c..5e9a6239f21 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/protos/protos.js @@ -1145,6 +1145,404 @@ return AvroRows; })(); + v1.ProtoSchema = (function() { + + /** + * Properties of a ProtoSchema. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IProtoSchema + * @property {google.protobuf.IDescriptorProto|null} [protoDescriptor] ProtoSchema protoDescriptor + */ + + /** + * Constructs a new ProtoSchema. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a ProtoSchema. + * @implements IProtoSchema + * @constructor + * @param {google.cloud.bigquery.storage.v1.IProtoSchema=} [properties] Properties to set + */ + function ProtoSchema(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProtoSchema protoDescriptor. + * @member {google.protobuf.IDescriptorProto|null|undefined} protoDescriptor + * @memberof google.cloud.bigquery.storage.v1.ProtoSchema + * @instance + */ + ProtoSchema.prototype.protoDescriptor = null; + + /** + * Creates a new ProtoSchema instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.ProtoSchema + * @static + * @param {google.cloud.bigquery.storage.v1.IProtoSchema=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.ProtoSchema} ProtoSchema instance + */ + ProtoSchema.create = function create(properties) { + return new ProtoSchema(properties); + }; + + /** + * Encodes the specified ProtoSchema message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ProtoSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.ProtoSchema + * @static + * @param {google.cloud.bigquery.storage.v1.IProtoSchema} message ProtoSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoSchema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.protoDescriptor != null && Object.hasOwnProperty.call(message, "protoDescriptor")) + $root.google.protobuf.DescriptorProto.encode(message.protoDescriptor, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProtoSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ProtoSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ProtoSchema + * @static + * @param {google.cloud.bigquery.storage.v1.IProtoSchema} message ProtoSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProtoSchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.ProtoSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.ProtoSchema} ProtoSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoSchema.decode = function decode(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.storage.v1.ProtoSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.protoDescriptor = $root.google.protobuf.DescriptorProto.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProtoSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ProtoSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.ProtoSchema} ProtoSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProtoSchema message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.ProtoSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProtoSchema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.protoDescriptor != null && message.hasOwnProperty("protoDescriptor")) { + var error = $root.google.protobuf.DescriptorProto.verify(message.protoDescriptor); + if (error) + return "protoDescriptor." + error; + } + return null; + }; + + /** + * Creates a ProtoSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.ProtoSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.ProtoSchema} ProtoSchema + */ + ProtoSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.ProtoSchema) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.ProtoSchema(); + if (object.protoDescriptor != null) { + if (typeof object.protoDescriptor !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ProtoSchema.protoDescriptor: object expected"); + message.protoDescriptor = $root.google.protobuf.DescriptorProto.fromObject(object.protoDescriptor); + } + return message; + }; + + /** + * Creates a plain object from a ProtoSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.ProtoSchema + * @static + * @param {google.cloud.bigquery.storage.v1.ProtoSchema} message ProtoSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProtoSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.protoDescriptor = null; + if (message.protoDescriptor != null && message.hasOwnProperty("protoDescriptor")) + object.protoDescriptor = $root.google.protobuf.DescriptorProto.toObject(message.protoDescriptor, options); + return object; + }; + + /** + * Converts this ProtoSchema to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.ProtoSchema + * @instance + * @returns {Object.} JSON object + */ + ProtoSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProtoSchema; + })(); + + v1.ProtoRows = (function() { + + /** + * Properties of a ProtoRows. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IProtoRows + * @property {Array.|null} [serializedRows] ProtoRows serializedRows + */ + + /** + * Constructs a new ProtoRows. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a ProtoRows. + * @implements IProtoRows + * @constructor + * @param {google.cloud.bigquery.storage.v1.IProtoRows=} [properties] Properties to set + */ + function ProtoRows(properties) { + this.serializedRows = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProtoRows serializedRows. + * @member {Array.} serializedRows + * @memberof google.cloud.bigquery.storage.v1.ProtoRows + * @instance + */ + ProtoRows.prototype.serializedRows = $util.emptyArray; + + /** + * Creates a new ProtoRows instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.ProtoRows + * @static + * @param {google.cloud.bigquery.storage.v1.IProtoRows=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.ProtoRows} ProtoRows instance + */ + ProtoRows.create = function create(properties) { + return new ProtoRows(properties); + }; + + /** + * Encodes the specified ProtoRows message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ProtoRows.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.ProtoRows + * @static + * @param {google.cloud.bigquery.storage.v1.IProtoRows} message ProtoRows message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoRows.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serializedRows != null && message.serializedRows.length) + for (var i = 0; i < message.serializedRows.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.serializedRows[i]); + return writer; + }; + + /** + * Encodes the specified ProtoRows message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ProtoRows.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ProtoRows + * @static + * @param {google.cloud.bigquery.storage.v1.IProtoRows} message ProtoRows message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtoRows.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProtoRows message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.ProtoRows + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.ProtoRows} ProtoRows + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoRows.decode = function decode(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.storage.v1.ProtoRows(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.serializedRows && message.serializedRows.length)) + message.serializedRows = []; + message.serializedRows.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProtoRows message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ProtoRows + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.ProtoRows} ProtoRows + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProtoRows.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProtoRows message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.ProtoRows + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProtoRows.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serializedRows != null && message.hasOwnProperty("serializedRows")) { + if (!Array.isArray(message.serializedRows)) + return "serializedRows: array expected"; + for (var i = 0; i < message.serializedRows.length; ++i) + if (!(message.serializedRows[i] && typeof message.serializedRows[i].length === "number" || $util.isString(message.serializedRows[i]))) + return "serializedRows: buffer[] expected"; + } + return null; + }; + + /** + * Creates a ProtoRows message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.ProtoRows + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.ProtoRows} ProtoRows + */ + ProtoRows.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.ProtoRows) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.ProtoRows(); + if (object.serializedRows) { + if (!Array.isArray(object.serializedRows)) + throw TypeError(".google.cloud.bigquery.storage.v1.ProtoRows.serializedRows: array expected"); + message.serializedRows = []; + for (var i = 0; i < object.serializedRows.length; ++i) + if (typeof object.serializedRows[i] === "string") + $util.base64.decode(object.serializedRows[i], message.serializedRows[i] = $util.newBuffer($util.base64.length(object.serializedRows[i])), 0); + else if (object.serializedRows[i].length) + message.serializedRows[i] = object.serializedRows[i]; + } + return message; + }; + + /** + * Creates a plain object from a ProtoRows message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.ProtoRows + * @static + * @param {google.cloud.bigquery.storage.v1.ProtoRows} message ProtoRows + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProtoRows.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.serializedRows = []; + if (message.serializedRows && message.serializedRows.length) { + object.serializedRows = []; + for (var j = 0; j < message.serializedRows.length; ++j) + object.serializedRows[j] = options.bytes === String ? $util.base64.encode(message.serializedRows[j], 0, message.serializedRows[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedRows[j]) : message.serializedRows[j]; + } + return object; + }; + + /** + * Converts this ProtoRows to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.ProtoRows + * @instance + * @returns {Object.} JSON object + */ + ProtoRows.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProtoRows; + })(); + v1.BigQueryRead = (function() { /** @@ -1279,13 +1677,246 @@ return BigQueryRead; })(); - v1.CreateReadSessionRequest = (function() { + v1.BigQueryWrite = (function() { /** - * Properties of a CreateReadSessionRequest. + * Constructs a new BigQueryWrite service. * @memberof google.cloud.bigquery.storage.v1 - * @interface ICreateReadSessionRequest - * @property {string|null} [parent] CreateReadSessionRequest parent + * @classdesc Represents a BigQueryWrite + * @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 BigQueryWrite(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (BigQueryWrite.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BigQueryWrite; + + /** + * Creates new BigQueryWrite service using the specified rpc implementation. + * @function create + * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite + * @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 {BigQueryWrite} RPC service. Useful where requests and/or responses are streamed. + */ + BigQueryWrite.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#createWriteStream}. + * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite + * @typedef CreateWriteStreamCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.storage.v1.WriteStream} [response] WriteStream + */ + + /** + * Calls CreateWriteStream. + * @function createWriteStream + * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite + * @instance + * @param {google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest} request CreateWriteStreamRequest message or plain object + * @param {google.cloud.bigquery.storage.v1.BigQueryWrite.CreateWriteStreamCallback} callback Node-style callback called with the error, if any, and WriteStream + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigQueryWrite.prototype.createWriteStream = function createWriteStream(request, callback) { + return this.rpcCall(createWriteStream, $root.google.cloud.bigquery.storage.v1.CreateWriteStreamRequest, $root.google.cloud.bigquery.storage.v1.WriteStream, request, callback); + }, "name", { value: "CreateWriteStream" }); + + /** + * Calls CreateWriteStream. + * @function createWriteStream + * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite + * @instance + * @param {google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest} request CreateWriteStreamRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#appendRows}. + * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite + * @typedef AppendRowsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.storage.v1.AppendRowsResponse} [response] AppendRowsResponse + */ + + /** + * Calls AppendRows. + * @function appendRows + * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite + * @instance + * @param {google.cloud.bigquery.storage.v1.IAppendRowsRequest} request AppendRowsRequest message or plain object + * @param {google.cloud.bigquery.storage.v1.BigQueryWrite.AppendRowsCallback} callback Node-style callback called with the error, if any, and AppendRowsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigQueryWrite.prototype.appendRows = function appendRows(request, callback) { + return this.rpcCall(appendRows, $root.google.cloud.bigquery.storage.v1.AppendRowsRequest, $root.google.cloud.bigquery.storage.v1.AppendRowsResponse, request, callback); + }, "name", { value: "AppendRows" }); + + /** + * Calls AppendRows. + * @function appendRows + * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite + * @instance + * @param {google.cloud.bigquery.storage.v1.IAppendRowsRequest} request AppendRowsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#getWriteStream}. + * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite + * @typedef GetWriteStreamCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.storage.v1.WriteStream} [response] WriteStream + */ + + /** + * Calls GetWriteStream. + * @function getWriteStream + * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite + * @instance + * @param {google.cloud.bigquery.storage.v1.IGetWriteStreamRequest} request GetWriteStreamRequest message or plain object + * @param {google.cloud.bigquery.storage.v1.BigQueryWrite.GetWriteStreamCallback} callback Node-style callback called with the error, if any, and WriteStream + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigQueryWrite.prototype.getWriteStream = function getWriteStream(request, callback) { + return this.rpcCall(getWriteStream, $root.google.cloud.bigquery.storage.v1.GetWriteStreamRequest, $root.google.cloud.bigquery.storage.v1.WriteStream, request, callback); + }, "name", { value: "GetWriteStream" }); + + /** + * Calls GetWriteStream. + * @function getWriteStream + * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite + * @instance + * @param {google.cloud.bigquery.storage.v1.IGetWriteStreamRequest} request GetWriteStreamRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#finalizeWriteStream}. + * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite + * @typedef FinalizeWriteStreamCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse} [response] FinalizeWriteStreamResponse + */ + + /** + * Calls FinalizeWriteStream. + * @function finalizeWriteStream + * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite + * @instance + * @param {google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest} request FinalizeWriteStreamRequest message or plain object + * @param {google.cloud.bigquery.storage.v1.BigQueryWrite.FinalizeWriteStreamCallback} callback Node-style callback called with the error, if any, and FinalizeWriteStreamResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigQueryWrite.prototype.finalizeWriteStream = function finalizeWriteStream(request, callback) { + return this.rpcCall(finalizeWriteStream, $root.google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest, $root.google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse, request, callback); + }, "name", { value: "FinalizeWriteStream" }); + + /** + * Calls FinalizeWriteStream. + * @function finalizeWriteStream + * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite + * @instance + * @param {google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest} request FinalizeWriteStreamRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#batchCommitWriteStreams}. + * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite + * @typedef BatchCommitWriteStreamsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse} [response] BatchCommitWriteStreamsResponse + */ + + /** + * Calls BatchCommitWriteStreams. + * @function batchCommitWriteStreams + * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite + * @instance + * @param {google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest} request BatchCommitWriteStreamsRequest message or plain object + * @param {google.cloud.bigquery.storage.v1.BigQueryWrite.BatchCommitWriteStreamsCallback} callback Node-style callback called with the error, if any, and BatchCommitWriteStreamsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigQueryWrite.prototype.batchCommitWriteStreams = function batchCommitWriteStreams(request, callback) { + return this.rpcCall(batchCommitWriteStreams, $root.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest, $root.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse, request, callback); + }, "name", { value: "BatchCommitWriteStreams" }); + + /** + * Calls BatchCommitWriteStreams. + * @function batchCommitWriteStreams + * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite + * @instance + * @param {google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest} request BatchCommitWriteStreamsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#flushRows}. + * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite + * @typedef FlushRowsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.storage.v1.FlushRowsResponse} [response] FlushRowsResponse + */ + + /** + * Calls FlushRows. + * @function flushRows + * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite + * @instance + * @param {google.cloud.bigquery.storage.v1.IFlushRowsRequest} request FlushRowsRequest message or plain object + * @param {google.cloud.bigquery.storage.v1.BigQueryWrite.FlushRowsCallback} callback Node-style callback called with the error, if any, and FlushRowsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigQueryWrite.prototype.flushRows = function flushRows(request, callback) { + return this.rpcCall(flushRows, $root.google.cloud.bigquery.storage.v1.FlushRowsRequest, $root.google.cloud.bigquery.storage.v1.FlushRowsResponse, request, callback); + }, "name", { value: "FlushRows" }); + + /** + * Calls FlushRows. + * @function flushRows + * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite + * @instance + * @param {google.cloud.bigquery.storage.v1.IFlushRowsRequest} request FlushRowsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return BigQueryWrite; + })(); + + v1.CreateReadSessionRequest = (function() { + + /** + * Properties of a CreateReadSessionRequest. + * @memberof google.cloud.bigquery.storage.v1 + * @interface ICreateReadSessionRequest + * @property {string|null} [parent] CreateReadSessionRequest parent * @property {google.cloud.bigquery.storage.v1.IReadSession|null} [readSession] CreateReadSessionRequest readSession * @property {number|null} [maxStreamCount] CreateReadSessionRequest maxStreamCount */ @@ -3173,50 +3804,25 @@ return SplitReadStreamResponse; })(); - /** - * DataFormat enum. - * @name google.cloud.bigquery.storage.v1.DataFormat - * @enum {number} - * @property {number} DATA_FORMAT_UNSPECIFIED=0 DATA_FORMAT_UNSPECIFIED value - * @property {number} AVRO=1 AVRO value - * @property {number} ARROW=2 ARROW value - */ - v1.DataFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DATA_FORMAT_UNSPECIFIED"] = 0; - values[valuesById[1] = "AVRO"] = 1; - values[valuesById[2] = "ARROW"] = 2; - return values; - })(); - - v1.ReadSession = (function() { + v1.CreateWriteStreamRequest = (function() { /** - * Properties of a ReadSession. + * Properties of a CreateWriteStreamRequest. * @memberof google.cloud.bigquery.storage.v1 - * @interface IReadSession - * @property {string|null} [name] ReadSession name - * @property {google.protobuf.ITimestamp|null} [expireTime] ReadSession expireTime - * @property {google.cloud.bigquery.storage.v1.DataFormat|null} [dataFormat] ReadSession dataFormat - * @property {google.cloud.bigquery.storage.v1.IAvroSchema|null} [avroSchema] ReadSession avroSchema - * @property {google.cloud.bigquery.storage.v1.IArrowSchema|null} [arrowSchema] ReadSession arrowSchema - * @property {string|null} [table] ReadSession table - * @property {google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers|null} [tableModifiers] ReadSession tableModifiers - * @property {google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions|null} [readOptions] ReadSession readOptions - * @property {Array.|null} [streams] ReadSession streams - * @property {number|Long|null} [estimatedTotalBytesScanned] ReadSession estimatedTotalBytesScanned + * @interface ICreateWriteStreamRequest + * @property {string|null} [parent] CreateWriteStreamRequest parent + * @property {google.cloud.bigquery.storage.v1.IWriteStream|null} [writeStream] CreateWriteStreamRequest writeStream */ /** - * Constructs a new ReadSession. + * Constructs a new CreateWriteStreamRequest. * @memberof google.cloud.bigquery.storage.v1 - * @classdesc Represents a ReadSession. - * @implements IReadSession + * @classdesc Represents a CreateWriteStreamRequest. + * @implements ICreateWriteStreamRequest * @constructor - * @param {google.cloud.bigquery.storage.v1.IReadSession=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest=} [properties] Properties to set */ - function ReadSession(properties) { - this.streams = []; + function CreateWriteStreamRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3224,209 +3830,345 @@ } /** - * ReadSession name. - * @member {string} name - * @memberof google.cloud.bigquery.storage.v1.ReadSession + * CreateWriteStreamRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.storage.v1.CreateWriteStreamRequest * @instance */ - ReadSession.prototype.name = ""; + CreateWriteStreamRequest.prototype.parent = ""; /** - * ReadSession expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.bigquery.storage.v1.ReadSession + * CreateWriteStreamRequest writeStream. + * @member {google.cloud.bigquery.storage.v1.IWriteStream|null|undefined} writeStream + * @memberof google.cloud.bigquery.storage.v1.CreateWriteStreamRequest * @instance */ - ReadSession.prototype.expireTime = null; + CreateWriteStreamRequest.prototype.writeStream = null; /** - * ReadSession dataFormat. - * @member {google.cloud.bigquery.storage.v1.DataFormat} dataFormat - * @memberof google.cloud.bigquery.storage.v1.ReadSession - * @instance + * Creates a new CreateWriteStreamRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.CreateWriteStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.CreateWriteStreamRequest} CreateWriteStreamRequest instance */ - ReadSession.prototype.dataFormat = 0; + CreateWriteStreamRequest.create = function create(properties) { + return new CreateWriteStreamRequest(properties); + }; /** - * ReadSession avroSchema. - * @member {google.cloud.bigquery.storage.v1.IAvroSchema|null|undefined} avroSchema - * @memberof google.cloud.bigquery.storage.v1.ReadSession - * @instance + * Encodes the specified CreateWriteStreamRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1.CreateWriteStreamRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.CreateWriteStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest} message CreateWriteStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - ReadSession.prototype.avroSchema = null; + CreateWriteStreamRequest.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.writeStream != null && Object.hasOwnProperty.call(message, "writeStream")) + $root.google.cloud.bigquery.storage.v1.WriteStream.encode(message.writeStream, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; /** - * ReadSession arrowSchema. - * @member {google.cloud.bigquery.storage.v1.IArrowSchema|null|undefined} arrowSchema - * @memberof google.cloud.bigquery.storage.v1.ReadSession - * @instance + * Encodes the specified CreateWriteStreamRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.CreateWriteStreamRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.CreateWriteStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest} message CreateWriteStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - ReadSession.prototype.arrowSchema = null; + CreateWriteStreamRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * ReadSession table. - * @member {string} table - * @memberof google.cloud.bigquery.storage.v1.ReadSession - * @instance + * Decodes a CreateWriteStreamRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.CreateWriteStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.CreateWriteStreamRequest} CreateWriteStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadSession.prototype.table = ""; + CreateWriteStreamRequest.decode = function decode(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.storage.v1.CreateWriteStreamRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.writeStream = $root.google.cloud.bigquery.storage.v1.WriteStream.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * ReadSession tableModifiers. - * @member {google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers|null|undefined} tableModifiers - * @memberof google.cloud.bigquery.storage.v1.ReadSession - * @instance + * Decodes a CreateWriteStreamRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.CreateWriteStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.CreateWriteStreamRequest} CreateWriteStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadSession.prototype.tableModifiers = null; + CreateWriteStreamRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * ReadSession readOptions. - * @member {google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions|null|undefined} readOptions - * @memberof google.cloud.bigquery.storage.v1.ReadSession - * @instance + * Verifies a CreateWriteStreamRequest message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.CreateWriteStreamRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReadSession.prototype.readOptions = null; - - /** - * ReadSession streams. - * @member {Array.} streams - * @memberof google.cloud.bigquery.storage.v1.ReadSession + CreateWriteStreamRequest.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.writeStream != null && message.hasOwnProperty("writeStream")) { + var error = $root.google.cloud.bigquery.storage.v1.WriteStream.verify(message.writeStream); + if (error) + return "writeStream." + error; + } + return null; + }; + + /** + * Creates a CreateWriteStreamRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.CreateWriteStreamRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.CreateWriteStreamRequest} CreateWriteStreamRequest + */ + CreateWriteStreamRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.CreateWriteStreamRequest) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.CreateWriteStreamRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.writeStream != null) { + if (typeof object.writeStream !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.CreateWriteStreamRequest.writeStream: object expected"); + message.writeStream = $root.google.cloud.bigquery.storage.v1.WriteStream.fromObject(object.writeStream); + } + return message; + }; + + /** + * Creates a plain object from a CreateWriteStreamRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.CreateWriteStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1.CreateWriteStreamRequest} message CreateWriteStreamRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateWriteStreamRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.writeStream = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.writeStream != null && message.hasOwnProperty("writeStream")) + object.writeStream = $root.google.cloud.bigquery.storage.v1.WriteStream.toObject(message.writeStream, options); + return object; + }; + + /** + * Converts this CreateWriteStreamRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.CreateWriteStreamRequest * @instance + * @returns {Object.} JSON object */ - ReadSession.prototype.streams = $util.emptyArray; + CreateWriteStreamRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateWriteStreamRequest; + })(); + + v1.AppendRowsRequest = (function() { /** - * ReadSession estimatedTotalBytesScanned. - * @member {number|Long} estimatedTotalBytesScanned - * @memberof google.cloud.bigquery.storage.v1.ReadSession + * Properties of an AppendRowsRequest. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IAppendRowsRequest + * @property {string|null} [writeStream] AppendRowsRequest writeStream + * @property {google.protobuf.IInt64Value|null} [offset] AppendRowsRequest offset + * @property {google.cloud.bigquery.storage.v1.AppendRowsRequest.IProtoData|null} [protoRows] AppendRowsRequest protoRows + * @property {string|null} [traceId] AppendRowsRequest traceId + */ + + /** + * Constructs a new AppendRowsRequest. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents an AppendRowsRequest. + * @implements IAppendRowsRequest + * @constructor + * @param {google.cloud.bigquery.storage.v1.IAppendRowsRequest=} [properties] Properties to set + */ + function AppendRowsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AppendRowsRequest writeStream. + * @member {string} writeStream + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest * @instance */ - ReadSession.prototype.estimatedTotalBytesScanned = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + AppendRowsRequest.prototype.writeStream = ""; + + /** + * AppendRowsRequest offset. + * @member {google.protobuf.IInt64Value|null|undefined} offset + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest + * @instance + */ + AppendRowsRequest.prototype.offset = null; + + /** + * AppendRowsRequest protoRows. + * @member {google.cloud.bigquery.storage.v1.AppendRowsRequest.IProtoData|null|undefined} protoRows + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest + * @instance + */ + AppendRowsRequest.prototype.protoRows = null; + + /** + * AppendRowsRequest traceId. + * @member {string} traceId + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest + * @instance + */ + AppendRowsRequest.prototype.traceId = ""; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * ReadSession schema. - * @member {"avroSchema"|"arrowSchema"|undefined} schema - * @memberof google.cloud.bigquery.storage.v1.ReadSession + * AppendRowsRequest rows. + * @member {"protoRows"|undefined} rows + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest * @instance */ - Object.defineProperty(ReadSession.prototype, "schema", { - get: $util.oneOfGetter($oneOfFields = ["avroSchema", "arrowSchema"]), + Object.defineProperty(AppendRowsRequest.prototype, "rows", { + get: $util.oneOfGetter($oneOfFields = ["protoRows"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new ReadSession instance using the specified properties. + * Creates a new AppendRowsRequest instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest * @static - * @param {google.cloud.bigquery.storage.v1.IReadSession=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1.ReadSession} ReadSession instance + * @param {google.cloud.bigquery.storage.v1.IAppendRowsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.AppendRowsRequest} AppendRowsRequest instance */ - ReadSession.create = function create(properties) { - return new ReadSession(properties); + AppendRowsRequest.create = function create(properties) { + return new AppendRowsRequest(properties); }; /** - * Encodes the specified ReadSession message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.verify|verify} messages. + * Encodes the specified AppendRowsRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1.AppendRowsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest * @static - * @param {google.cloud.bigquery.storage.v1.IReadSession} message ReadSession message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.IAppendRowsRequest} message AppendRowsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadSession.encode = function encode(message, writer) { + AppendRowsRequest.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.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.dataFormat != null && Object.hasOwnProperty.call(message, "dataFormat")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.dataFormat); - if (message.avroSchema != null && Object.hasOwnProperty.call(message, "avroSchema")) - $root.google.cloud.bigquery.storage.v1.AvroSchema.encode(message.avroSchema, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.arrowSchema != null && Object.hasOwnProperty.call(message, "arrowSchema")) - $root.google.cloud.bigquery.storage.v1.ArrowSchema.encode(message.arrowSchema, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.table != null && Object.hasOwnProperty.call(message, "table")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.table); - if (message.tableModifiers != null && Object.hasOwnProperty.call(message, "tableModifiers")) - $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.encode(message.tableModifiers, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.readOptions != null && Object.hasOwnProperty.call(message, "readOptions")) - $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.encode(message.readOptions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.streams != null && message.streams.length) - for (var i = 0; i < message.streams.length; ++i) - $root.google.cloud.bigquery.storage.v1.ReadStream.encode(message.streams[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.estimatedTotalBytesScanned != null && Object.hasOwnProperty.call(message, "estimatedTotalBytesScanned")) - writer.uint32(/* id 12, wireType 0 =*/96).int64(message.estimatedTotalBytesScanned); + if (message.writeStream != null && Object.hasOwnProperty.call(message, "writeStream")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.writeStream); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + $root.google.protobuf.Int64Value.encode(message.offset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.protoRows != null && Object.hasOwnProperty.call(message, "protoRows")) + $root.google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData.encode(message.protoRows, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.traceId != null && Object.hasOwnProperty.call(message, "traceId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.traceId); return writer; }; /** - * Encodes the specified ReadSession message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.verify|verify} messages. + * Encodes the specified AppendRowsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.AppendRowsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest * @static - * @param {google.cloud.bigquery.storage.v1.IReadSession} message ReadSession message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.IAppendRowsRequest} message AppendRowsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadSession.encodeDelimited = function encodeDelimited(message, writer) { + AppendRowsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReadSession message from the specified reader or buffer. + * Decodes an AppendRowsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1.ReadSession} ReadSession + * @returns {google.cloud.bigquery.storage.v1.AppendRowsRequest} AppendRowsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadSession.decode = function decode(reader, length) { + AppendRowsRequest.decode = function decode(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.storage.v1.ReadSession(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1.AppendRowsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.writeStream = reader.string(); break; case 2: - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.dataFormat = reader.int32(); + message.offset = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); break; case 4: - message.avroSchema = $root.google.cloud.bigquery.storage.v1.AvroSchema.decode(reader, reader.uint32()); - break; - case 5: - message.arrowSchema = $root.google.cloud.bigquery.storage.v1.ArrowSchema.decode(reader, reader.uint32()); + message.protoRows = $root.google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData.decode(reader, reader.uint32()); break; case 6: - message.table = reader.string(); - break; - case 7: - message.tableModifiers = $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.decode(reader, reader.uint32()); - break; - case 8: - message.readOptions = $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.decode(reader, reader.uint32()); - break; - case 10: - if (!(message.streams && message.streams.length)) - message.streams = []; - message.streams.push($root.google.cloud.bigquery.storage.v1.ReadStream.decode(reader, reader.uint32())); - break; - case 12: - message.estimatedTotalBytesScanned = reader.int64(); + message.traceId = reader.string(); break; default: reader.skipType(tag & 7); @@ -3437,265 +4179,146 @@ }; /** - * Decodes a ReadSession message from the specified reader or buffer, length delimited. + * Decodes an AppendRowsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1.ReadSession} ReadSession + * @returns {google.cloud.bigquery.storage.v1.AppendRowsRequest} AppendRowsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadSession.decodeDelimited = function decodeDelimited(reader) { + AppendRowsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReadSession message. + * Verifies an AppendRowsRequest message. * @function verify - * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReadSession.verify = function verify(message) { + AppendRowsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (message.writeStream != null && message.hasOwnProperty("writeStream")) + if (!$util.isString(message.writeStream)) + return "writeStream: string expected"; + if (message.offset != null && message.hasOwnProperty("offset")) { + var error = $root.google.protobuf.Int64Value.verify(message.offset); if (error) - return "expireTime." + error; - } - if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) - switch (message.dataFormat) { - default: - return "dataFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.avroSchema != null && message.hasOwnProperty("avroSchema")) { - properties.schema = 1; - { - var error = $root.google.cloud.bigquery.storage.v1.AvroSchema.verify(message.avroSchema); - if (error) - return "avroSchema." + error; - } + return "offset." + error; } - if (message.arrowSchema != null && message.hasOwnProperty("arrowSchema")) { - if (properties.schema === 1) - return "schema: multiple values"; - properties.schema = 1; + if (message.protoRows != null && message.hasOwnProperty("protoRows")) { + properties.rows = 1; { - var error = $root.google.cloud.bigquery.storage.v1.ArrowSchema.verify(message.arrowSchema); - if (error) - return "arrowSchema." + error; - } - } - if (message.table != null && message.hasOwnProperty("table")) - if (!$util.isString(message.table)) - return "table: string expected"; - if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) { - var error = $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.verify(message.tableModifiers); - if (error) - return "tableModifiers." + error; - } - if (message.readOptions != null && message.hasOwnProperty("readOptions")) { - var error = $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.verify(message.readOptions); - if (error) - return "readOptions." + error; - } - if (message.streams != null && message.hasOwnProperty("streams")) { - if (!Array.isArray(message.streams)) - return "streams: array expected"; - for (var i = 0; i < message.streams.length; ++i) { - var error = $root.google.cloud.bigquery.storage.v1.ReadStream.verify(message.streams[i]); + var error = $root.google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData.verify(message.protoRows); if (error) - return "streams." + error; + return "protoRows." + error; } } - if (message.estimatedTotalBytesScanned != null && message.hasOwnProperty("estimatedTotalBytesScanned")) - if (!$util.isInteger(message.estimatedTotalBytesScanned) && !(message.estimatedTotalBytesScanned && $util.isInteger(message.estimatedTotalBytesScanned.low) && $util.isInteger(message.estimatedTotalBytesScanned.high))) - return "estimatedTotalBytesScanned: integer|Long expected"; + if (message.traceId != null && message.hasOwnProperty("traceId")) + if (!$util.isString(message.traceId)) + return "traceId: string expected"; return null; }; /** - * Creates a ReadSession message from a plain object. Also converts values to their respective internal types. + * Creates an AppendRowsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1.ReadSession} ReadSession + * @returns {google.cloud.bigquery.storage.v1.AppendRowsRequest} AppendRowsRequest */ - ReadSession.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1.ReadSession) + AppendRowsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.AppendRowsRequest) return object; - var message = new $root.google.cloud.bigquery.storage.v1.ReadSession(); - if (object.name != null) - message.name = String(object.name); - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + var message = new $root.google.cloud.bigquery.storage.v1.AppendRowsRequest(); + if (object.writeStream != null) + message.writeStream = String(object.writeStream); + if (object.offset != null) { + if (typeof object.offset !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.AppendRowsRequest.offset: object expected"); + message.offset = $root.google.protobuf.Int64Value.fromObject(object.offset); } - switch (object.dataFormat) { - case "DATA_FORMAT_UNSPECIFIED": - case 0: - message.dataFormat = 0; - break; - case "AVRO": - case 1: - message.dataFormat = 1; - break; - case "ARROW": - case 2: - message.dataFormat = 2; - break; + if (object.protoRows != null) { + if (typeof object.protoRows !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.AppendRowsRequest.protoRows: object expected"); + message.protoRows = $root.google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData.fromObject(object.protoRows); } - if (object.avroSchema != null) { - if (typeof object.avroSchema !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.avroSchema: object expected"); - message.avroSchema = $root.google.cloud.bigquery.storage.v1.AvroSchema.fromObject(object.avroSchema); + if (object.traceId != null) + message.traceId = String(object.traceId); + return message; + }; + + /** + * Creates a plain object from an AppendRowsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest + * @static + * @param {google.cloud.bigquery.storage.v1.AppendRowsRequest} message AppendRowsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AppendRowsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.writeStream = ""; + object.offset = null; + object.traceId = ""; } - if (object.arrowSchema != null) { - if (typeof object.arrowSchema !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.arrowSchema: object expected"); - message.arrowSchema = $root.google.cloud.bigquery.storage.v1.ArrowSchema.fromObject(object.arrowSchema); - } - if (object.table != null) - message.table = String(object.table); - if (object.tableModifiers != null) { - if (typeof object.tableModifiers !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.tableModifiers: object expected"); - message.tableModifiers = $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.fromObject(object.tableModifiers); - } - if (object.readOptions != null) { - if (typeof object.readOptions !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.readOptions: object expected"); - message.readOptions = $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.fromObject(object.readOptions); - } - if (object.streams) { - if (!Array.isArray(object.streams)) - throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.streams: array expected"); - message.streams = []; - for (var i = 0; i < object.streams.length; ++i) { - if (typeof object.streams[i] !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.streams: object expected"); - message.streams[i] = $root.google.cloud.bigquery.storage.v1.ReadStream.fromObject(object.streams[i]); - } - } - if (object.estimatedTotalBytesScanned != null) - if ($util.Long) - (message.estimatedTotalBytesScanned = $util.Long.fromValue(object.estimatedTotalBytesScanned)).unsigned = false; - else if (typeof object.estimatedTotalBytesScanned === "string") - message.estimatedTotalBytesScanned = parseInt(object.estimatedTotalBytesScanned, 10); - else if (typeof object.estimatedTotalBytesScanned === "number") - message.estimatedTotalBytesScanned = object.estimatedTotalBytesScanned; - else if (typeof object.estimatedTotalBytesScanned === "object") - message.estimatedTotalBytesScanned = new $util.LongBits(object.estimatedTotalBytesScanned.low >>> 0, object.estimatedTotalBytesScanned.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a ReadSession message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.bigquery.storage.v1.ReadSession - * @static - * @param {google.cloud.bigquery.storage.v1.ReadSession} message ReadSession - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadSession.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.streams = []; - if (options.defaults) { - object.name = ""; - object.expireTime = null; - object.dataFormat = options.enums === String ? "DATA_FORMAT_UNSPECIFIED" : 0; - object.table = ""; - object.tableModifiers = null; - object.readOptions = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.estimatedTotalBytesScanned = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.estimatedTotalBytesScanned = options.longs === String ? "0" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) - object.dataFormat = options.enums === String ? $root.google.cloud.bigquery.storage.v1.DataFormat[message.dataFormat] : message.dataFormat; - if (message.avroSchema != null && message.hasOwnProperty("avroSchema")) { - object.avroSchema = $root.google.cloud.bigquery.storage.v1.AvroSchema.toObject(message.avroSchema, options); - if (options.oneofs) - object.schema = "avroSchema"; - } - if (message.arrowSchema != null && message.hasOwnProperty("arrowSchema")) { - object.arrowSchema = $root.google.cloud.bigquery.storage.v1.ArrowSchema.toObject(message.arrowSchema, options); + if (message.writeStream != null && message.hasOwnProperty("writeStream")) + object.writeStream = message.writeStream; + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = $root.google.protobuf.Int64Value.toObject(message.offset, options); + if (message.protoRows != null && message.hasOwnProperty("protoRows")) { + object.protoRows = $root.google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData.toObject(message.protoRows, options); if (options.oneofs) - object.schema = "arrowSchema"; - } - if (message.table != null && message.hasOwnProperty("table")) - object.table = message.table; - if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) - object.tableModifiers = $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.toObject(message.tableModifiers, options); - if (message.readOptions != null && message.hasOwnProperty("readOptions")) - object.readOptions = $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.toObject(message.readOptions, options); - if (message.streams && message.streams.length) { - object.streams = []; - for (var j = 0; j < message.streams.length; ++j) - object.streams[j] = $root.google.cloud.bigquery.storage.v1.ReadStream.toObject(message.streams[j], options); + object.rows = "protoRows"; } - if (message.estimatedTotalBytesScanned != null && message.hasOwnProperty("estimatedTotalBytesScanned")) - if (typeof message.estimatedTotalBytesScanned === "number") - object.estimatedTotalBytesScanned = options.longs === String ? String(message.estimatedTotalBytesScanned) : message.estimatedTotalBytesScanned; - else - object.estimatedTotalBytesScanned = options.longs === String ? $util.Long.prototype.toString.call(message.estimatedTotalBytesScanned) : options.longs === Number ? new $util.LongBits(message.estimatedTotalBytesScanned.low >>> 0, message.estimatedTotalBytesScanned.high >>> 0).toNumber() : message.estimatedTotalBytesScanned; + if (message.traceId != null && message.hasOwnProperty("traceId")) + object.traceId = message.traceId; return object; }; /** - * Converts this ReadSession to JSON. + * Converts this AppendRowsRequest to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest * @instance * @returns {Object.} JSON object */ - ReadSession.prototype.toJSON = function toJSON() { + AppendRowsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - ReadSession.TableModifiers = (function() { + AppendRowsRequest.ProtoData = (function() { /** - * Properties of a TableModifiers. - * @memberof google.cloud.bigquery.storage.v1.ReadSession - * @interface ITableModifiers - * @property {google.protobuf.ITimestamp|null} [snapshotTime] TableModifiers snapshotTime + * Properties of a ProtoData. + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest + * @interface IProtoData + * @property {google.cloud.bigquery.storage.v1.IProtoSchema|null} [writerSchema] ProtoData writerSchema + * @property {google.cloud.bigquery.storage.v1.IProtoRows|null} [rows] ProtoData rows */ /** - * Constructs a new TableModifiers. - * @memberof google.cloud.bigquery.storage.v1.ReadSession - * @classdesc Represents a TableModifiers. - * @implements ITableModifiers + * Constructs a new ProtoData. + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest + * @classdesc Represents a ProtoData. + * @implements IProtoData * @constructor - * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1.AppendRowsRequest.IProtoData=} [properties] Properties to set */ - function TableModifiers(properties) { + function ProtoData(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3703,75 +4326,88 @@ } /** - * TableModifiers snapshotTime. - * @member {google.protobuf.ITimestamp|null|undefined} snapshotTime - * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * ProtoData writerSchema. + * @member {google.cloud.bigquery.storage.v1.IProtoSchema|null|undefined} writerSchema + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData * @instance */ - TableModifiers.prototype.snapshotTime = null; + ProtoData.prototype.writerSchema = null; /** - * Creates a new TableModifiers instance using the specified properties. + * ProtoData rows. + * @member {google.cloud.bigquery.storage.v1.IProtoRows|null|undefined} rows + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData + * @instance + */ + ProtoData.prototype.rows = null; + + /** + * Creates a new ProtoData instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData * @static - * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableModifiers} TableModifiers instance + * @param {google.cloud.bigquery.storage.v1.AppendRowsRequest.IProtoData=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData} ProtoData instance */ - TableModifiers.create = function create(properties) { - return new TableModifiers(properties); + ProtoData.create = function create(properties) { + return new ProtoData(properties); }; /** - * Encodes the specified TableModifiers message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.verify|verify} messages. + * Encodes the specified ProtoData message. Does not implicitly {@link google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData.verify|verify} messages. * @function encode - * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData * @static - * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers} message TableModifiers message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.AppendRowsRequest.IProtoData} message ProtoData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TableModifiers.encode = function encode(message, writer) { + ProtoData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.snapshotTime != null && Object.hasOwnProperty.call(message, "snapshotTime")) - $root.google.protobuf.Timestamp.encode(message.snapshotTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.writerSchema != null && Object.hasOwnProperty.call(message, "writerSchema")) + $root.google.cloud.bigquery.storage.v1.ProtoSchema.encode(message.writerSchema, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rows != null && Object.hasOwnProperty.call(message, "rows")) + $root.google.cloud.bigquery.storage.v1.ProtoRows.encode(message.rows, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified TableModifiers message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.verify|verify} messages. + * Encodes the specified ProtoData message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData * @static - * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers} message TableModifiers message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.AppendRowsRequest.IProtoData} message ProtoData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TableModifiers.encodeDelimited = function encodeDelimited(message, writer) { + ProtoData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TableModifiers message from the specified reader or buffer. + * Decodes a ProtoData message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableModifiers} TableModifiers + * @returns {google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData} ProtoData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TableModifiers.decode = function decode(reader, length) { + ProtoData.decode = function decode(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.storage.v1.ReadSession.TableModifiers(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.snapshotTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.writerSchema = $root.google.cloud.bigquery.storage.v1.ProtoSchema.decode(reader, reader.uint32()); + break; + case 2: + message.rows = $root.google.cloud.bigquery.storage.v1.ProtoRows.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -3782,234 +4418,475 @@ }; /** - * Decodes a TableModifiers message from the specified reader or buffer, length delimited. + * Decodes a ProtoData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableModifiers} TableModifiers + * @returns {google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData} ProtoData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TableModifiers.decodeDelimited = function decodeDelimited(reader) { + ProtoData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TableModifiers message. + * Verifies a ProtoData message. * @function verify - * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TableModifiers.verify = function verify(message) { + ProtoData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.snapshotTime); + if (message.writerSchema != null && message.hasOwnProperty("writerSchema")) { + var error = $root.google.cloud.bigquery.storage.v1.ProtoSchema.verify(message.writerSchema); if (error) - return "snapshotTime." + error; + return "writerSchema." + error; + } + if (message.rows != null && message.hasOwnProperty("rows")) { + var error = $root.google.cloud.bigquery.storage.v1.ProtoRows.verify(message.rows); + if (error) + return "rows." + error; } return null; }; /** - * Creates a TableModifiers message from a plain object. Also converts values to their respective internal types. + * Creates a ProtoData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableModifiers} TableModifiers + * @returns {google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData} ProtoData */ - TableModifiers.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers) + ProtoData.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData) return object; - var message = new $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers(); - if (object.snapshotTime != null) { - if (typeof object.snapshotTime !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.snapshotTime: object expected"); - message.snapshotTime = $root.google.protobuf.Timestamp.fromObject(object.snapshotTime); + var message = new $root.google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData(); + if (object.writerSchema != null) { + if (typeof object.writerSchema !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData.writerSchema: object expected"); + message.writerSchema = $root.google.cloud.bigquery.storage.v1.ProtoSchema.fromObject(object.writerSchema); + } + if (object.rows != null) { + if (typeof object.rows !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData.rows: object expected"); + message.rows = $root.google.cloud.bigquery.storage.v1.ProtoRows.fromObject(object.rows); } return message; }; /** - * Creates a plain object from a TableModifiers message. Also converts values to other types if specified. + * Creates a plain object from a ProtoData message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData * @static - * @param {google.cloud.bigquery.storage.v1.ReadSession.TableModifiers} message TableModifiers + * @param {google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData} message ProtoData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TableModifiers.toObject = function toObject(message, options) { + ProtoData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.snapshotTime = null; - if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) - object.snapshotTime = $root.google.protobuf.Timestamp.toObject(message.snapshotTime, options); + if (options.defaults) { + object.writerSchema = null; + object.rows = null; + } + if (message.writerSchema != null && message.hasOwnProperty("writerSchema")) + object.writerSchema = $root.google.cloud.bigquery.storage.v1.ProtoSchema.toObject(message.writerSchema, options); + if (message.rows != null && message.hasOwnProperty("rows")) + object.rows = $root.google.cloud.bigquery.storage.v1.ProtoRows.toObject(message.rows, options); return object; }; /** - * Converts this TableModifiers to JSON. + * Converts this ProtoData to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData * @instance * @returns {Object.} JSON object */ - TableModifiers.prototype.toJSON = function toJSON() { + ProtoData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TableModifiers; + return ProtoData; })(); - ReadSession.TableReadOptions = (function() { + return AppendRowsRequest; + })(); - /** - * Properties of a TableReadOptions. - * @memberof google.cloud.bigquery.storage.v1.ReadSession - * @interface ITableReadOptions - * @property {Array.|null} [selectedFields] TableReadOptions selectedFields - * @property {string|null} [rowRestriction] TableReadOptions rowRestriction - * @property {google.cloud.bigquery.storage.v1.IArrowSerializationOptions|null} [arrowSerializationOptions] TableReadOptions arrowSerializationOptions - */ + v1.AppendRowsResponse = (function() { - /** - * Constructs a new TableReadOptions. - * @memberof google.cloud.bigquery.storage.v1.ReadSession - * @classdesc Represents a TableReadOptions. - * @implements ITableReadOptions - * @constructor - * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions=} [properties] Properties to set - */ - function TableReadOptions(properties) { - this.selectedFields = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of an AppendRowsResponse. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IAppendRowsResponse + * @property {google.cloud.bigquery.storage.v1.AppendRowsResponse.IAppendResult|null} [appendResult] AppendRowsResponse appendResult + * @property {google.rpc.IStatus|null} [error] AppendRowsResponse error + * @property {google.cloud.bigquery.storage.v1.ITableSchema|null} [updatedSchema] AppendRowsResponse updatedSchema + */ - /** - * TableReadOptions selectedFields. - * @member {Array.} selectedFields - * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions - * @instance - */ - TableReadOptions.prototype.selectedFields = $util.emptyArray; + /** + * Constructs a new AppendRowsResponse. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents an AppendRowsResponse. + * @implements IAppendRowsResponse + * @constructor + * @param {google.cloud.bigquery.storage.v1.IAppendRowsResponse=} [properties] Properties to set + */ + function AppendRowsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * TableReadOptions rowRestriction. - * @member {string} rowRestriction - * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions - * @instance - */ - TableReadOptions.prototype.rowRestriction = ""; + /** + * AppendRowsResponse appendResult. + * @member {google.cloud.bigquery.storage.v1.AppendRowsResponse.IAppendResult|null|undefined} appendResult + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse + * @instance + */ + AppendRowsResponse.prototype.appendResult = null; - /** - * TableReadOptions arrowSerializationOptions. - * @member {google.cloud.bigquery.storage.v1.IArrowSerializationOptions|null|undefined} arrowSerializationOptions - * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions - * @instance - */ - TableReadOptions.prototype.arrowSerializationOptions = null; + /** + * AppendRowsResponse error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse + * @instance + */ + AppendRowsResponse.prototype.error = null; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * AppendRowsResponse updatedSchema. + * @member {google.cloud.bigquery.storage.v1.ITableSchema|null|undefined} updatedSchema + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse + * @instance + */ + AppendRowsResponse.prototype.updatedSchema = null; - /** - * TableReadOptions outputFormatSerializationOptions. - * @member {"arrowSerializationOptions"|undefined} outputFormatSerializationOptions - * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions - * @instance - */ - Object.defineProperty(TableReadOptions.prototype, "outputFormatSerializationOptions", { - get: $util.oneOfGetter($oneOfFields = ["arrowSerializationOptions"]), - set: $util.oneOfSetter($oneOfFields) - }); + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AppendRowsResponse response. + * @member {"appendResult"|"error"|undefined} response + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse + * @instance + */ + Object.defineProperty(AppendRowsResponse.prototype, "response", { + get: $util.oneOfGetter($oneOfFields = ["appendResult", "error"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AppendRowsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse + * @static + * @param {google.cloud.bigquery.storage.v1.IAppendRowsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.AppendRowsResponse} AppendRowsResponse instance + */ + AppendRowsResponse.create = function create(properties) { + return new AppendRowsResponse(properties); + }; + + /** + * Encodes the specified AppendRowsResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1.AppendRowsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse + * @static + * @param {google.cloud.bigquery.storage.v1.IAppendRowsResponse} message AppendRowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppendRowsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.appendResult != null && Object.hasOwnProperty.call(message, "appendResult")) + $root.google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult.encode(message.appendResult, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updatedSchema != null && Object.hasOwnProperty.call(message, "updatedSchema")) + $root.google.cloud.bigquery.storage.v1.TableSchema.encode(message.updatedSchema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AppendRowsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.AppendRowsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse + * @static + * @param {google.cloud.bigquery.storage.v1.IAppendRowsResponse} message AppendRowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AppendRowsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AppendRowsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.AppendRowsResponse} AppendRowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppendRowsResponse.decode = function decode(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.storage.v1.AppendRowsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.appendResult = $root.google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult.decode(reader, reader.uint32()); + break; + case 2: + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + case 3: + message.updatedSchema = $root.google.cloud.bigquery.storage.v1.TableSchema.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AppendRowsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.AppendRowsResponse} AppendRowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AppendRowsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AppendRowsResponse message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AppendRowsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.appendResult != null && message.hasOwnProperty("appendResult")) { + properties.response = 1; + { + var error = $root.google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult.verify(message.appendResult); + if (error) + return "appendResult." + error; + } + } + if (message.error != null && message.hasOwnProperty("error")) { + if (properties.response === 1) + return "response: multiple values"; + properties.response = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.updatedSchema != null && message.hasOwnProperty("updatedSchema")) { + var error = $root.google.cloud.bigquery.storage.v1.TableSchema.verify(message.updatedSchema); + if (error) + return "updatedSchema." + error; + } + return null; + }; + + /** + * Creates an AppendRowsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.AppendRowsResponse} AppendRowsResponse + */ + AppendRowsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.AppendRowsResponse) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.AppendRowsResponse(); + if (object.appendResult != null) { + if (typeof object.appendResult !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.AppendRowsResponse.appendResult: object expected"); + message.appendResult = $root.google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult.fromObject(object.appendResult); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.AppendRowsResponse.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.updatedSchema != null) { + if (typeof object.updatedSchema !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.AppendRowsResponse.updatedSchema: object expected"); + message.updatedSchema = $root.google.cloud.bigquery.storage.v1.TableSchema.fromObject(object.updatedSchema); + } + return message; + }; + + /** + * Creates a plain object from an AppendRowsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse + * @static + * @param {google.cloud.bigquery.storage.v1.AppendRowsResponse} message AppendRowsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AppendRowsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.updatedSchema = null; + if (message.appendResult != null && message.hasOwnProperty("appendResult")) { + object.appendResult = $root.google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult.toObject(message.appendResult, options); + if (options.oneofs) + object.response = "appendResult"; + } + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.response = "error"; + } + if (message.updatedSchema != null && message.hasOwnProperty("updatedSchema")) + object.updatedSchema = $root.google.cloud.bigquery.storage.v1.TableSchema.toObject(message.updatedSchema, options); + return object; + }; + + /** + * Converts this AppendRowsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse + * @instance + * @returns {Object.} JSON object + */ + AppendRowsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + AppendRowsResponse.AppendResult = (function() { /** - * Creates a new TableReadOptions instance using the specified properties. + * Properties of an AppendResult. + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse + * @interface IAppendResult + * @property {google.protobuf.IInt64Value|null} [offset] AppendResult offset + */ + + /** + * Constructs a new AppendResult. + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse + * @classdesc Represents an AppendResult. + * @implements IAppendResult + * @constructor + * @param {google.cloud.bigquery.storage.v1.AppendRowsResponse.IAppendResult=} [properties] Properties to set + */ + function AppendResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AppendResult offset. + * @member {google.protobuf.IInt64Value|null|undefined} offset + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult + * @instance + */ + AppendResult.prototype.offset = null; + + /** + * Creates a new AppendResult instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult * @static - * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions} TableReadOptions instance + * @param {google.cloud.bigquery.storage.v1.AppendRowsResponse.IAppendResult=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult} AppendResult instance */ - TableReadOptions.create = function create(properties) { - return new TableReadOptions(properties); + AppendResult.create = function create(properties) { + return new AppendResult(properties); }; /** - * Encodes the specified TableReadOptions message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.verify|verify} messages. + * Encodes the specified AppendResult message. Does not implicitly {@link google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult.verify|verify} messages. * @function encode - * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult * @static - * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions} message TableReadOptions message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.AppendRowsResponse.IAppendResult} message AppendResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TableReadOptions.encode = function encode(message, writer) { + AppendResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selectedFields != null && message.selectedFields.length) - for (var i = 0; i < message.selectedFields.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectedFields[i]); - if (message.rowRestriction != null && Object.hasOwnProperty.call(message, "rowRestriction")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.rowRestriction); - if (message.arrowSerializationOptions != null && Object.hasOwnProperty.call(message, "arrowSerializationOptions")) - $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.encode(message.arrowSerializationOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + $root.google.protobuf.Int64Value.encode(message.offset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified TableReadOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.verify|verify} messages. + * Encodes the specified AppendResult message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult * @static - * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions} message TableReadOptions message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.AppendRowsResponse.IAppendResult} message AppendResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TableReadOptions.encodeDelimited = function encodeDelimited(message, writer) { + AppendResult.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TableReadOptions message from the specified reader or buffer. + * Decodes an AppendResult message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions} TableReadOptions + * @returns {google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult} AppendResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TableReadOptions.decode = function decode(reader, length) { + AppendResult.decode = function decode(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.storage.v1.ReadSession.TableReadOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.selectedFields && message.selectedFields.length)) - message.selectedFields = []; - message.selectedFields.push(reader.string()); - break; - case 2: - message.rowRestriction = reader.string(); - break; - case 3: - message.arrowSerializationOptions = $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.decode(reader, reader.uint32()); + message.offset = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4020,150 +4897,115 @@ }; /** - * Decodes a TableReadOptions message from the specified reader or buffer, length delimited. + * Decodes an AppendResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions} TableReadOptions + * @returns {google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult} AppendResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TableReadOptions.decodeDelimited = function decodeDelimited(reader) { + AppendResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TableReadOptions message. + * Verifies an AppendResult message. * @function verify - * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TableReadOptions.verify = function verify(message) { + AppendResult.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.selectedFields != null && message.hasOwnProperty("selectedFields")) { - if (!Array.isArray(message.selectedFields)) - return "selectedFields: array expected"; - for (var i = 0; i < message.selectedFields.length; ++i) - if (!$util.isString(message.selectedFields[i])) - return "selectedFields: string[] expected"; - } - if (message.rowRestriction != null && message.hasOwnProperty("rowRestriction")) - if (!$util.isString(message.rowRestriction)) - return "rowRestriction: string expected"; - if (message.arrowSerializationOptions != null && message.hasOwnProperty("arrowSerializationOptions")) { - properties.outputFormatSerializationOptions = 1; - { - var error = $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.verify(message.arrowSerializationOptions); - if (error) - return "arrowSerializationOptions." + error; - } + if (message.offset != null && message.hasOwnProperty("offset")) { + var error = $root.google.protobuf.Int64Value.verify(message.offset); + if (error) + return "offset." + error; } return null; }; /** - * Creates a TableReadOptions message from a plain object. Also converts values to their respective internal types. + * Creates an AppendResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions} TableReadOptions + * @returns {google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult} AppendResult */ - TableReadOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions) + AppendResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult) return object; - var message = new $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions(); - if (object.selectedFields) { - if (!Array.isArray(object.selectedFields)) - throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.selectedFields: array expected"); - message.selectedFields = []; - for (var i = 0; i < object.selectedFields.length; ++i) - message.selectedFields[i] = String(object.selectedFields[i]); - } - if (object.rowRestriction != null) - message.rowRestriction = String(object.rowRestriction); - if (object.arrowSerializationOptions != null) { - if (typeof object.arrowSerializationOptions !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.arrowSerializationOptions: object expected"); - message.arrowSerializationOptions = $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.fromObject(object.arrowSerializationOptions); + var message = new $root.google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult(); + if (object.offset != null) { + if (typeof object.offset !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult.offset: object expected"); + message.offset = $root.google.protobuf.Int64Value.fromObject(object.offset); } return message; }; /** - * Creates a plain object from a TableReadOptions message. Also converts values to other types if specified. + * Creates a plain object from an AppendResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult * @static - * @param {google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions} message TableReadOptions + * @param {google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult} message AppendResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TableReadOptions.toObject = function toObject(message, options) { + AppendResult.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.selectedFields = []; if (options.defaults) - object.rowRestriction = ""; - if (message.selectedFields && message.selectedFields.length) { - object.selectedFields = []; - for (var j = 0; j < message.selectedFields.length; ++j) - object.selectedFields[j] = message.selectedFields[j]; - } - if (message.rowRestriction != null && message.hasOwnProperty("rowRestriction")) - object.rowRestriction = message.rowRestriction; - if (message.arrowSerializationOptions != null && message.hasOwnProperty("arrowSerializationOptions")) { - object.arrowSerializationOptions = $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.toObject(message.arrowSerializationOptions, options); - if (options.oneofs) - object.outputFormatSerializationOptions = "arrowSerializationOptions"; - } + object.offset = null; + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = $root.google.protobuf.Int64Value.toObject(message.offset, options); return object; }; /** - * Converts this TableReadOptions to JSON. + * Converts this AppendResult to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult * @instance * @returns {Object.} JSON object */ - TableReadOptions.prototype.toJSON = function toJSON() { + AppendResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TableReadOptions; + return AppendResult; })(); - return ReadSession; + return AppendRowsResponse; })(); - v1.ReadStream = (function() { + v1.GetWriteStreamRequest = (function() { /** - * Properties of a ReadStream. + * Properties of a GetWriteStreamRequest. * @memberof google.cloud.bigquery.storage.v1 - * @interface IReadStream - * @property {string|null} [name] ReadStream name + * @interface IGetWriteStreamRequest + * @property {string|null} [name] GetWriteStreamRequest name */ /** - * Constructs a new ReadStream. + * Constructs a new GetWriteStreamRequest. * @memberof google.cloud.bigquery.storage.v1 - * @classdesc Represents a ReadStream. - * @implements IReadStream + * @classdesc Represents a GetWriteStreamRequest. + * @implements IGetWriteStreamRequest * @constructor - * @param {google.cloud.bigquery.storage.v1.IReadStream=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1.IGetWriteStreamRequest=} [properties] Properties to set */ - function ReadStream(properties) { + function GetWriteStreamRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4171,35 +5013,35 @@ } /** - * ReadStream name. + * GetWriteStreamRequest name. * @member {string} name - * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @memberof google.cloud.bigquery.storage.v1.GetWriteStreamRequest * @instance */ - ReadStream.prototype.name = ""; + GetWriteStreamRequest.prototype.name = ""; /** - * Creates a new ReadStream instance using the specified properties. + * Creates a new GetWriteStreamRequest instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @memberof google.cloud.bigquery.storage.v1.GetWriteStreamRequest * @static - * @param {google.cloud.bigquery.storage.v1.IReadStream=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1.ReadStream} ReadStream instance + * @param {google.cloud.bigquery.storage.v1.IGetWriteStreamRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.GetWriteStreamRequest} GetWriteStreamRequest instance */ - ReadStream.create = function create(properties) { - return new ReadStream(properties); + GetWriteStreamRequest.create = function create(properties) { + return new GetWriteStreamRequest(properties); }; /** - * Encodes the specified ReadStream message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadStream.verify|verify} messages. + * Encodes the specified GetWriteStreamRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1.GetWriteStreamRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @memberof google.cloud.bigquery.storage.v1.GetWriteStreamRequest * @static - * @param {google.cloud.bigquery.storage.v1.IReadStream} message ReadStream message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.IGetWriteStreamRequest} message GetWriteStreamRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadStream.encode = function encode(message, writer) { + GetWriteStreamRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -4208,33 +5050,33 @@ }; /** - * Encodes the specified ReadStream message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadStream.verify|verify} messages. + * Encodes the specified GetWriteStreamRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.GetWriteStreamRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @memberof google.cloud.bigquery.storage.v1.GetWriteStreamRequest * @static - * @param {google.cloud.bigquery.storage.v1.IReadStream} message ReadStream message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.IGetWriteStreamRequest} message GetWriteStreamRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadStream.encodeDelimited = function encodeDelimited(message, writer) { + GetWriteStreamRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReadStream message from the specified reader or buffer. + * Decodes a GetWriteStreamRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @memberof google.cloud.bigquery.storage.v1.GetWriteStreamRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1.ReadStream} ReadStream + * @returns {google.cloud.bigquery.storage.v1.GetWriteStreamRequest} GetWriteStreamRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadStream.decode = function decode(reader, length) { + GetWriteStreamRequest.decode = function decode(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.storage.v1.ReadStream(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1.GetWriteStreamRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -4250,30 +5092,30 @@ }; /** - * Decodes a ReadStream message from the specified reader or buffer, length delimited. + * Decodes a GetWriteStreamRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @memberof google.cloud.bigquery.storage.v1.GetWriteStreamRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1.ReadStream} ReadStream + * @returns {google.cloud.bigquery.storage.v1.GetWriteStreamRequest} GetWriteStreamRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadStream.decodeDelimited = function decodeDelimited(reader) { + GetWriteStreamRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReadStream message. + * Verifies a GetWriteStreamRequest message. * @function verify - * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @memberof google.cloud.bigquery.storage.v1.GetWriteStreamRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReadStream.verify = function verify(message) { + GetWriteStreamRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -4283,32 +5125,32 @@ }; /** - * Creates a ReadStream message from a plain object. Also converts values to their respective internal types. + * Creates a GetWriteStreamRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @memberof google.cloud.bigquery.storage.v1.GetWriteStreamRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1.ReadStream} ReadStream + * @returns {google.cloud.bigquery.storage.v1.GetWriteStreamRequest} GetWriteStreamRequest */ - ReadStream.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1.ReadStream) + GetWriteStreamRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.GetWriteStreamRequest) return object; - var message = new $root.google.cloud.bigquery.storage.v1.ReadStream(); + var message = new $root.google.cloud.bigquery.storage.v1.GetWriteStreamRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a ReadStream message. Also converts values to other types if specified. + * Creates a plain object from a GetWriteStreamRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @memberof google.cloud.bigquery.storage.v1.GetWriteStreamRequest * @static - * @param {google.cloud.bigquery.storage.v1.ReadStream} message ReadStream + * @param {google.cloud.bigquery.storage.v1.GetWriteStreamRequest} message GetWriteStreamRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadStream.toObject = function toObject(message, options) { + GetWriteStreamRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -4320,49 +5162,39 @@ }; /** - * Converts this ReadStream to JSON. + * Converts this GetWriteStreamRequest to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @memberof google.cloud.bigquery.storage.v1.GetWriteStreamRequest * @instance * @returns {Object.} JSON object */ - ReadStream.prototype.toJSON = function toJSON() { + GetWriteStreamRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ReadStream; + return GetWriteStreamRequest; })(); - return v1; - })(); - - storage.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof google.cloud.bigquery.storage - * @namespace - */ - var v1beta1 = {}; - - v1beta1.ArrowSchema = (function() { + v1.BatchCommitWriteStreamsRequest = (function() { /** - * Properties of an ArrowSchema. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface IArrowSchema - * @property {Uint8Array|null} [serializedSchema] ArrowSchema serializedSchema + * Properties of a BatchCommitWriteStreamsRequest. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IBatchCommitWriteStreamsRequest + * @property {string|null} [parent] BatchCommitWriteStreamsRequest parent + * @property {Array.|null} [writeStreams] BatchCommitWriteStreamsRequest writeStreams */ /** - * Constructs a new ArrowSchema. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents an ArrowSchema. - * @implements IArrowSchema + * Constructs a new BatchCommitWriteStreamsRequest. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a BatchCommitWriteStreamsRequest. + * @implements IBatchCommitWriteStreamsRequest * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IArrowSchema=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest=} [properties] Properties to set */ - function ArrowSchema(properties) { + function BatchCommitWriteStreamsRequest(properties) { + this.writeStreams = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4370,75 +5202,91 @@ } /** - * ArrowSchema serializedSchema. - * @member {Uint8Array} serializedSchema - * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema + * BatchCommitWriteStreamsRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest * @instance */ - ArrowSchema.prototype.serializedSchema = $util.newBuffer([]); + BatchCommitWriteStreamsRequest.prototype.parent = ""; /** - * Creates a new ArrowSchema instance using the specified properties. + * BatchCommitWriteStreamsRequest writeStreams. + * @member {Array.} writeStreams + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest + * @instance + */ + BatchCommitWriteStreamsRequest.prototype.writeStreams = $util.emptyArray; + + /** + * Creates a new BatchCommitWriteStreamsRequest instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.IArrowSchema=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.ArrowSchema} ArrowSchema instance + * @param {google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest} BatchCommitWriteStreamsRequest instance */ - ArrowSchema.create = function create(properties) { - return new ArrowSchema(properties); + BatchCommitWriteStreamsRequest.create = function create(properties) { + return new BatchCommitWriteStreamsRequest(properties); }; /** - * Encodes the specified ArrowSchema message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowSchema.verify|verify} messages. + * Encodes the specified BatchCommitWriteStreamsRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.IArrowSchema} message ArrowSchema message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest} message BatchCommitWriteStreamsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ArrowSchema.encode = function encode(message, writer) { + BatchCommitWriteStreamsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.serializedSchema != null && Object.hasOwnProperty.call(message, "serializedSchema")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.serializedSchema); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.writeStreams != null && message.writeStreams.length) + for (var i = 0; i < message.writeStreams.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.writeStreams[i]); return writer; }; /** - * Encodes the specified ArrowSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowSchema.verify|verify} messages. + * Encodes the specified BatchCommitWriteStreamsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.IArrowSchema} message ArrowSchema message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest} message BatchCommitWriteStreamsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ArrowSchema.encodeDelimited = function encodeDelimited(message, writer) { + BatchCommitWriteStreamsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ArrowSchema message from the specified reader or buffer. + * Decodes a BatchCommitWriteStreamsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1beta1.ArrowSchema} ArrowSchema + * @returns {google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest} BatchCommitWriteStreamsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ArrowSchema.decode = function decode(reader, length) { + BatchCommitWriteStreamsRequest.decode = function decode(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.storage.v1beta1.ArrowSchema(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.serializedSchema = reader.bytes(); + message.parent = reader.string(); + break; + case 2: + if (!(message.writeStreams && message.writeStreams.length)) + message.writeStreams = []; + message.writeStreams.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -4449,117 +5297,130 @@ }; /** - * Decodes an ArrowSchema message from the specified reader or buffer, length delimited. + * Decodes a BatchCommitWriteStreamsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1beta1.ArrowSchema} ArrowSchema + * @returns {google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest} BatchCommitWriteStreamsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ArrowSchema.decodeDelimited = function decodeDelimited(reader) { + BatchCommitWriteStreamsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ArrowSchema message. + * Verifies a BatchCommitWriteStreamsRequest message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ArrowSchema.verify = function verify(message) { + BatchCommitWriteStreamsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.serializedSchema != null && message.hasOwnProperty("serializedSchema")) - if (!(message.serializedSchema && typeof message.serializedSchema.length === "number" || $util.isString(message.serializedSchema))) - return "serializedSchema: buffer expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.writeStreams != null && message.hasOwnProperty("writeStreams")) { + if (!Array.isArray(message.writeStreams)) + return "writeStreams: array expected"; + for (var i = 0; i < message.writeStreams.length; ++i) + if (!$util.isString(message.writeStreams[i])) + return "writeStreams: string[] expected"; + } return null; }; /** - * Creates an ArrowSchema message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCommitWriteStreamsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.ArrowSchema} ArrowSchema + * @returns {google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest} BatchCommitWriteStreamsRequest */ - ArrowSchema.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema) + BatchCommitWriteStreamsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest) return object; - var message = new $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema(); - if (object.serializedSchema != null) - if (typeof object.serializedSchema === "string") - $util.base64.decode(object.serializedSchema, message.serializedSchema = $util.newBuffer($util.base64.length(object.serializedSchema)), 0); - else if (object.serializedSchema.length) - message.serializedSchema = object.serializedSchema; + var message = new $root.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.writeStreams) { + if (!Array.isArray(object.writeStreams)) + throw TypeError(".google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest.writeStreams: array expected"); + message.writeStreams = []; + for (var i = 0; i < object.writeStreams.length; ++i) + message.writeStreams[i] = String(object.writeStreams[i]); + } return message; }; /** - * Creates a plain object from an ArrowSchema message. Also converts values to other types if specified. + * Creates a plain object from a BatchCommitWriteStreamsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.ArrowSchema} message ArrowSchema + * @param {google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest} message BatchCommitWriteStreamsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ArrowSchema.toObject = function toObject(message, options) { + BatchCommitWriteStreamsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.writeStreams = []; if (options.defaults) - if (options.bytes === String) - object.serializedSchema = ""; - else { - object.serializedSchema = []; - if (options.bytes !== Array) - object.serializedSchema = $util.newBuffer(object.serializedSchema); - } - if (message.serializedSchema != null && message.hasOwnProperty("serializedSchema")) - object.serializedSchema = options.bytes === String ? $util.base64.encode(message.serializedSchema, 0, message.serializedSchema.length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedSchema) : message.serializedSchema; + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.writeStreams && message.writeStreams.length) { + object.writeStreams = []; + for (var j = 0; j < message.writeStreams.length; ++j) + object.writeStreams[j] = message.writeStreams[j]; + } return object; }; /** - * Converts this ArrowSchema to JSON. + * Converts this BatchCommitWriteStreamsRequest to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest * @instance * @returns {Object.} JSON object */ - ArrowSchema.prototype.toJSON = function toJSON() { + BatchCommitWriteStreamsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ArrowSchema; + return BatchCommitWriteStreamsRequest; })(); - v1beta1.ArrowRecordBatch = (function() { + v1.BatchCommitWriteStreamsResponse = (function() { /** - * Properties of an ArrowRecordBatch. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface IArrowRecordBatch - * @property {Uint8Array|null} [serializedRecordBatch] ArrowRecordBatch serializedRecordBatch - * @property {number|Long|null} [rowCount] ArrowRecordBatch rowCount + * Properties of a BatchCommitWriteStreamsResponse. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IBatchCommitWriteStreamsResponse + * @property {google.protobuf.ITimestamp|null} [commitTime] BatchCommitWriteStreamsResponse commitTime + * @property {Array.|null} [streamErrors] BatchCommitWriteStreamsResponse streamErrors */ /** - * Constructs a new ArrowRecordBatch. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents an ArrowRecordBatch. - * @implements IArrowRecordBatch + * Constructs a new BatchCommitWriteStreamsResponse. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a BatchCommitWriteStreamsResponse. + * @implements IBatchCommitWriteStreamsResponse * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsResponse=} [properties] Properties to set */ - function ArrowRecordBatch(properties) { + function BatchCommitWriteStreamsResponse(properties) { + this.streamErrors = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4567,88 +5428,91 @@ } /** - * ArrowRecordBatch serializedRecordBatch. - * @member {Uint8Array} serializedRecordBatch - * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * BatchCommitWriteStreamsResponse commitTime. + * @member {google.protobuf.ITimestamp|null|undefined} commitTime + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse * @instance */ - ArrowRecordBatch.prototype.serializedRecordBatch = $util.newBuffer([]); + BatchCommitWriteStreamsResponse.prototype.commitTime = null; /** - * ArrowRecordBatch rowCount. - * @member {number|Long} rowCount - * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * BatchCommitWriteStreamsResponse streamErrors. + * @member {Array.} streamErrors + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse * @instance */ - ArrowRecordBatch.prototype.rowCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + BatchCommitWriteStreamsResponse.prototype.streamErrors = $util.emptyArray; /** - * Creates a new ArrowRecordBatch instance using the specified properties. + * Creates a new BatchCommitWriteStreamsResponse instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse * @static - * @param {google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch} ArrowRecordBatch instance + * @param {google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse} BatchCommitWriteStreamsResponse instance */ - ArrowRecordBatch.create = function create(properties) { - return new ArrowRecordBatch(properties); + BatchCommitWriteStreamsResponse.create = function create(properties) { + return new BatchCommitWriteStreamsResponse(properties); }; /** - * Encodes the specified ArrowRecordBatch message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.verify|verify} messages. + * Encodes the specified BatchCommitWriteStreamsResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse * @static - * @param {google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch} message ArrowRecordBatch message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsResponse} message BatchCommitWriteStreamsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ArrowRecordBatch.encode = function encode(message, writer) { + BatchCommitWriteStreamsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.serializedRecordBatch != null && Object.hasOwnProperty.call(message, "serializedRecordBatch")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.serializedRecordBatch); - if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.rowCount); + if (message.commitTime != null && Object.hasOwnProperty.call(message, "commitTime")) + $root.google.protobuf.Timestamp.encode(message.commitTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.streamErrors != null && message.streamErrors.length) + for (var i = 0; i < message.streamErrors.length; ++i) + $root.google.cloud.bigquery.storage.v1.StorageError.encode(message.streamErrors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ArrowRecordBatch message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.verify|verify} messages. + * Encodes the specified BatchCommitWriteStreamsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse * @static - * @param {google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch} message ArrowRecordBatch message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsResponse} message BatchCommitWriteStreamsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ArrowRecordBatch.encodeDelimited = function encodeDelimited(message, writer) { + BatchCommitWriteStreamsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ArrowRecordBatch message from the specified reader or buffer. + * Decodes a BatchCommitWriteStreamsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch} ArrowRecordBatch + * @returns {google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse} BatchCommitWriteStreamsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ArrowRecordBatch.decode = function decode(reader, length) { + BatchCommitWriteStreamsResponse.decode = function decode(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.storage.v1beta1.ArrowRecordBatch(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.serializedRecordBatch = reader.bytes(); + message.commitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 2: - message.rowCount = reader.int64(); + if (!(message.streamErrors && message.streamErrors.length)) + message.streamErrors = []; + message.streamErrors.push($root.google.cloud.bigquery.storage.v1.StorageError.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4659,139 +5523,138 @@ }; /** - * Decodes an ArrowRecordBatch message from the specified reader or buffer, length delimited. + * Decodes a BatchCommitWriteStreamsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch} ArrowRecordBatch + * @returns {google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse} BatchCommitWriteStreamsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ArrowRecordBatch.decodeDelimited = function decodeDelimited(reader) { + BatchCommitWriteStreamsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ArrowRecordBatch message. + * Verifies a BatchCommitWriteStreamsResponse message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ArrowRecordBatch.verify = function verify(message) { + BatchCommitWriteStreamsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.serializedRecordBatch != null && message.hasOwnProperty("serializedRecordBatch")) - if (!(message.serializedRecordBatch && typeof message.serializedRecordBatch.length === "number" || $util.isString(message.serializedRecordBatch))) - return "serializedRecordBatch: buffer expected"; - if (message.rowCount != null && message.hasOwnProperty("rowCount")) - if (!$util.isInteger(message.rowCount) && !(message.rowCount && $util.isInteger(message.rowCount.low) && $util.isInteger(message.rowCount.high))) - return "rowCount: integer|Long expected"; + if (message.commitTime != null && message.hasOwnProperty("commitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.commitTime); + if (error) + return "commitTime." + error; + } + if (message.streamErrors != null && message.hasOwnProperty("streamErrors")) { + if (!Array.isArray(message.streamErrors)) + return "streamErrors: array expected"; + for (var i = 0; i < message.streamErrors.length; ++i) { + var error = $root.google.cloud.bigquery.storage.v1.StorageError.verify(message.streamErrors[i]); + if (error) + return "streamErrors." + error; + } + } return null; }; /** - * Creates an ArrowRecordBatch message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCommitWriteStreamsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch} ArrowRecordBatch + * @returns {google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse} BatchCommitWriteStreamsResponse */ - ArrowRecordBatch.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch) + BatchCommitWriteStreamsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse) return object; - var message = new $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch(); - if (object.serializedRecordBatch != null) - if (typeof object.serializedRecordBatch === "string") - $util.base64.decode(object.serializedRecordBatch, message.serializedRecordBatch = $util.newBuffer($util.base64.length(object.serializedRecordBatch)), 0); - else if (object.serializedRecordBatch.length) - message.serializedRecordBatch = object.serializedRecordBatch; - if (object.rowCount != null) - if ($util.Long) - (message.rowCount = $util.Long.fromValue(object.rowCount)).unsigned = false; - else if (typeof object.rowCount === "string") - message.rowCount = parseInt(object.rowCount, 10); - else if (typeof object.rowCount === "number") - message.rowCount = object.rowCount; - else if (typeof object.rowCount === "object") - message.rowCount = new $util.LongBits(object.rowCount.low >>> 0, object.rowCount.high >>> 0).toNumber(); + var message = new $root.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse(); + if (object.commitTime != null) { + if (typeof object.commitTime !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse.commitTime: object expected"); + message.commitTime = $root.google.protobuf.Timestamp.fromObject(object.commitTime); + } + if (object.streamErrors) { + if (!Array.isArray(object.streamErrors)) + throw TypeError(".google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse.streamErrors: array expected"); + message.streamErrors = []; + for (var i = 0; i < object.streamErrors.length; ++i) { + if (typeof object.streamErrors[i] !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse.streamErrors: object expected"); + message.streamErrors[i] = $root.google.cloud.bigquery.storage.v1.StorageError.fromObject(object.streamErrors[i]); + } + } return message; }; /** - * Creates a plain object from an ArrowRecordBatch message. Also converts values to other types if specified. + * Creates a plain object from a BatchCommitWriteStreamsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse * @static - * @param {google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch} message ArrowRecordBatch + * @param {google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse} message BatchCommitWriteStreamsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ArrowRecordBatch.toObject = function toObject(message, options) { + BatchCommitWriteStreamsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.serializedRecordBatch = ""; - else { - object.serializedRecordBatch = []; - if (options.bytes !== Array) - object.serializedRecordBatch = $util.newBuffer(object.serializedRecordBatch); - } - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.rowCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.rowCount = options.longs === String ? "0" : 0; + if (options.arrays || options.defaults) + object.streamErrors = []; + if (options.defaults) + object.commitTime = null; + if (message.commitTime != null && message.hasOwnProperty("commitTime")) + object.commitTime = $root.google.protobuf.Timestamp.toObject(message.commitTime, options); + if (message.streamErrors && message.streamErrors.length) { + object.streamErrors = []; + for (var j = 0; j < message.streamErrors.length; ++j) + object.streamErrors[j] = $root.google.cloud.bigquery.storage.v1.StorageError.toObject(message.streamErrors[j], options); } - if (message.serializedRecordBatch != null && message.hasOwnProperty("serializedRecordBatch")) - object.serializedRecordBatch = options.bytes === String ? $util.base64.encode(message.serializedRecordBatch, 0, message.serializedRecordBatch.length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedRecordBatch) : message.serializedRecordBatch; - if (message.rowCount != null && message.hasOwnProperty("rowCount")) - if (typeof message.rowCount === "number") - object.rowCount = options.longs === String ? String(message.rowCount) : message.rowCount; - else - object.rowCount = options.longs === String ? $util.Long.prototype.toString.call(message.rowCount) : options.longs === Number ? new $util.LongBits(message.rowCount.low >>> 0, message.rowCount.high >>> 0).toNumber() : message.rowCount; return object; }; /** - * Converts this ArrowRecordBatch to JSON. + * Converts this BatchCommitWriteStreamsResponse to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse * @instance * @returns {Object.} JSON object */ - ArrowRecordBatch.prototype.toJSON = function toJSON() { + BatchCommitWriteStreamsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ArrowRecordBatch; + return BatchCommitWriteStreamsResponse; })(); - v1beta1.AvroSchema = (function() { + v1.FinalizeWriteStreamRequest = (function() { /** - * Properties of an AvroSchema. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface IAvroSchema - * @property {string|null} [schema] AvroSchema schema + * Properties of a FinalizeWriteStreamRequest. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IFinalizeWriteStreamRequest + * @property {string|null} [name] FinalizeWriteStreamRequest name */ /** - * Constructs a new AvroSchema. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents an AvroSchema. - * @implements IAvroSchema + * Constructs a new FinalizeWriteStreamRequest. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a FinalizeWriteStreamRequest. + * @implements IFinalizeWriteStreamRequest * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IAvroSchema=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest=} [properties] Properties to set */ - function AvroSchema(properties) { + function FinalizeWriteStreamRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4799,75 +5662,75 @@ } /** - * AvroSchema schema. - * @member {string} schema - * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema + * FinalizeWriteStreamRequest name. + * @member {string} name + * @memberof google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest * @instance */ - AvroSchema.prototype.schema = ""; + FinalizeWriteStreamRequest.prototype.name = ""; /** - * Creates a new AvroSchema instance using the specified properties. + * Creates a new FinalizeWriteStreamRequest instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema + * @memberof google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.IAvroSchema=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.AvroSchema} AvroSchema instance + * @param {google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest} FinalizeWriteStreamRequest instance */ - AvroSchema.create = function create(properties) { - return new AvroSchema(properties); + FinalizeWriteStreamRequest.create = function create(properties) { + return new FinalizeWriteStreamRequest(properties); }; /** - * Encodes the specified AvroSchema message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroSchema.verify|verify} messages. + * Encodes the specified FinalizeWriteStreamRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema + * @memberof google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.IAvroSchema} message AvroSchema message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest} message FinalizeWriteStreamRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AvroSchema.encode = function encode(message, writer) { + FinalizeWriteStreamRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.schema); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified AvroSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroSchema.verify|verify} messages. + * Encodes the specified FinalizeWriteStreamRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema + * @memberof google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.IAvroSchema} message AvroSchema message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest} message FinalizeWriteStreamRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AvroSchema.encodeDelimited = function encodeDelimited(message, writer) { + FinalizeWriteStreamRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AvroSchema message from the specified reader or buffer. + * Decodes a FinalizeWriteStreamRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema + * @memberof google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1beta1.AvroSchema} AvroSchema + * @returns {google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest} FinalizeWriteStreamRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AvroSchema.decode = function decode(reader, length) { + FinalizeWriteStreamRequest.decode = function decode(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.storage.v1beta1.AvroSchema(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.schema = reader.string(); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -4878,108 +5741,107 @@ }; /** - * Decodes an AvroSchema message from the specified reader or buffer, length delimited. + * Decodes a FinalizeWriteStreamRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema + * @memberof google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1beta1.AvroSchema} AvroSchema + * @returns {google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest} FinalizeWriteStreamRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AvroSchema.decodeDelimited = function decodeDelimited(reader) { + FinalizeWriteStreamRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AvroSchema message. + * Verifies a FinalizeWriteStreamRequest message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema + * @memberof google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AvroSchema.verify = function verify(message) { + FinalizeWriteStreamRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.schema != null && message.hasOwnProperty("schema")) - if (!$util.isString(message.schema)) - return "schema: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates an AvroSchema message from a plain object. Also converts values to their respective internal types. + * Creates a FinalizeWriteStreamRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema + * @memberof google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.AvroSchema} AvroSchema + * @returns {google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest} FinalizeWriteStreamRequest */ - AvroSchema.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.AvroSchema) + FinalizeWriteStreamRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest) return object; - var message = new $root.google.cloud.bigquery.storage.v1beta1.AvroSchema(); - if (object.schema != null) - message.schema = String(object.schema); + var message = new $root.google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from an AvroSchema message. Also converts values to other types if specified. + * Creates a plain object from a FinalizeWriteStreamRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema + * @memberof google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.AvroSchema} message AvroSchema + * @param {google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest} message FinalizeWriteStreamRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AvroSchema.toObject = function toObject(message, options) { + FinalizeWriteStreamRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.schema = ""; - if (message.schema != null && message.hasOwnProperty("schema")) - object.schema = message.schema; + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this AvroSchema to JSON. + * Converts this FinalizeWriteStreamRequest to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema + * @memberof google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest * @instance * @returns {Object.} JSON object */ - AvroSchema.prototype.toJSON = function toJSON() { + FinalizeWriteStreamRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AvroSchema; + return FinalizeWriteStreamRequest; })(); - v1beta1.AvroRows = (function() { + v1.FinalizeWriteStreamResponse = (function() { /** - * Properties of an AvroRows. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface IAvroRows - * @property {Uint8Array|null} [serializedBinaryRows] AvroRows serializedBinaryRows - * @property {number|Long|null} [rowCount] AvroRows rowCount + * Properties of a FinalizeWriteStreamResponse. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IFinalizeWriteStreamResponse + * @property {number|Long|null} [rowCount] FinalizeWriteStreamResponse rowCount */ /** - * Constructs a new AvroRows. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents an AvroRows. - * @implements IAvroRows + * Constructs a new FinalizeWriteStreamResponse. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a FinalizeWriteStreamResponse. + * @implements IFinalizeWriteStreamResponse * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IAvroRows=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1.IFinalizeWriteStreamResponse=} [properties] Properties to set */ - function AvroRows(properties) { + function FinalizeWriteStreamResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4987,87 +5849,74 @@ } /** - * AvroRows serializedBinaryRows. - * @member {Uint8Array} serializedBinaryRows - * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows - * @instance - */ - AvroRows.prototype.serializedBinaryRows = $util.newBuffer([]); - - /** - * AvroRows rowCount. + * FinalizeWriteStreamResponse rowCount. * @member {number|Long} rowCount - * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @memberof google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse * @instance */ - AvroRows.prototype.rowCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + FinalizeWriteStreamResponse.prototype.rowCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new AvroRows instance using the specified properties. + * Creates a new FinalizeWriteStreamResponse instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @memberof google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse * @static - * @param {google.cloud.bigquery.storage.v1beta1.IAvroRows=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.AvroRows} AvroRows instance + * @param {google.cloud.bigquery.storage.v1.IFinalizeWriteStreamResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse} FinalizeWriteStreamResponse instance */ - AvroRows.create = function create(properties) { - return new AvroRows(properties); + FinalizeWriteStreamResponse.create = function create(properties) { + return new FinalizeWriteStreamResponse(properties); }; /** - * Encodes the specified AvroRows message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroRows.verify|verify} messages. + * Encodes the specified FinalizeWriteStreamResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @memberof google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse * @static - * @param {google.cloud.bigquery.storage.v1beta1.IAvroRows} message AvroRows message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.IFinalizeWriteStreamResponse} message FinalizeWriteStreamResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AvroRows.encode = function encode(message, writer) { + FinalizeWriteStreamResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.serializedBinaryRows != null && Object.hasOwnProperty.call(message, "serializedBinaryRows")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.serializedBinaryRows); if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.rowCount); + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.rowCount); return writer; }; /** - * Encodes the specified AvroRows message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroRows.verify|verify} messages. + * Encodes the specified FinalizeWriteStreamResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @memberof google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse * @static - * @param {google.cloud.bigquery.storage.v1beta1.IAvroRows} message AvroRows message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.IFinalizeWriteStreamResponse} message FinalizeWriteStreamResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AvroRows.encodeDelimited = function encodeDelimited(message, writer) { + FinalizeWriteStreamResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AvroRows message from the specified reader or buffer. + * Decodes a FinalizeWriteStreamResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @memberof google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1beta1.AvroRows} AvroRows + * @returns {google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse} FinalizeWriteStreamResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AvroRows.decode = function decode(reader, length) { + FinalizeWriteStreamResponse.decode = function decode(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.storage.v1beta1.AvroRows(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.serializedBinaryRows = reader.bytes(); - break; - case 2: message.rowCount = reader.int64(); break; default: @@ -5079,35 +5928,32 @@ }; /** - * Decodes an AvroRows message from the specified reader or buffer, length delimited. + * Decodes a FinalizeWriteStreamResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @memberof google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1beta1.AvroRows} AvroRows + * @returns {google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse} FinalizeWriteStreamResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AvroRows.decodeDelimited = function decodeDelimited(reader) { + FinalizeWriteStreamResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AvroRows message. + * Verifies a FinalizeWriteStreamResponse message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @memberof google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AvroRows.verify = function verify(message) { + FinalizeWriteStreamResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.serializedBinaryRows != null && message.hasOwnProperty("serializedBinaryRows")) - if (!(message.serializedBinaryRows && typeof message.serializedBinaryRows.length === "number" || $util.isString(message.serializedBinaryRows))) - return "serializedBinaryRows: buffer expected"; if (message.rowCount != null && message.hasOwnProperty("rowCount")) if (!$util.isInteger(message.rowCount) && !(message.rowCount && $util.isInteger(message.rowCount.low) && $util.isInteger(message.rowCount.high))) return "rowCount: integer|Long expected"; @@ -5115,22 +5961,17 @@ }; /** - * Creates an AvroRows message from a plain object. Also converts values to their respective internal types. + * Creates a FinalizeWriteStreamResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @memberof google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.AvroRows} AvroRows + * @returns {google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse} FinalizeWriteStreamResponse */ - AvroRows.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.AvroRows) + FinalizeWriteStreamResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse) return object; - var message = new $root.google.cloud.bigquery.storage.v1beta1.AvroRows(); - if (object.serializedBinaryRows != null) - if (typeof object.serializedBinaryRows === "string") - $util.base64.decode(object.serializedBinaryRows, message.serializedBinaryRows = $util.newBuffer($util.base64.length(object.serializedBinaryRows)), 0); - else if (object.serializedBinaryRows.length) - message.serializedBinaryRows = object.serializedBinaryRows; + var message = new $root.google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse(); if (object.rowCount != null) if ($util.Long) (message.rowCount = $util.Long.fromValue(object.rowCount)).unsigned = false; @@ -5144,34 +5985,24 @@ }; /** - * Creates a plain object from an AvroRows message. Also converts values to other types if specified. + * Creates a plain object from a FinalizeWriteStreamResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @memberof google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse * @static - * @param {google.cloud.bigquery.storage.v1beta1.AvroRows} message AvroRows + * @param {google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse} message FinalizeWriteStreamResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AvroRows.toObject = function toObject(message, options) { + FinalizeWriteStreamResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.serializedBinaryRows = ""; - else { - object.serializedBinaryRows = []; - if (options.bytes !== Array) - object.serializedBinaryRows = $util.newBuffer(object.serializedBinaryRows); - } + if (options.defaults) if ($util.Long) { var long = new $util.Long(0, 0, false); object.rowCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.rowCount = options.longs === String ? "0" : 0; - } - if (message.serializedBinaryRows != null && message.hasOwnProperty("serializedBinaryRows")) - object.serializedBinaryRows = options.bytes === String ? $util.base64.encode(message.serializedBinaryRows, 0, message.serializedBinaryRows.length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedBinaryRows) : message.serializedBinaryRows; if (message.rowCount != null && message.hasOwnProperty("rowCount")) if (typeof message.rowCount === "number") object.rowCount = options.longs === String ? String(message.rowCount) : message.rowCount; @@ -5181,39 +6012,38 @@ }; /** - * Converts this AvroRows to JSON. + * Converts this FinalizeWriteStreamResponse to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @memberof google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse * @instance * @returns {Object.} JSON object */ - AvroRows.prototype.toJSON = function toJSON() { + FinalizeWriteStreamResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AvroRows; + return FinalizeWriteStreamResponse; })(); - v1beta1.TableReadOptions = (function() { + v1.FlushRowsRequest = (function() { /** - * Properties of a TableReadOptions. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface ITableReadOptions - * @property {Array.|null} [selectedFields] TableReadOptions selectedFields - * @property {string|null} [rowRestriction] TableReadOptions rowRestriction + * Properties of a FlushRowsRequest. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IFlushRowsRequest + * @property {string|null} [writeStream] FlushRowsRequest writeStream + * @property {google.protobuf.IInt64Value|null} [offset] FlushRowsRequest offset */ /** - * Constructs a new TableReadOptions. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a TableReadOptions. - * @implements ITableReadOptions + * Constructs a new FlushRowsRequest. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a FlushRowsRequest. + * @implements IFlushRowsRequest * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.ITableReadOptions=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1.IFlushRowsRequest=} [properties] Properties to set */ - function TableReadOptions(properties) { - this.selectedFields = []; + function FlushRowsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5221,91 +6051,88 @@ } /** - * TableReadOptions selectedFields. - * @member {Array.} selectedFields - * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * FlushRowsRequest writeStream. + * @member {string} writeStream + * @memberof google.cloud.bigquery.storage.v1.FlushRowsRequest * @instance */ - TableReadOptions.prototype.selectedFields = $util.emptyArray; + FlushRowsRequest.prototype.writeStream = ""; /** - * TableReadOptions rowRestriction. - * @member {string} rowRestriction - * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * FlushRowsRequest offset. + * @member {google.protobuf.IInt64Value|null|undefined} offset + * @memberof google.cloud.bigquery.storage.v1.FlushRowsRequest * @instance */ - TableReadOptions.prototype.rowRestriction = ""; + FlushRowsRequest.prototype.offset = null; /** - * Creates a new TableReadOptions instance using the specified properties. + * Creates a new FlushRowsRequest instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1.FlushRowsRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.ITableReadOptions=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.TableReadOptions} TableReadOptions instance + * @param {google.cloud.bigquery.storage.v1.IFlushRowsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.FlushRowsRequest} FlushRowsRequest instance */ - TableReadOptions.create = function create(properties) { - return new TableReadOptions(properties); + FlushRowsRequest.create = function create(properties) { + return new FlushRowsRequest(properties); }; /** - * Encodes the specified TableReadOptions message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableReadOptions.verify|verify} messages. + * Encodes the specified FlushRowsRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1.FlushRowsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1.FlushRowsRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.ITableReadOptions} message TableReadOptions message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.IFlushRowsRequest} message FlushRowsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TableReadOptions.encode = function encode(message, writer) { + FlushRowsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selectedFields != null && message.selectedFields.length) - for (var i = 0; i < message.selectedFields.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectedFields[i]); - if (message.rowRestriction != null && Object.hasOwnProperty.call(message, "rowRestriction")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.rowRestriction); + if (message.writeStream != null && Object.hasOwnProperty.call(message, "writeStream")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.writeStream); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + $root.google.protobuf.Int64Value.encode(message.offset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified TableReadOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableReadOptions.verify|verify} messages. + * Encodes the specified FlushRowsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.FlushRowsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1.FlushRowsRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.ITableReadOptions} message TableReadOptions message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.IFlushRowsRequest} message FlushRowsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TableReadOptions.encodeDelimited = function encodeDelimited(message, writer) { + FlushRowsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TableReadOptions message from the specified reader or buffer. + * Decodes a FlushRowsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1.FlushRowsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1beta1.TableReadOptions} TableReadOptions + * @returns {google.cloud.bigquery.storage.v1.FlushRowsRequest} FlushRowsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TableReadOptions.decode = function decode(reader, length) { + FlushRowsRequest.decode = function decode(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.storage.v1beta1.TableReadOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1.FlushRowsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.selectedFields && message.selectedFields.length)) - message.selectedFields = []; - message.selectedFields.push(reader.string()); + message.writeStream = reader.string(); break; case 2: - message.rowRestriction = reader.string(); + message.offset = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -5316,404 +6143,426 @@ }; /** - * Decodes a TableReadOptions message from the specified reader or buffer, length delimited. + * Decodes a FlushRowsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1.FlushRowsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1beta1.TableReadOptions} TableReadOptions + * @returns {google.cloud.bigquery.storage.v1.FlushRowsRequest} FlushRowsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TableReadOptions.decodeDelimited = function decodeDelimited(reader) { + FlushRowsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TableReadOptions message. + * Verifies a FlushRowsRequest message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1.FlushRowsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TableReadOptions.verify = function verify(message) { + FlushRowsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.selectedFields != null && message.hasOwnProperty("selectedFields")) { - if (!Array.isArray(message.selectedFields)) - return "selectedFields: array expected"; - for (var i = 0; i < message.selectedFields.length; ++i) - if (!$util.isString(message.selectedFields[i])) - return "selectedFields: string[] expected"; + if (message.writeStream != null && message.hasOwnProperty("writeStream")) + if (!$util.isString(message.writeStream)) + return "writeStream: string expected"; + if (message.offset != null && message.hasOwnProperty("offset")) { + var error = $root.google.protobuf.Int64Value.verify(message.offset); + if (error) + return "offset." + error; } - if (message.rowRestriction != null && message.hasOwnProperty("rowRestriction")) - if (!$util.isString(message.rowRestriction)) - return "rowRestriction: string expected"; return null; }; /** - * Creates a TableReadOptions message from a plain object. Also converts values to their respective internal types. + * Creates a FlushRowsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1.FlushRowsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.TableReadOptions} TableReadOptions + * @returns {google.cloud.bigquery.storage.v1.FlushRowsRequest} FlushRowsRequest */ - TableReadOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions) + FlushRowsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.FlushRowsRequest) return object; - var message = new $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions(); - if (object.selectedFields) { - if (!Array.isArray(object.selectedFields)) - throw TypeError(".google.cloud.bigquery.storage.v1beta1.TableReadOptions.selectedFields: array expected"); - message.selectedFields = []; - for (var i = 0; i < object.selectedFields.length; ++i) - message.selectedFields[i] = String(object.selectedFields[i]); + var message = new $root.google.cloud.bigquery.storage.v1.FlushRowsRequest(); + if (object.writeStream != null) + message.writeStream = String(object.writeStream); + if (object.offset != null) { + if (typeof object.offset !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.FlushRowsRequest.offset: object expected"); + message.offset = $root.google.protobuf.Int64Value.fromObject(object.offset); } - if (object.rowRestriction != null) - message.rowRestriction = String(object.rowRestriction); return message; }; /** - * Creates a plain object from a TableReadOptions message. Also converts values to other types if specified. + * Creates a plain object from a FlushRowsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1.FlushRowsRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.TableReadOptions} message TableReadOptions + * @param {google.cloud.bigquery.storage.v1.FlushRowsRequest} message FlushRowsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TableReadOptions.toObject = function toObject(message, options) { + FlushRowsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.selectedFields = []; - if (options.defaults) - object.rowRestriction = ""; - if (message.selectedFields && message.selectedFields.length) { - object.selectedFields = []; - for (var j = 0; j < message.selectedFields.length; ++j) - object.selectedFields[j] = message.selectedFields[j]; + if (options.defaults) { + object.writeStream = ""; + object.offset = null; } - if (message.rowRestriction != null && message.hasOwnProperty("rowRestriction")) - object.rowRestriction = message.rowRestriction; + if (message.writeStream != null && message.hasOwnProperty("writeStream")) + object.writeStream = message.writeStream; + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = $root.google.protobuf.Int64Value.toObject(message.offset, options); return object; }; /** - * Converts this TableReadOptions to JSON. + * Converts this FlushRowsRequest to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1.FlushRowsRequest * @instance * @returns {Object.} JSON object */ - TableReadOptions.prototype.toJSON = function toJSON() { + FlushRowsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TableReadOptions; + return FlushRowsRequest; })(); - v1beta1.BigQueryStorage = (function() { + v1.FlushRowsResponse = (function() { /** - * Constructs a new BigQueryStorage service. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a BigQueryStorage - * @extends $protobuf.rpc.Service + * Properties of a FlushRowsResponse. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IFlushRowsResponse + * @property {number|Long|null} [offset] FlushRowsResponse offset + */ + + /** + * Constructs a new FlushRowsResponse. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a FlushRowsResponse. + * @implements IFlushRowsResponse * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @param {google.cloud.bigquery.storage.v1.IFlushRowsResponse=} [properties] Properties to set */ - function BigQueryStorage(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function FlushRowsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - (BigQueryStorage.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BigQueryStorage; + /** + * FlushRowsResponse offset. + * @member {number|Long} offset + * @memberof google.cloud.bigquery.storage.v1.FlushRowsResponse + * @instance + */ + FlushRowsResponse.prototype.offset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates new BigQueryStorage service using the specified rpc implementation. + * Creates a new FlushRowsResponse instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @memberof google.cloud.bigquery.storage.v1.FlushRowsResponse * @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 {BigQueryStorage} RPC service. Useful where requests and/or responses are streamed. + * @param {google.cloud.bigquery.storage.v1.IFlushRowsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.FlushRowsResponse} FlushRowsResponse instance */ - BigQueryStorage.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + FlushRowsResponse.create = function create(properties) { + return new FlushRowsResponse(properties); }; /** - * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#createReadSession}. - * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage - * @typedef CreateReadSessionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.bigquery.storage.v1beta1.ReadSession} [response] ReadSession + * Encodes the specified FlushRowsResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1.FlushRowsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.FlushRowsResponse + * @static + * @param {google.cloud.bigquery.storage.v1.IFlushRowsResponse} message FlushRowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + FlushRowsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.offset); + return writer; + }; /** - * Calls CreateReadSession. - * @function createReadSession - * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage - * @instance - * @param {google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest} request CreateReadSessionRequest message or plain object - * @param {google.cloud.bigquery.storage.v1beta1.BigQueryStorage.CreateReadSessionCallback} callback Node-style callback called with the error, if any, and ReadSession - * @returns {undefined} - * @variation 1 + * Encodes the specified FlushRowsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.FlushRowsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.FlushRowsResponse + * @static + * @param {google.cloud.bigquery.storage.v1.IFlushRowsResponse} message FlushRowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(BigQueryStorage.prototype.createReadSession = function createReadSession(request, callback) { - return this.rpcCall(createReadSession, $root.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest, $root.google.cloud.bigquery.storage.v1beta1.ReadSession, request, callback); - }, "name", { value: "CreateReadSession" }); + FlushRowsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls CreateReadSession. - * @function createReadSession - * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage - * @instance - * @param {google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest} request CreateReadSessionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a FlushRowsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.FlushRowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.FlushRowsResponse} FlushRowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + FlushRowsResponse.decode = function decode(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.storage.v1.FlushRowsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.offset = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#readRows}. - * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage - * @typedef ReadRowsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} [response] ReadRowsResponse + * Decodes a FlushRowsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.FlushRowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.FlushRowsResponse} FlushRowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + FlushRowsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls ReadRows. - * @function readRows - * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage - * @instance - * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsRequest} request ReadRowsRequest message or plain object - * @param {google.cloud.bigquery.storage.v1beta1.BigQueryStorage.ReadRowsCallback} callback Node-style callback called with the error, if any, and ReadRowsResponse - * @returns {undefined} - * @variation 1 + * Verifies a FlushRowsResponse message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.FlushRowsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(BigQueryStorage.prototype.readRows = function readRows(request, callback) { - return this.rpcCall(readRows, $root.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest, $root.google.cloud.bigquery.storage.v1beta1.ReadRowsResponse, request, callback); - }, "name", { value: "ReadRows" }); + FlushRowsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset) && !(message.offset && $util.isInteger(message.offset.low) && $util.isInteger(message.offset.high))) + return "offset: integer|Long expected"; + return null; + }; /** - * Calls ReadRows. - * @function readRows - * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage - * @instance - * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsRequest} request ReadRowsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a FlushRowsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.FlushRowsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.FlushRowsResponse} FlushRowsResponse */ + FlushRowsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.FlushRowsResponse) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.FlushRowsResponse(); + if (object.offset != null) + if ($util.Long) + (message.offset = $util.Long.fromValue(object.offset)).unsigned = false; + else if (typeof object.offset === "string") + message.offset = parseInt(object.offset, 10); + else if (typeof object.offset === "number") + message.offset = object.offset; + else if (typeof object.offset === "object") + message.offset = new $util.LongBits(object.offset.low >>> 0, object.offset.high >>> 0).toNumber(); + return message; + }; /** - * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#batchCreateReadSessionStreams}. - * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage - * @typedef BatchCreateReadSessionStreamsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse} [response] BatchCreateReadSessionStreamsResponse + * Creates a plain object from a FlushRowsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.FlushRowsResponse + * @static + * @param {google.cloud.bigquery.storage.v1.FlushRowsResponse} message FlushRowsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + FlushRowsResponse.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.offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.offset = options.longs === String ? "0" : 0; + if (message.offset != null && message.hasOwnProperty("offset")) + if (typeof message.offset === "number") + object.offset = options.longs === String ? String(message.offset) : message.offset; + else + object.offset = options.longs === String ? $util.Long.prototype.toString.call(message.offset) : options.longs === Number ? new $util.LongBits(message.offset.low >>> 0, message.offset.high >>> 0).toNumber() : message.offset; + return object; + }; /** - * Calls BatchCreateReadSessionStreams. - * @function batchCreateReadSessionStreams - * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * Converts this FlushRowsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.FlushRowsResponse * @instance - * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest} request BatchCreateReadSessionStreamsRequest message or plain object - * @param {google.cloud.bigquery.storage.v1beta1.BigQueryStorage.BatchCreateReadSessionStreamsCallback} callback Node-style callback called with the error, if any, and BatchCreateReadSessionStreamsResponse - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(BigQueryStorage.prototype.batchCreateReadSessionStreams = function batchCreateReadSessionStreams(request, callback) { - return this.rpcCall(batchCreateReadSessionStreams, $root.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest, $root.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse, request, callback); - }, "name", { value: "BatchCreateReadSessionStreams" }); + FlushRowsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Calls BatchCreateReadSessionStreams. - * @function batchCreateReadSessionStreams - * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage - * @instance - * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest} request BatchCreateReadSessionStreamsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + return FlushRowsResponse; + })(); + + v1.StorageError = (function() { /** - * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#finalizeStream}. - * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage - * @typedef FinalizeStreamCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Properties of a StorageError. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IStorageError + * @property {google.cloud.bigquery.storage.v1.StorageError.StorageErrorCode|null} [code] StorageError code + * @property {string|null} [entity] StorageError entity + * @property {string|null} [errorMessage] StorageError errorMessage */ /** - * Calls FinalizeStream. - * @function finalizeStream - * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage - * @instance - * @param {google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest} request FinalizeStreamRequest message or plain object - * @param {google.cloud.bigquery.storage.v1beta1.BigQueryStorage.FinalizeStreamCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BigQueryStorage.prototype.finalizeStream = function finalizeStream(request, callback) { - return this.rpcCall(finalizeStream, $root.google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "FinalizeStream" }); - - /** - * Calls FinalizeStream. - * @function finalizeStream - * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage - * @instance - * @param {google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest} request FinalizeStreamRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#splitReadStream}. - * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage - * @typedef SplitReadStreamCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse} [response] SplitReadStreamResponse + * Constructs a new StorageError. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a StorageError. + * @implements IStorageError + * @constructor + * @param {google.cloud.bigquery.storage.v1.IStorageError=} [properties] Properties to set */ + function StorageError(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls SplitReadStream. - * @function splitReadStream - * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * StorageError code. + * @member {google.cloud.bigquery.storage.v1.StorageError.StorageErrorCode} code + * @memberof google.cloud.bigquery.storage.v1.StorageError * @instance - * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest} request SplitReadStreamRequest message or plain object - * @param {google.cloud.bigquery.storage.v1beta1.BigQueryStorage.SplitReadStreamCallback} callback Node-style callback called with the error, if any, and SplitReadStreamResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(BigQueryStorage.prototype.splitReadStream = function splitReadStream(request, callback) { - return this.rpcCall(splitReadStream, $root.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest, $root.google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse, request, callback); - }, "name", { value: "SplitReadStream" }); + StorageError.prototype.code = 0; /** - * Calls SplitReadStream. - * @function splitReadStream - * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * StorageError entity. + * @member {string} entity + * @memberof google.cloud.bigquery.storage.v1.StorageError * @instance - * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest} request SplitReadStreamRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return BigQueryStorage; - })(); - - v1beta1.Stream = (function() { - - /** - * Properties of a Stream. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface IStream - * @property {string|null} [name] Stream name - */ - - /** - * Constructs a new Stream. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a Stream. - * @implements IStream - * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IStream=} [properties] Properties to set */ - function Stream(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + StorageError.prototype.entity = ""; /** - * Stream name. - * @member {string} name - * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * StorageError errorMessage. + * @member {string} errorMessage + * @memberof google.cloud.bigquery.storage.v1.StorageError * @instance */ - Stream.prototype.name = ""; + StorageError.prototype.errorMessage = ""; /** - * Creates a new Stream instance using the specified properties. + * Creates a new StorageError instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @memberof google.cloud.bigquery.storage.v1.StorageError * @static - * @param {google.cloud.bigquery.storage.v1beta1.IStream=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.Stream} Stream instance + * @param {google.cloud.bigquery.storage.v1.IStorageError=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.StorageError} StorageError instance */ - Stream.create = function create(properties) { - return new Stream(properties); + StorageError.create = function create(properties) { + return new StorageError(properties); }; /** - * Encodes the specified Stream message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Stream.verify|verify} messages. + * Encodes the specified StorageError message. Does not implicitly {@link google.cloud.bigquery.storage.v1.StorageError.verify|verify} messages. * @function encode - * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @memberof google.cloud.bigquery.storage.v1.StorageError * @static - * @param {google.cloud.bigquery.storage.v1beta1.IStream} message Stream message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.IStorageError} message StorageError message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Stream.encode = function encode(message, writer) { + StorageError.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.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entity); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.errorMessage); return writer; }; /** - * Encodes the specified Stream message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Stream.verify|verify} messages. + * Encodes the specified StorageError message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.StorageError.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @memberof google.cloud.bigquery.storage.v1.StorageError * @static - * @param {google.cloud.bigquery.storage.v1beta1.IStream} message Stream message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.IStorageError} message StorageError message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Stream.encodeDelimited = function encodeDelimited(message, writer) { + StorageError.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Stream message from the specified reader or buffer. + * Decodes a StorageError message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @memberof google.cloud.bigquery.storage.v1.StorageError * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1beta1.Stream} Stream + * @returns {google.cloud.bigquery.storage.v1.StorageError} StorageError * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Stream.decode = function decode(reader, length) { + StorageError.decode = function decode(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.storage.v1beta1.Stream(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1.StorageError(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.code = reader.int32(); + break; + case 2: + message.entity = reader.string(); + break; + case 3: + message.errorMessage = reader.string(); break; default: reader.skipType(tag & 7); @@ -5724,108 +6573,219 @@ }; /** - * Decodes a Stream message from the specified reader or buffer, length delimited. + * Decodes a StorageError message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @memberof google.cloud.bigquery.storage.v1.StorageError * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1beta1.Stream} Stream + * @returns {google.cloud.bigquery.storage.v1.StorageError} StorageError * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Stream.decodeDelimited = function decodeDelimited(reader) { + StorageError.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Stream message. + * Verifies a StorageError message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @memberof google.cloud.bigquery.storage.v1.StorageError * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Stream.verify = function verify(message) { + StorageError.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.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.entity != null && message.hasOwnProperty("entity")) + if (!$util.isString(message.entity)) + return "entity: string expected"; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; return null; }; /** - * Creates a Stream message from a plain object. Also converts values to their respective internal types. + * Creates a StorageError message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @memberof google.cloud.bigquery.storage.v1.StorageError * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.Stream} Stream + * @returns {google.cloud.bigquery.storage.v1.StorageError} StorageError */ - Stream.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.Stream) + StorageError.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.StorageError) return object; - var message = new $root.google.cloud.bigquery.storage.v1beta1.Stream(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.bigquery.storage.v1.StorageError(); + switch (object.code) { + case "STORAGE_ERROR_CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "TABLE_NOT_FOUND": + case 1: + message.code = 1; + break; + case "STREAM_ALREADY_COMMITTED": + case 2: + message.code = 2; + break; + case "STREAM_NOT_FOUND": + case 3: + message.code = 3; + break; + case "INVALID_STREAM_TYPE": + case 4: + message.code = 4; + break; + case "INVALID_STREAM_STATE": + case 5: + message.code = 5; + break; + case "STREAM_FINALIZED": + case 6: + message.code = 6; + break; + case "SCHEMA_MISMATCH_EXTRA_FIELDS": + case 7: + message.code = 7; + break; + } + if (object.entity != null) + message.entity = String(object.entity); + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); return message; }; /** - * Creates a plain object from a Stream message. Also converts values to other types if specified. + * Creates a plain object from a StorageError message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @memberof google.cloud.bigquery.storage.v1.StorageError * @static - * @param {google.cloud.bigquery.storage.v1beta1.Stream} message Stream + * @param {google.cloud.bigquery.storage.v1.StorageError} message StorageError * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Stream.toObject = function toObject(message, options) { + StorageError.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.code = options.enums === String ? "STORAGE_ERROR_CODE_UNSPECIFIED" : 0; + object.entity = ""; + object.errorMessage = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.cloud.bigquery.storage.v1.StorageError.StorageErrorCode[message.code] : message.code; + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = message.entity; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = message.errorMessage; return object; }; /** - * Converts this Stream to JSON. + * Converts this StorageError to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @memberof google.cloud.bigquery.storage.v1.StorageError * @instance * @returns {Object.} JSON object */ - Stream.prototype.toJSON = function toJSON() { + StorageError.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Stream; + /** + * StorageErrorCode enum. + * @name google.cloud.bigquery.storage.v1.StorageError.StorageErrorCode + * @enum {number} + * @property {number} STORAGE_ERROR_CODE_UNSPECIFIED=0 STORAGE_ERROR_CODE_UNSPECIFIED value + * @property {number} TABLE_NOT_FOUND=1 TABLE_NOT_FOUND value + * @property {number} STREAM_ALREADY_COMMITTED=2 STREAM_ALREADY_COMMITTED value + * @property {number} STREAM_NOT_FOUND=3 STREAM_NOT_FOUND value + * @property {number} INVALID_STREAM_TYPE=4 INVALID_STREAM_TYPE value + * @property {number} INVALID_STREAM_STATE=5 INVALID_STREAM_STATE value + * @property {number} STREAM_FINALIZED=6 STREAM_FINALIZED value + * @property {number} SCHEMA_MISMATCH_EXTRA_FIELDS=7 SCHEMA_MISMATCH_EXTRA_FIELDS value + */ + StorageError.StorageErrorCode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STORAGE_ERROR_CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TABLE_NOT_FOUND"] = 1; + values[valuesById[2] = "STREAM_ALREADY_COMMITTED"] = 2; + values[valuesById[3] = "STREAM_NOT_FOUND"] = 3; + values[valuesById[4] = "INVALID_STREAM_TYPE"] = 4; + values[valuesById[5] = "INVALID_STREAM_STATE"] = 5; + values[valuesById[6] = "STREAM_FINALIZED"] = 6; + values[valuesById[7] = "SCHEMA_MISMATCH_EXTRA_FIELDS"] = 7; + return values; + })(); + + return StorageError; })(); - v1beta1.StreamPosition = (function() { + /** + * DataFormat enum. + * @name google.cloud.bigquery.storage.v1.DataFormat + * @enum {number} + * @property {number} DATA_FORMAT_UNSPECIFIED=0 DATA_FORMAT_UNSPECIFIED value + * @property {number} AVRO=1 AVRO value + * @property {number} ARROW=2 ARROW value + */ + v1.DataFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "AVRO"] = 1; + values[valuesById[2] = "ARROW"] = 2; + return values; + })(); + + v1.ReadSession = (function() { /** - * Properties of a StreamPosition. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface IStreamPosition - * @property {google.cloud.bigquery.storage.v1beta1.IStream|null} [stream] StreamPosition stream - * @property {number|Long|null} [offset] StreamPosition offset + * Properties of a ReadSession. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IReadSession + * @property {string|null} [name] ReadSession name + * @property {google.protobuf.ITimestamp|null} [expireTime] ReadSession expireTime + * @property {google.cloud.bigquery.storage.v1.DataFormat|null} [dataFormat] ReadSession dataFormat + * @property {google.cloud.bigquery.storage.v1.IAvroSchema|null} [avroSchema] ReadSession avroSchema + * @property {google.cloud.bigquery.storage.v1.IArrowSchema|null} [arrowSchema] ReadSession arrowSchema + * @property {string|null} [table] ReadSession table + * @property {google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers|null} [tableModifiers] ReadSession tableModifiers + * @property {google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions|null} [readOptions] ReadSession readOptions + * @property {Array.|null} [streams] ReadSession streams + * @property {number|Long|null} [estimatedTotalBytesScanned] ReadSession estimatedTotalBytesScanned */ /** - * Constructs a new StreamPosition. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a StreamPosition. - * @implements IStreamPosition + * Constructs a new ReadSession. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a ReadSession. + * @implements IReadSession * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IStreamPosition=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1.IReadSession=} [properties] Properties to set */ - function StreamPosition(properties) { + function ReadSession(properties) { + this.streams = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5833,88 +6793,209 @@ } /** - * StreamPosition stream. - * @member {google.cloud.bigquery.storage.v1beta1.IStream|null|undefined} stream - * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * ReadSession name. + * @member {string} name + * @memberof google.cloud.bigquery.storage.v1.ReadSession * @instance */ - StreamPosition.prototype.stream = null; + ReadSession.prototype.name = ""; /** - * StreamPosition offset. - * @member {number|Long} offset - * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * ReadSession expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.bigquery.storage.v1.ReadSession * @instance */ - StreamPosition.prototype.offset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ReadSession.prototype.expireTime = null; /** - * Creates a new StreamPosition instance using the specified properties. - * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition - * @static - * @param {google.cloud.bigquery.storage.v1beta1.IStreamPosition=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.StreamPosition} StreamPosition instance + * ReadSession dataFormat. + * @member {google.cloud.bigquery.storage.v1.DataFormat} dataFormat + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @instance */ - StreamPosition.create = function create(properties) { - return new StreamPosition(properties); - }; + ReadSession.prototype.dataFormat = 0; /** - * Encodes the specified StreamPosition message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamPosition.verify|verify} messages. - * @function encode - * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition - * @static - * @param {google.cloud.bigquery.storage.v1beta1.IStreamPosition} message StreamPosition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StreamPosition.encode = function encode(message, writer) { + * ReadSession avroSchema. + * @member {google.cloud.bigquery.storage.v1.IAvroSchema|null|undefined} avroSchema + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @instance + */ + ReadSession.prototype.avroSchema = null; + + /** + * ReadSession arrowSchema. + * @member {google.cloud.bigquery.storage.v1.IArrowSchema|null|undefined} arrowSchema + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @instance + */ + ReadSession.prototype.arrowSchema = null; + + /** + * ReadSession table. + * @member {string} table + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @instance + */ + ReadSession.prototype.table = ""; + + /** + * ReadSession tableModifiers. + * @member {google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers|null|undefined} tableModifiers + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @instance + */ + ReadSession.prototype.tableModifiers = null; + + /** + * ReadSession readOptions. + * @member {google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions|null|undefined} readOptions + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @instance + */ + ReadSession.prototype.readOptions = null; + + /** + * ReadSession streams. + * @member {Array.} streams + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @instance + */ + ReadSession.prototype.streams = $util.emptyArray; + + /** + * ReadSession estimatedTotalBytesScanned. + * @member {number|Long} estimatedTotalBytesScanned + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @instance + */ + ReadSession.prototype.estimatedTotalBytesScanned = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReadSession schema. + * @member {"avroSchema"|"arrowSchema"|undefined} schema + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @instance + */ + Object.defineProperty(ReadSession.prototype, "schema", { + get: $util.oneOfGetter($oneOfFields = ["avroSchema", "arrowSchema"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReadSession instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @static + * @param {google.cloud.bigquery.storage.v1.IReadSession=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.ReadSession} ReadSession instance + */ + ReadSession.create = function create(properties) { + return new ReadSession(properties); + }; + + /** + * Encodes the specified ReadSession message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @static + * @param {google.cloud.bigquery.storage.v1.IReadSession} message ReadSession message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadSession.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.stream != null && Object.hasOwnProperty.call(message, "stream")) - $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.stream, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.offset); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.dataFormat != null && Object.hasOwnProperty.call(message, "dataFormat")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.dataFormat); + if (message.avroSchema != null && Object.hasOwnProperty.call(message, "avroSchema")) + $root.google.cloud.bigquery.storage.v1.AvroSchema.encode(message.avroSchema, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.arrowSchema != null && Object.hasOwnProperty.call(message, "arrowSchema")) + $root.google.cloud.bigquery.storage.v1.ArrowSchema.encode(message.arrowSchema, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.table); + if (message.tableModifiers != null && Object.hasOwnProperty.call(message, "tableModifiers")) + $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.encode(message.tableModifiers, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.readOptions != null && Object.hasOwnProperty.call(message, "readOptions")) + $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.encode(message.readOptions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.streams != null && message.streams.length) + for (var i = 0; i < message.streams.length; ++i) + $root.google.cloud.bigquery.storage.v1.ReadStream.encode(message.streams[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.estimatedTotalBytesScanned != null && Object.hasOwnProperty.call(message, "estimatedTotalBytesScanned")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.estimatedTotalBytesScanned); return writer; }; /** - * Encodes the specified StreamPosition message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamPosition.verify|verify} messages. + * Encodes the specified ReadSession message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * @memberof google.cloud.bigquery.storage.v1.ReadSession * @static - * @param {google.cloud.bigquery.storage.v1beta1.IStreamPosition} message StreamPosition message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.IReadSession} message ReadSession message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StreamPosition.encodeDelimited = function encodeDelimited(message, writer) { + ReadSession.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a StreamPosition message from the specified reader or buffer. + * Decodes a ReadSession message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * @memberof google.cloud.bigquery.storage.v1.ReadSession * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1beta1.StreamPosition} StreamPosition + * @returns {google.cloud.bigquery.storage.v1.ReadSession} ReadSession * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StreamPosition.decode = function decode(reader, length) { + ReadSession.decode = function decode(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.storage.v1beta1.StreamPosition(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1.ReadSession(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); + message.name = reader.string(); break; case 2: - message.offset = reader.int64(); + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.dataFormat = reader.int32(); + break; + case 4: + message.avroSchema = $root.google.cloud.bigquery.storage.v1.AvroSchema.decode(reader, reader.uint32()); + break; + case 5: + message.arrowSchema = $root.google.cloud.bigquery.storage.v1.ArrowSchema.decode(reader, reader.uint32()); + break; + case 6: + message.table = reader.string(); + break; + case 7: + message.tableModifiers = $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.decode(reader, reader.uint32()); + break; + case 8: + message.readOptions = $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.decode(reader, reader.uint32()); + break; + case 10: + if (!(message.streams && message.streams.length)) + message.streams = []; + message.streams.push($root.google.cloud.bigquery.storage.v1.ReadStream.decode(reader, reader.uint32())); + break; + case 12: + message.estimatedTotalBytesScanned = reader.int64(); break; default: reader.skipType(tag & 7); @@ -5925,575 +7006,733 @@ }; /** - * Decodes a StreamPosition message from the specified reader or buffer, length delimited. + * Decodes a ReadSession message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * @memberof google.cloud.bigquery.storage.v1.ReadSession * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1beta1.StreamPosition} StreamPosition + * @returns {google.cloud.bigquery.storage.v1.ReadSession} ReadSession * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StreamPosition.decodeDelimited = function decodeDelimited(reader) { + ReadSession.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a StreamPosition message. + * Verifies a ReadSession message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * @memberof google.cloud.bigquery.storage.v1.ReadSession * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - StreamPosition.verify = function verify(message) { + ReadSession.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.stream != null && message.hasOwnProperty("stream")) { - var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.stream); + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); if (error) - return "stream." + error; + return "expireTime." + error; } - if (message.offset != null && message.hasOwnProperty("offset")) - if (!$util.isInteger(message.offset) && !(message.offset && $util.isInteger(message.offset.low) && $util.isInteger(message.offset.high))) - return "offset: integer|Long expected"; + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + switch (message.dataFormat) { + default: + return "dataFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.avroSchema != null && message.hasOwnProperty("avroSchema")) { + properties.schema = 1; + { + var error = $root.google.cloud.bigquery.storage.v1.AvroSchema.verify(message.avroSchema); + if (error) + return "avroSchema." + error; + } + } + if (message.arrowSchema != null && message.hasOwnProperty("arrowSchema")) { + if (properties.schema === 1) + return "schema: multiple values"; + properties.schema = 1; + { + var error = $root.google.cloud.bigquery.storage.v1.ArrowSchema.verify(message.arrowSchema); + if (error) + return "arrowSchema." + error; + } + } + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) { + var error = $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.verify(message.tableModifiers); + if (error) + return "tableModifiers." + error; + } + if (message.readOptions != null && message.hasOwnProperty("readOptions")) { + var error = $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.verify(message.readOptions); + if (error) + return "readOptions." + error; + } + if (message.streams != null && message.hasOwnProperty("streams")) { + if (!Array.isArray(message.streams)) + return "streams: array expected"; + for (var i = 0; i < message.streams.length; ++i) { + var error = $root.google.cloud.bigquery.storage.v1.ReadStream.verify(message.streams[i]); + if (error) + return "streams." + error; + } + } + if (message.estimatedTotalBytesScanned != null && message.hasOwnProperty("estimatedTotalBytesScanned")) + if (!$util.isInteger(message.estimatedTotalBytesScanned) && !(message.estimatedTotalBytesScanned && $util.isInteger(message.estimatedTotalBytesScanned.low) && $util.isInteger(message.estimatedTotalBytesScanned.high))) + return "estimatedTotalBytesScanned: integer|Long expected"; return null; }; /** - * Creates a StreamPosition message from a plain object. Also converts values to their respective internal types. + * Creates a ReadSession message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * @memberof google.cloud.bigquery.storage.v1.ReadSession * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.StreamPosition} StreamPosition + * @returns {google.cloud.bigquery.storage.v1.ReadSession} ReadSession */ - StreamPosition.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.StreamPosition) + ReadSession.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.ReadSession) return object; - var message = new $root.google.cloud.bigquery.storage.v1beta1.StreamPosition(); - if (object.stream != null) { - if (typeof object.stream !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1beta1.StreamPosition.stream: object expected"); - message.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.fromObject(object.stream); + var message = new $root.google.cloud.bigquery.storage.v1.ReadSession(); + if (object.name != null) + message.name = String(object.name); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); } - if (object.offset != null) + switch (object.dataFormat) { + case "DATA_FORMAT_UNSPECIFIED": + case 0: + message.dataFormat = 0; + break; + case "AVRO": + case 1: + message.dataFormat = 1; + break; + case "ARROW": + case 2: + message.dataFormat = 2; + break; + } + if (object.avroSchema != null) { + if (typeof object.avroSchema !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.avroSchema: object expected"); + message.avroSchema = $root.google.cloud.bigquery.storage.v1.AvroSchema.fromObject(object.avroSchema); + } + if (object.arrowSchema != null) { + if (typeof object.arrowSchema !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.arrowSchema: object expected"); + message.arrowSchema = $root.google.cloud.bigquery.storage.v1.ArrowSchema.fromObject(object.arrowSchema); + } + if (object.table != null) + message.table = String(object.table); + if (object.tableModifiers != null) { + if (typeof object.tableModifiers !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.tableModifiers: object expected"); + message.tableModifiers = $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.fromObject(object.tableModifiers); + } + if (object.readOptions != null) { + if (typeof object.readOptions !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.readOptions: object expected"); + message.readOptions = $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.fromObject(object.readOptions); + } + if (object.streams) { + if (!Array.isArray(object.streams)) + throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.streams: array expected"); + message.streams = []; + for (var i = 0; i < object.streams.length; ++i) { + if (typeof object.streams[i] !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.streams: object expected"); + message.streams[i] = $root.google.cloud.bigquery.storage.v1.ReadStream.fromObject(object.streams[i]); + } + } + if (object.estimatedTotalBytesScanned != null) if ($util.Long) - (message.offset = $util.Long.fromValue(object.offset)).unsigned = false; - else if (typeof object.offset === "string") - message.offset = parseInt(object.offset, 10); - else if (typeof object.offset === "number") - message.offset = object.offset; - else if (typeof object.offset === "object") - message.offset = new $util.LongBits(object.offset.low >>> 0, object.offset.high >>> 0).toNumber(); + (message.estimatedTotalBytesScanned = $util.Long.fromValue(object.estimatedTotalBytesScanned)).unsigned = false; + else if (typeof object.estimatedTotalBytesScanned === "string") + message.estimatedTotalBytesScanned = parseInt(object.estimatedTotalBytesScanned, 10); + else if (typeof object.estimatedTotalBytesScanned === "number") + message.estimatedTotalBytesScanned = object.estimatedTotalBytesScanned; + else if (typeof object.estimatedTotalBytesScanned === "object") + message.estimatedTotalBytesScanned = new $util.LongBits(object.estimatedTotalBytesScanned.low >>> 0, object.estimatedTotalBytesScanned.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a StreamPosition message. Also converts values to other types if specified. + * Creates a plain object from a ReadSession message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * @memberof google.cloud.bigquery.storage.v1.ReadSession * @static - * @param {google.cloud.bigquery.storage.v1beta1.StreamPosition} message StreamPosition + * @param {google.cloud.bigquery.storage.v1.ReadSession} message ReadSession * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StreamPosition.toObject = function toObject(message, options) { + ReadSession.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.streams = []; if (options.defaults) { - object.stream = null; + object.name = ""; + object.expireTime = null; + object.dataFormat = options.enums === String ? "DATA_FORMAT_UNSPECIFIED" : 0; + object.table = ""; + object.tableModifiers = null; + object.readOptions = null; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.estimatedTotalBytesScanned = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.offset = options.longs === String ? "0" : 0; + object.estimatedTotalBytesScanned = options.longs === String ? "0" : 0; } - if (message.stream != null && message.hasOwnProperty("stream")) - object.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.toObject(message.stream, options); - if (message.offset != null && message.hasOwnProperty("offset")) - if (typeof message.offset === "number") - object.offset = options.longs === String ? String(message.offset) : message.offset; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) + object.dataFormat = options.enums === String ? $root.google.cloud.bigquery.storage.v1.DataFormat[message.dataFormat] : message.dataFormat; + if (message.avroSchema != null && message.hasOwnProperty("avroSchema")) { + object.avroSchema = $root.google.cloud.bigquery.storage.v1.AvroSchema.toObject(message.avroSchema, options); + if (options.oneofs) + object.schema = "avroSchema"; + } + if (message.arrowSchema != null && message.hasOwnProperty("arrowSchema")) { + object.arrowSchema = $root.google.cloud.bigquery.storage.v1.ArrowSchema.toObject(message.arrowSchema, options); + if (options.oneofs) + object.schema = "arrowSchema"; + } + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) + object.tableModifiers = $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.toObject(message.tableModifiers, options); + if (message.readOptions != null && message.hasOwnProperty("readOptions")) + object.readOptions = $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.toObject(message.readOptions, options); + if (message.streams && message.streams.length) { + object.streams = []; + for (var j = 0; j < message.streams.length; ++j) + object.streams[j] = $root.google.cloud.bigquery.storage.v1.ReadStream.toObject(message.streams[j], options); + } + if (message.estimatedTotalBytesScanned != null && message.hasOwnProperty("estimatedTotalBytesScanned")) + if (typeof message.estimatedTotalBytesScanned === "number") + object.estimatedTotalBytesScanned = options.longs === String ? String(message.estimatedTotalBytesScanned) : message.estimatedTotalBytesScanned; else - object.offset = options.longs === String ? $util.Long.prototype.toString.call(message.offset) : options.longs === Number ? new $util.LongBits(message.offset.low >>> 0, message.offset.high >>> 0).toNumber() : message.offset; + object.estimatedTotalBytesScanned = options.longs === String ? $util.Long.prototype.toString.call(message.estimatedTotalBytesScanned) : options.longs === Number ? new $util.LongBits(message.estimatedTotalBytesScanned.low >>> 0, message.estimatedTotalBytesScanned.high >>> 0).toNumber() : message.estimatedTotalBytesScanned; return object; }; /** - * Converts this StreamPosition to JSON. + * Converts this ReadSession to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * @memberof google.cloud.bigquery.storage.v1.ReadSession * @instance * @returns {Object.} JSON object */ - StreamPosition.prototype.toJSON = function toJSON() { + ReadSession.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return StreamPosition; - })(); + ReadSession.TableModifiers = (function() { - v1beta1.ReadSession = (function() { + /** + * Properties of a TableModifiers. + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @interface ITableModifiers + * @property {google.protobuf.ITimestamp|null} [snapshotTime] TableModifiers snapshotTime + */ - /** - * Properties of a ReadSession. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface IReadSession - * @property {string|null} [name] ReadSession name - * @property {google.protobuf.ITimestamp|null} [expireTime] ReadSession expireTime - * @property {google.cloud.bigquery.storage.v1beta1.IAvroSchema|null} [avroSchema] ReadSession avroSchema - * @property {google.cloud.bigquery.storage.v1beta1.IArrowSchema|null} [arrowSchema] ReadSession arrowSchema - * @property {Array.|null} [streams] ReadSession streams - * @property {google.cloud.bigquery.storage.v1beta1.ITableReference|null} [tableReference] ReadSession tableReference - * @property {google.cloud.bigquery.storage.v1beta1.ITableModifiers|null} [tableModifiers] ReadSession tableModifiers - * @property {google.cloud.bigquery.storage.v1beta1.ShardingStrategy|null} [shardingStrategy] ReadSession shardingStrategy - */ + /** + * Constructs a new TableModifiers. + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @classdesc Represents a TableModifiers. + * @implements ITableModifiers + * @constructor + * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers=} [properties] Properties to set + */ + function TableModifiers(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new ReadSession. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a ReadSession. - * @implements IReadSession - * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IReadSession=} [properties] Properties to set - */ - function ReadSession(properties) { - this.streams = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * TableModifiers snapshotTime. + * @member {google.protobuf.ITimestamp|null|undefined} snapshotTime + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @instance + */ + TableModifiers.prototype.snapshotTime = null; - /** - * ReadSession name. - * @member {string} name - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession - * @instance - */ - ReadSession.prototype.name = ""; + /** + * Creates a new TableModifiers instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @static + * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableModifiers} TableModifiers instance + */ + TableModifiers.create = function create(properties) { + return new TableModifiers(properties); + }; - /** - * ReadSession expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession - * @instance - */ - ReadSession.prototype.expireTime = null; + /** + * Encodes the specified TableModifiers message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @static + * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers} message TableModifiers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableModifiers.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshotTime != null && Object.hasOwnProperty.call(message, "snapshotTime")) + $root.google.protobuf.Timestamp.encode(message.snapshotTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; - /** - * ReadSession avroSchema. - * @member {google.cloud.bigquery.storage.v1beta1.IAvroSchema|null|undefined} avroSchema - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession - * @instance - */ - ReadSession.prototype.avroSchema = null; + /** + * Encodes the specified TableModifiers message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @static + * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableModifiers} message TableModifiers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableModifiers.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * ReadSession arrowSchema. - * @member {google.cloud.bigquery.storage.v1beta1.IArrowSchema|null|undefined} arrowSchema - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession - * @instance - */ - ReadSession.prototype.arrowSchema = null; + /** + * Decodes a TableModifiers message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableModifiers} TableModifiers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableModifiers.decode = function decode(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.storage.v1.ReadSession.TableModifiers(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.snapshotTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * ReadSession streams. - * @member {Array.} streams - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession - * @instance - */ - ReadSession.prototype.streams = $util.emptyArray; + /** + * Decodes a TableModifiers message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableModifiers} TableModifiers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableModifiers.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * ReadSession tableReference. - * @member {google.cloud.bigquery.storage.v1beta1.ITableReference|null|undefined} tableReference - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession - * @instance - */ - ReadSession.prototype.tableReference = null; + /** + * Verifies a TableModifiers message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableModifiers.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.snapshotTime); + if (error) + return "snapshotTime." + error; + } + return null; + }; - /** - * ReadSession tableModifiers. - * @member {google.cloud.bigquery.storage.v1beta1.ITableModifiers|null|undefined} tableModifiers - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession - * @instance - */ - ReadSession.prototype.tableModifiers = null; + /** + * Creates a TableModifiers message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableModifiers} TableModifiers + */ + TableModifiers.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers(); + if (object.snapshotTime != null) { + if (typeof object.snapshotTime !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.snapshotTime: object expected"); + message.snapshotTime = $root.google.protobuf.Timestamp.fromObject(object.snapshotTime); + } + return message; + }; - /** - * ReadSession shardingStrategy. - * @member {google.cloud.bigquery.storage.v1beta1.ShardingStrategy} shardingStrategy - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession - * @instance - */ - ReadSession.prototype.shardingStrategy = 0; + /** + * Creates a plain object from a TableModifiers message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @static + * @param {google.cloud.bigquery.storage.v1.ReadSession.TableModifiers} message TableModifiers + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableModifiers.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.snapshotTime = null; + if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) + object.snapshotTime = $root.google.protobuf.Timestamp.toObject(message.snapshotTime, options); + return object; + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Converts this TableModifiers to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @instance + * @returns {Object.} JSON object + */ + TableModifiers.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * ReadSession schema. - * @member {"avroSchema"|"arrowSchema"|undefined} schema - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession - * @instance - */ - Object.defineProperty(ReadSession.prototype, "schema", { - get: $util.oneOfGetter($oneOfFields = ["avroSchema", "arrowSchema"]), - set: $util.oneOfSetter($oneOfFields) - }); + return TableModifiers; + })(); - /** - * Creates a new ReadSession instance using the specified properties. - * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession - * @static - * @param {google.cloud.bigquery.storage.v1beta1.IReadSession=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.ReadSession} ReadSession instance - */ - ReadSession.create = function create(properties) { - return new ReadSession(properties); - }; + ReadSession.TableReadOptions = (function() { - /** - * Encodes the specified ReadSession message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadSession.verify|verify} messages. - * @function encode - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession - * @static - * @param {google.cloud.bigquery.storage.v1beta1.IReadSession} message ReadSession message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadSession.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.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.streams != null && message.streams.length) - for (var i = 0; i < message.streams.length; ++i) - $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.streams[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.avroSchema != null && Object.hasOwnProperty.call(message, "avroSchema")) - $root.google.cloud.bigquery.storage.v1beta1.AvroSchema.encode(message.avroSchema, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.arrowSchema != null && Object.hasOwnProperty.call(message, "arrowSchema")) - $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema.encode(message.arrowSchema, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.tableReference != null && Object.hasOwnProperty.call(message, "tableReference")) - $root.google.cloud.bigquery.storage.v1beta1.TableReference.encode(message.tableReference, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.tableModifiers != null && Object.hasOwnProperty.call(message, "tableModifiers")) - $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.encode(message.tableModifiers, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.shardingStrategy != null && Object.hasOwnProperty.call(message, "shardingStrategy")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.shardingStrategy); - return writer; - }; + /** + * Properties of a TableReadOptions. + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @interface ITableReadOptions + * @property {Array.|null} [selectedFields] TableReadOptions selectedFields + * @property {string|null} [rowRestriction] TableReadOptions rowRestriction + * @property {google.cloud.bigquery.storage.v1.IArrowSerializationOptions|null} [arrowSerializationOptions] TableReadOptions arrowSerializationOptions + */ - /** - * Encodes the specified ReadSession message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadSession.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession - * @static - * @param {google.cloud.bigquery.storage.v1beta1.IReadSession} message ReadSession message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadSession.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Constructs a new TableReadOptions. + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @classdesc Represents a TableReadOptions. + * @implements ITableReadOptions + * @constructor + * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions=} [properties] Properties to set + */ + function TableReadOptions(properties) { + this.selectedFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Decodes a ReadSession message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1beta1.ReadSession} ReadSession - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadSession.decode = function decode(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.storage.v1beta1.ReadSession(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.avroSchema = $root.google.cloud.bigquery.storage.v1beta1.AvroSchema.decode(reader, reader.uint32()); - break; - case 6: - message.arrowSchema = $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.streams && message.streams.length)) - message.streams = []; - message.streams.push($root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32())); - break; - case 7: - message.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.decode(reader, reader.uint32()); - break; - case 8: - message.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.decode(reader, reader.uint32()); - break; - case 9: - message.shardingStrategy = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * TableReadOptions selectedFields. + * @member {Array.} selectedFields + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @instance + */ + TableReadOptions.prototype.selectedFields = $util.emptyArray; - /** - * Decodes a ReadSession message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1beta1.ReadSession} ReadSession - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadSession.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * TableReadOptions rowRestriction. + * @member {string} rowRestriction + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @instance + */ + TableReadOptions.prototype.rowRestriction = ""; - /** - * Verifies a ReadSession message. - * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReadSession.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - if (message.avroSchema != null && message.hasOwnProperty("avroSchema")) { - properties.schema = 1; - { - var error = $root.google.cloud.bigquery.storage.v1beta1.AvroSchema.verify(message.avroSchema); - if (error) - return "avroSchema." + error; + /** + * TableReadOptions arrowSerializationOptions. + * @member {google.cloud.bigquery.storage.v1.IArrowSerializationOptions|null|undefined} arrowSerializationOptions + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @instance + */ + TableReadOptions.prototype.arrowSerializationOptions = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TableReadOptions outputFormatSerializationOptions. + * @member {"arrowSerializationOptions"|undefined} outputFormatSerializationOptions + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @instance + */ + Object.defineProperty(TableReadOptions.prototype, "outputFormatSerializationOptions", { + get: $util.oneOfGetter($oneOfFields = ["arrowSerializationOptions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TableReadOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @static + * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions} TableReadOptions instance + */ + TableReadOptions.create = function create(properties) { + return new TableReadOptions(properties); + }; + + /** + * Encodes the specified TableReadOptions message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @static + * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions} message TableReadOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableReadOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selectedFields != null && message.selectedFields.length) + for (var i = 0; i < message.selectedFields.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectedFields[i]); + if (message.rowRestriction != null && Object.hasOwnProperty.call(message, "rowRestriction")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rowRestriction); + if (message.arrowSerializationOptions != null && Object.hasOwnProperty.call(message, "arrowSerializationOptions")) + $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.encode(message.arrowSerializationOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TableReadOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @static + * @param {google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions} message TableReadOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableReadOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableReadOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions} TableReadOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableReadOptions.decode = function decode(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.storage.v1.ReadSession.TableReadOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.selectedFields && message.selectedFields.length)) + message.selectedFields = []; + message.selectedFields.push(reader.string()); + break; + case 2: + message.rowRestriction = reader.string(); + break; + case 3: + message.arrowSerializationOptions = $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - if (message.arrowSchema != null && message.hasOwnProperty("arrowSchema")) { - if (properties.schema === 1) - return "schema: multiple values"; - properties.schema = 1; - { - var error = $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema.verify(message.arrowSchema); - if (error) - return "arrowSchema." + error; + return message; + }; + + /** + * Decodes a TableReadOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions} TableReadOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableReadOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableReadOptions message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableReadOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selectedFields != null && message.hasOwnProperty("selectedFields")) { + if (!Array.isArray(message.selectedFields)) + return "selectedFields: array expected"; + for (var i = 0; i < message.selectedFields.length; ++i) + if (!$util.isString(message.selectedFields[i])) + return "selectedFields: string[] expected"; } - } - if (message.streams != null && message.hasOwnProperty("streams")) { - if (!Array.isArray(message.streams)) - return "streams: array expected"; - for (var i = 0; i < message.streams.length; ++i) { - var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.streams[i]); - if (error) - return "streams." + error; + if (message.rowRestriction != null && message.hasOwnProperty("rowRestriction")) + if (!$util.isString(message.rowRestriction)) + return "rowRestriction: string expected"; + if (message.arrowSerializationOptions != null && message.hasOwnProperty("arrowSerializationOptions")) { + properties.outputFormatSerializationOptions = 1; + { + var error = $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.verify(message.arrowSerializationOptions); + if (error) + return "arrowSerializationOptions." + error; + } } - } - if (message.tableReference != null && message.hasOwnProperty("tableReference")) { - var error = $root.google.cloud.bigquery.storage.v1beta1.TableReference.verify(message.tableReference); - if (error) - return "tableReference." + error; - } - if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) { - var error = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.verify(message.tableModifiers); - if (error) - return "tableModifiers." + error; - } - if (message.shardingStrategy != null && message.hasOwnProperty("shardingStrategy")) - switch (message.shardingStrategy) { - default: - return "shardingStrategy: enum value expected"; - case 0: - case 1: - case 2: - break; + return null; + }; + + /** + * Creates a TableReadOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions} TableReadOptions + */ + TableReadOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions(); + if (object.selectedFields) { + if (!Array.isArray(object.selectedFields)) + throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.selectedFields: array expected"); + message.selectedFields = []; + for (var i = 0; i < object.selectedFields.length; ++i) + message.selectedFields[i] = String(object.selectedFields[i]); } - return null; - }; + if (object.rowRestriction != null) + message.rowRestriction = String(object.rowRestriction); + if (object.arrowSerializationOptions != null) { + if (typeof object.arrowSerializationOptions !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.arrowSerializationOptions: object expected"); + message.arrowSerializationOptions = $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.fromObject(object.arrowSerializationOptions); + } + return message; + }; - /** - * Creates a ReadSession message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.ReadSession} ReadSession - */ - ReadSession.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.ReadSession) - return object; - var message = new $root.google.cloud.bigquery.storage.v1beta1.ReadSession(); - if (object.name != null) - message.name = String(object.name); - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadSession.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.avroSchema != null) { - if (typeof object.avroSchema !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadSession.avroSchema: object expected"); - message.avroSchema = $root.google.cloud.bigquery.storage.v1beta1.AvroSchema.fromObject(object.avroSchema); - } - if (object.arrowSchema != null) { - if (typeof object.arrowSchema !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadSession.arrowSchema: object expected"); - message.arrowSchema = $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema.fromObject(object.arrowSchema); - } - if (object.streams) { - if (!Array.isArray(object.streams)) - throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadSession.streams: array expected"); - message.streams = []; - for (var i = 0; i < object.streams.length; ++i) { - if (typeof object.streams[i] !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadSession.streams: object expected"); - message.streams[i] = $root.google.cloud.bigquery.storage.v1beta1.Stream.fromObject(object.streams[i]); + /** + * Creates a plain object from a TableReadOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @static + * @param {google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions} message TableReadOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableReadOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.selectedFields = []; + if (options.defaults) + object.rowRestriction = ""; + if (message.selectedFields && message.selectedFields.length) { + object.selectedFields = []; + for (var j = 0; j < message.selectedFields.length; ++j) + object.selectedFields[j] = message.selectedFields[j]; } - } - if (object.tableReference != null) { - if (typeof object.tableReference !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadSession.tableReference: object expected"); - message.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.fromObject(object.tableReference); - } - if (object.tableModifiers != null) { - if (typeof object.tableModifiers !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadSession.tableModifiers: object expected"); - message.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.fromObject(object.tableModifiers); - } - switch (object.shardingStrategy) { - case "SHARDING_STRATEGY_UNSPECIFIED": - case 0: - message.shardingStrategy = 0; - break; - case "LIQUID": - case 1: - message.shardingStrategy = 1; - break; - case "BALANCED": - case 2: - message.shardingStrategy = 2; - break; - } - return message; - }; + if (message.rowRestriction != null && message.hasOwnProperty("rowRestriction")) + object.rowRestriction = message.rowRestriction; + if (message.arrowSerializationOptions != null && message.hasOwnProperty("arrowSerializationOptions")) { + object.arrowSerializationOptions = $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.toObject(message.arrowSerializationOptions, options); + if (options.oneofs) + object.outputFormatSerializationOptions = "arrowSerializationOptions"; + } + return object; + }; - /** - * Creates a plain object from a ReadSession message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession - * @static - * @param {google.cloud.bigquery.storage.v1beta1.ReadSession} message ReadSession - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadSession.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.streams = []; - if (options.defaults) { - object.name = ""; - object.expireTime = null; - object.tableReference = null; - object.tableModifiers = null; - object.shardingStrategy = options.enums === String ? "SHARDING_STRATEGY_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.streams && message.streams.length) { - object.streams = []; - for (var j = 0; j < message.streams.length; ++j) - object.streams[j] = $root.google.cloud.bigquery.storage.v1beta1.Stream.toObject(message.streams[j], options); - } - if (message.avroSchema != null && message.hasOwnProperty("avroSchema")) { - object.avroSchema = $root.google.cloud.bigquery.storage.v1beta1.AvroSchema.toObject(message.avroSchema, options); - if (options.oneofs) - object.schema = "avroSchema"; - } - if (message.arrowSchema != null && message.hasOwnProperty("arrowSchema")) { - object.arrowSchema = $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema.toObject(message.arrowSchema, options); - if (options.oneofs) - object.schema = "arrowSchema"; - } - if (message.tableReference != null && message.hasOwnProperty("tableReference")) - object.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.toObject(message.tableReference, options); - if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) - object.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.toObject(message.tableModifiers, options); - if (message.shardingStrategy != null && message.hasOwnProperty("shardingStrategy")) - object.shardingStrategy = options.enums === String ? $root.google.cloud.bigquery.storage.v1beta1.ShardingStrategy[message.shardingStrategy] : message.shardingStrategy; - return object; - }; + /** + * Converts this TableReadOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @instance + * @returns {Object.} JSON object + */ + TableReadOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this ReadSession to JSON. - * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession - * @instance - * @returns {Object.} JSON object - */ - ReadSession.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return TableReadOptions; + })(); return ReadSession; })(); - v1beta1.CreateReadSessionRequest = (function() { + v1.ReadStream = (function() { /** - * Properties of a CreateReadSessionRequest. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface ICreateReadSessionRequest - * @property {google.cloud.bigquery.storage.v1beta1.ITableReference|null} [tableReference] CreateReadSessionRequest tableReference - * @property {string|null} [parent] CreateReadSessionRequest parent - * @property {google.cloud.bigquery.storage.v1beta1.ITableModifiers|null} [tableModifiers] CreateReadSessionRequest tableModifiers - * @property {number|null} [requestedStreams] CreateReadSessionRequest requestedStreams - * @property {google.cloud.bigquery.storage.v1beta1.ITableReadOptions|null} [readOptions] CreateReadSessionRequest readOptions - * @property {google.cloud.bigquery.storage.v1beta1.DataFormat|null} [format] CreateReadSessionRequest format - * @property {google.cloud.bigquery.storage.v1beta1.ShardingStrategy|null} [shardingStrategy] CreateReadSessionRequest shardingStrategy + * Properties of a ReadStream. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IReadStream + * @property {string|null} [name] ReadStream name */ /** - * Constructs a new CreateReadSessionRequest. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a CreateReadSessionRequest. - * @implements ICreateReadSessionRequest + * Constructs a new ReadStream. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a ReadStream. + * @implements IReadStream * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1.IReadStream=} [properties] Properties to set */ - function CreateReadSessionRequest(properties) { + function ReadStream(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6501,153 +7740,318 @@ } /** - * CreateReadSessionRequest tableReference. - * @member {google.cloud.bigquery.storage.v1beta1.ITableReference|null|undefined} tableReference - * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * ReadStream name. + * @member {string} name + * @memberof google.cloud.bigquery.storage.v1.ReadStream * @instance */ - CreateReadSessionRequest.prototype.tableReference = null; + ReadStream.prototype.name = ""; /** - * CreateReadSessionRequest parent. - * @member {string} parent - * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest - * @instance + * Creates a new ReadStream instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @static + * @param {google.cloud.bigquery.storage.v1.IReadStream=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.ReadStream} ReadStream instance */ - CreateReadSessionRequest.prototype.parent = ""; + ReadStream.create = function create(properties) { + return new ReadStream(properties); + }; /** - * CreateReadSessionRequest tableModifiers. - * @member {google.cloud.bigquery.storage.v1beta1.ITableModifiers|null|undefined} tableModifiers - * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * Encodes the specified ReadStream message. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadStream.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @static + * @param {google.cloud.bigquery.storage.v1.IReadStream} message ReadStream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadStream.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 ReadStream message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.ReadStream.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @static + * @param {google.cloud.bigquery.storage.v1.IReadStream} message ReadStream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadStream.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadStream message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.ReadStream} ReadStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadStream.decode = function decode(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.storage.v1.ReadStream(); + 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 ReadStream message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.ReadStream} ReadStream + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadStream.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadStream message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadStream.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 ReadStream message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.ReadStream} ReadStream + */ + ReadStream.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.ReadStream) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.ReadStream(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a ReadStream message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @static + * @param {google.cloud.bigquery.storage.v1.ReadStream} message ReadStream + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadStream.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 ReadStream to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.ReadStream * @instance + * @returns {Object.} JSON object */ - CreateReadSessionRequest.prototype.tableModifiers = null; + ReadStream.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReadStream; + })(); + + v1.WriteStream = (function() { /** - * CreateReadSessionRequest requestedStreams. - * @member {number} requestedStreams - * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * Properties of a WriteStream. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IWriteStream + * @property {string|null} [name] WriteStream name + * @property {google.cloud.bigquery.storage.v1.WriteStream.Type|null} [type] WriteStream type + * @property {google.protobuf.ITimestamp|null} [createTime] WriteStream createTime + * @property {google.protobuf.ITimestamp|null} [commitTime] WriteStream commitTime + * @property {google.cloud.bigquery.storage.v1.ITableSchema|null} [tableSchema] WriteStream tableSchema + */ + + /** + * Constructs a new WriteStream. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a WriteStream. + * @implements IWriteStream + * @constructor + * @param {google.cloud.bigquery.storage.v1.IWriteStream=} [properties] Properties to set + */ + function WriteStream(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WriteStream name. + * @member {string} name + * @memberof google.cloud.bigquery.storage.v1.WriteStream * @instance */ - CreateReadSessionRequest.prototype.requestedStreams = 0; + WriteStream.prototype.name = ""; /** - * CreateReadSessionRequest readOptions. - * @member {google.cloud.bigquery.storage.v1beta1.ITableReadOptions|null|undefined} readOptions - * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * WriteStream type. + * @member {google.cloud.bigquery.storage.v1.WriteStream.Type} type + * @memberof google.cloud.bigquery.storage.v1.WriteStream * @instance */ - CreateReadSessionRequest.prototype.readOptions = null; + WriteStream.prototype.type = 0; /** - * CreateReadSessionRequest format. - * @member {google.cloud.bigquery.storage.v1beta1.DataFormat} format - * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * WriteStream createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.bigquery.storage.v1.WriteStream * @instance */ - CreateReadSessionRequest.prototype.format = 0; + WriteStream.prototype.createTime = null; /** - * CreateReadSessionRequest shardingStrategy. - * @member {google.cloud.bigquery.storage.v1beta1.ShardingStrategy} shardingStrategy - * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * WriteStream commitTime. + * @member {google.protobuf.ITimestamp|null|undefined} commitTime + * @memberof google.cloud.bigquery.storage.v1.WriteStream * @instance */ - CreateReadSessionRequest.prototype.shardingStrategy = 0; + WriteStream.prototype.commitTime = null; /** - * Creates a new CreateReadSessionRequest instance using the specified properties. + * WriteStream tableSchema. + * @member {google.cloud.bigquery.storage.v1.ITableSchema|null|undefined} tableSchema + * @memberof google.cloud.bigquery.storage.v1.WriteStream + * @instance + */ + WriteStream.prototype.tableSchema = null; + + /** + * Creates a new WriteStream instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @memberof google.cloud.bigquery.storage.v1.WriteStream * @static - * @param {google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest} CreateReadSessionRequest instance + * @param {google.cloud.bigquery.storage.v1.IWriteStream=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.WriteStream} WriteStream instance */ - CreateReadSessionRequest.create = function create(properties) { - return new CreateReadSessionRequest(properties); + WriteStream.create = function create(properties) { + return new WriteStream(properties); }; /** - * Encodes the specified CreateReadSessionRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest.verify|verify} messages. + * Encodes the specified WriteStream message. Does not implicitly {@link google.cloud.bigquery.storage.v1.WriteStream.verify|verify} messages. * @function encode - * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @memberof google.cloud.bigquery.storage.v1.WriteStream * @static - * @param {google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest} message CreateReadSessionRequest message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.IWriteStream} message WriteStream message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateReadSessionRequest.encode = function encode(message, writer) { + WriteStream.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.tableReference != null && Object.hasOwnProperty.call(message, "tableReference")) - $root.google.cloud.bigquery.storage.v1beta1.TableReference.encode(message.tableReference, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.tableModifiers != null && Object.hasOwnProperty.call(message, "tableModifiers")) - $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.encode(message.tableModifiers, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestedStreams != null && Object.hasOwnProperty.call(message, "requestedStreams")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.requestedStreams); - if (message.readOptions != null && Object.hasOwnProperty.call(message, "readOptions")) - $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions.encode(message.readOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.format != null && Object.hasOwnProperty.call(message, "format")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.format); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.parent); - if (message.shardingStrategy != null && Object.hasOwnProperty.call(message, "shardingStrategy")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.shardingStrategy); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.commitTime != null && Object.hasOwnProperty.call(message, "commitTime")) + $root.google.protobuf.Timestamp.encode(message.commitTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.tableSchema != null && Object.hasOwnProperty.call(message, "tableSchema")) + $root.google.cloud.bigquery.storage.v1.TableSchema.encode(message.tableSchema, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateReadSessionRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest.verify|verify} messages. + * Encodes the specified WriteStream message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.WriteStream.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @memberof google.cloud.bigquery.storage.v1.WriteStream * @static - * @param {google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest} message CreateReadSessionRequest message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.IWriteStream} message WriteStream message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateReadSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { + WriteStream.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateReadSessionRequest message from the specified reader or buffer. + * Decodes a WriteStream message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @memberof google.cloud.bigquery.storage.v1.WriteStream * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest} CreateReadSessionRequest + * @returns {google.cloud.bigquery.storage.v1.WriteStream} WriteStream * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateReadSessionRequest.decode = function decode(reader, length) { + WriteStream.decode = function decode(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.storage.v1beta1.CreateReadSessionRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1.WriteStream(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.decode(reader, reader.uint32()); - break; - case 6: - message.parent = reader.string(); + message.name = reader.string(); break; case 2: - message.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.decode(reader, reader.uint32()); + message.type = reader.int32(); break; case 3: - message.requestedStreams = reader.int32(); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 4: - message.readOptions = $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions.decode(reader, reader.uint32()); + message.commitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 5: - message.format = reader.int32(); - break; - case 7: - message.shardingStrategy = reader.int32(); + message.tableSchema = $root.google.cloud.bigquery.storage.v1.TableSchema.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -6658,239 +8062,197 @@ }; /** - * Decodes a CreateReadSessionRequest message from the specified reader or buffer, length delimited. + * Decodes a WriteStream message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @memberof google.cloud.bigquery.storage.v1.WriteStream * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest} CreateReadSessionRequest + * @returns {google.cloud.bigquery.storage.v1.WriteStream} WriteStream * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateReadSessionRequest.decodeDelimited = function decodeDelimited(reader) { + WriteStream.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateReadSessionRequest message. + * Verifies a WriteStream message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @memberof google.cloud.bigquery.storage.v1.WriteStream * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateReadSessionRequest.verify = function verify(message) { + WriteStream.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.tableReference != null && message.hasOwnProperty("tableReference")) { - var error = $root.google.cloud.bigquery.storage.v1beta1.TableReference.verify(message.tableReference); + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); if (error) - return "tableReference." + error; + return "createTime." + error; } - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) { - var error = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.verify(message.tableModifiers); + if (message.commitTime != null && message.hasOwnProperty("commitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.commitTime); if (error) - return "tableModifiers." + error; + return "commitTime." + error; } - if (message.requestedStreams != null && message.hasOwnProperty("requestedStreams")) - if (!$util.isInteger(message.requestedStreams)) - return "requestedStreams: integer expected"; - if (message.readOptions != null && message.hasOwnProperty("readOptions")) { - var error = $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions.verify(message.readOptions); + if (message.tableSchema != null && message.hasOwnProperty("tableSchema")) { + var error = $root.google.cloud.bigquery.storage.v1.TableSchema.verify(message.tableSchema); if (error) - return "readOptions." + error; + return "tableSchema." + error; } - if (message.format != null && message.hasOwnProperty("format")) - switch (message.format) { - default: - return "format: enum value expected"; - case 0: - case 1: - case 3: - break; - } - if (message.shardingStrategy != null && message.hasOwnProperty("shardingStrategy")) - switch (message.shardingStrategy) { - default: - return "shardingStrategy: enum value expected"; - case 0: - case 1: - case 2: - break; - } return null; }; /** - * Creates a CreateReadSessionRequest message from a plain object. Also converts values to their respective internal types. + * Creates a WriteStream message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @memberof google.cloud.bigquery.storage.v1.WriteStream * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest} CreateReadSessionRequest + * @returns {google.cloud.bigquery.storage.v1.WriteStream} WriteStream */ - CreateReadSessionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest) + WriteStream.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.WriteStream) return object; - var message = new $root.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest(); - if (object.tableReference != null) { - if (typeof object.tableReference !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest.tableReference: object expected"); - message.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.fromObject(object.tableReference); - } - if (object.parent != null) - message.parent = String(object.parent); - if (object.tableModifiers != null) { - if (typeof object.tableModifiers !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest.tableModifiers: object expected"); - message.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.fromObject(object.tableModifiers); - } - if (object.requestedStreams != null) - message.requestedStreams = object.requestedStreams | 0; - if (object.readOptions != null) { - if (typeof object.readOptions !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest.readOptions: object expected"); - message.readOptions = $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions.fromObject(object.readOptions); - } - switch (object.format) { - case "DATA_FORMAT_UNSPECIFIED": + var message = new $root.google.cloud.bigquery.storage.v1.WriteStream(); + if (object.name != null) + message.name = String(object.name); + switch (object.type) { + case "TYPE_UNSPECIFIED": case 0: - message.format = 0; + message.type = 0; break; - case "AVRO": + case "COMMITTED": case 1: - message.format = 1; + message.type = 1; break; - case "ARROW": + case "PENDING": + case 2: + message.type = 2; + break; + case "BUFFERED": case 3: - message.format = 3; + message.type = 3; break; } - switch (object.shardingStrategy) { - case "SHARDING_STRATEGY_UNSPECIFIED": - case 0: - message.shardingStrategy = 0; - break; - case "LIQUID": - case 1: - message.shardingStrategy = 1; - break; - case "BALANCED": - case 2: - message.shardingStrategy = 2; - break; + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.WriteStream.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.commitTime != null) { + if (typeof object.commitTime !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.WriteStream.commitTime: object expected"); + message.commitTime = $root.google.protobuf.Timestamp.fromObject(object.commitTime); + } + if (object.tableSchema != null) { + if (typeof object.tableSchema !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.WriteStream.tableSchema: object expected"); + message.tableSchema = $root.google.cloud.bigquery.storage.v1.TableSchema.fromObject(object.tableSchema); } return message; }; /** - * Creates a plain object from a CreateReadSessionRequest message. Also converts values to other types if specified. + * Creates a plain object from a WriteStream message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @memberof google.cloud.bigquery.storage.v1.WriteStream * @static - * @param {google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest} message CreateReadSessionRequest + * @param {google.cloud.bigquery.storage.v1.WriteStream} message WriteStream * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateReadSessionRequest.toObject = function toObject(message, options) { + WriteStream.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.tableReference = null; - object.tableModifiers = null; - object.requestedStreams = 0; - object.readOptions = null; - object.format = options.enums === String ? "DATA_FORMAT_UNSPECIFIED" : 0; - object.parent = ""; - object.shardingStrategy = options.enums === String ? "SHARDING_STRATEGY_UNSPECIFIED" : 0; + object.name = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.createTime = null; + object.commitTime = null; + object.tableSchema = null; } - if (message.tableReference != null && message.hasOwnProperty("tableReference")) - object.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.toObject(message.tableReference, options); - if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) - object.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.toObject(message.tableModifiers, options); - if (message.requestedStreams != null && message.hasOwnProperty("requestedStreams")) - object.requestedStreams = message.requestedStreams; - if (message.readOptions != null && message.hasOwnProperty("readOptions")) - object.readOptions = $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions.toObject(message.readOptions, options); - if (message.format != null && message.hasOwnProperty("format")) - object.format = options.enums === String ? $root.google.cloud.bigquery.storage.v1beta1.DataFormat[message.format] : message.format; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.shardingStrategy != null && message.hasOwnProperty("shardingStrategy")) - object.shardingStrategy = options.enums === String ? $root.google.cloud.bigquery.storage.v1beta1.ShardingStrategy[message.shardingStrategy] : message.shardingStrategy; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.bigquery.storage.v1.WriteStream.Type[message.type] : message.type; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.commitTime != null && message.hasOwnProperty("commitTime")) + object.commitTime = $root.google.protobuf.Timestamp.toObject(message.commitTime, options); + if (message.tableSchema != null && message.hasOwnProperty("tableSchema")) + object.tableSchema = $root.google.cloud.bigquery.storage.v1.TableSchema.toObject(message.tableSchema, options); return object; }; /** - * Converts this CreateReadSessionRequest to JSON. + * Converts this WriteStream to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @memberof google.cloud.bigquery.storage.v1.WriteStream * @instance * @returns {Object.} JSON object */ - CreateReadSessionRequest.prototype.toJSON = function toJSON() { + WriteStream.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateReadSessionRequest; - })(); - - /** - * DataFormat enum. - * @name google.cloud.bigquery.storage.v1beta1.DataFormat - * @enum {number} - * @property {number} DATA_FORMAT_UNSPECIFIED=0 DATA_FORMAT_UNSPECIFIED value - * @property {number} AVRO=1 AVRO value - * @property {number} ARROW=3 ARROW value - */ - v1beta1.DataFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DATA_FORMAT_UNSPECIFIED"] = 0; - values[valuesById[1] = "AVRO"] = 1; - values[valuesById[3] = "ARROW"] = 3; - return values; - })(); + /** + * Type enum. + * @name google.cloud.bigquery.storage.v1.WriteStream.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} COMMITTED=1 COMMITTED value + * @property {number} PENDING=2 PENDING value + * @property {number} BUFFERED=3 BUFFERED value + */ + WriteStream.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COMMITTED"] = 1; + values[valuesById[2] = "PENDING"] = 2; + values[valuesById[3] = "BUFFERED"] = 3; + return values; + })(); - /** - * ShardingStrategy enum. - * @name google.cloud.bigquery.storage.v1beta1.ShardingStrategy - * @enum {number} - * @property {number} SHARDING_STRATEGY_UNSPECIFIED=0 SHARDING_STRATEGY_UNSPECIFIED value - * @property {number} LIQUID=1 LIQUID value - * @property {number} BALANCED=2 BALANCED value - */ - v1beta1.ShardingStrategy = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SHARDING_STRATEGY_UNSPECIFIED"] = 0; - values[valuesById[1] = "LIQUID"] = 1; - values[valuesById[2] = "BALANCED"] = 2; - return values; + return WriteStream; })(); - v1beta1.ReadRowsRequest = (function() { + v1.TableSchema = (function() { /** - * Properties of a ReadRowsRequest. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface IReadRowsRequest - * @property {google.cloud.bigquery.storage.v1beta1.IStreamPosition|null} [readPosition] ReadRowsRequest readPosition + * Properties of a TableSchema. + * @memberof google.cloud.bigquery.storage.v1 + * @interface ITableSchema + * @property {Array.|null} [fields] TableSchema fields */ /** - * Constructs a new ReadRowsRequest. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a ReadRowsRequest. - * @implements IReadRowsRequest + * Constructs a new TableSchema. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a TableSchema. + * @implements ITableSchema * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsRequest=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1.ITableSchema=} [properties] Properties to set */ - function ReadRowsRequest(properties) { + function TableSchema(properties) { + this.fields = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6898,75 +8260,78 @@ } /** - * ReadRowsRequest readPosition. - * @member {google.cloud.bigquery.storage.v1beta1.IStreamPosition|null|undefined} readPosition - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * TableSchema fields. + * @member {Array.} fields + * @memberof google.cloud.bigquery.storage.v1.TableSchema * @instance */ - ReadRowsRequest.prototype.readPosition = null; + TableSchema.prototype.fields = $util.emptyArray; /** - * Creates a new ReadRowsRequest instance using the specified properties. + * Creates a new TableSchema instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @memberof google.cloud.bigquery.storage.v1.TableSchema * @static - * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsRequest=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsRequest} ReadRowsRequest instance + * @param {google.cloud.bigquery.storage.v1.ITableSchema=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.TableSchema} TableSchema instance */ - ReadRowsRequest.create = function create(properties) { - return new ReadRowsRequest(properties); + TableSchema.create = function create(properties) { + return new TableSchema(properties); }; /** - * Encodes the specified ReadRowsRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsRequest.verify|verify} messages. + * Encodes the specified TableSchema message. Does not implicitly {@link google.cloud.bigquery.storage.v1.TableSchema.verify|verify} messages. * @function encode - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @memberof google.cloud.bigquery.storage.v1.TableSchema * @static - * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsRequest} message ReadRowsRequest message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.ITableSchema} message TableSchema message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadRowsRequest.encode = function encode(message, writer) { + TableSchema.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.readPosition != null && Object.hasOwnProperty.call(message, "readPosition")) - $root.google.cloud.bigquery.storage.v1beta1.StreamPosition.encode(message.readPosition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.cloud.bigquery.storage.v1.TableFieldSchema.encode(message.fields[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ReadRowsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsRequest.verify|verify} messages. + * Encodes the specified TableSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.TableSchema.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @memberof google.cloud.bigquery.storage.v1.TableSchema * @static - * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsRequest} message ReadRowsRequest message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.ITableSchema} message TableSchema message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadRowsRequest.encodeDelimited = function encodeDelimited(message, writer) { + TableSchema.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReadRowsRequest message from the specified reader or buffer. + * Decodes a TableSchema message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @memberof google.cloud.bigquery.storage.v1.TableSchema * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsRequest} ReadRowsRequest + * @returns {google.cloud.bigquery.storage.v1.TableSchema} TableSchema * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadRowsRequest.decode = function decode(reader, length) { + TableSchema.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1.TableSchema(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.readPosition = $root.google.cloud.bigquery.storage.v1beta1.StreamPosition.decode(reader, reader.uint32()); + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.cloud.bigquery.storage.v1.TableFieldSchema.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -6977,115 +8342,132 @@ }; /** - * Decodes a ReadRowsRequest message from the specified reader or buffer, length delimited. + * Decodes a TableSchema message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @memberof google.cloud.bigquery.storage.v1.TableSchema * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsRequest} ReadRowsRequest + * @returns {google.cloud.bigquery.storage.v1.TableSchema} TableSchema * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadRowsRequest.decodeDelimited = function decodeDelimited(reader) { + TableSchema.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReadRowsRequest message. + * Verifies a TableSchema message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @memberof google.cloud.bigquery.storage.v1.TableSchema * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReadRowsRequest.verify = function verify(message) { + TableSchema.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.readPosition != null && message.hasOwnProperty("readPosition")) { - var error = $root.google.cloud.bigquery.storage.v1beta1.StreamPosition.verify(message.readPosition); - if (error) - return "readPosition." + error; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.cloud.bigquery.storage.v1.TableFieldSchema.verify(message.fields[i]); + if (error) + return "fields." + error; + } } return null; }; /** - * Creates a ReadRowsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TableSchema message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @memberof google.cloud.bigquery.storage.v1.TableSchema * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsRequest} ReadRowsRequest + * @returns {google.cloud.bigquery.storage.v1.TableSchema} TableSchema */ - ReadRowsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest) + TableSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.TableSchema) return object; - var message = new $root.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest(); - if (object.readPosition != null) { - if (typeof object.readPosition !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadRowsRequest.readPosition: object expected"); - message.readPosition = $root.google.cloud.bigquery.storage.v1beta1.StreamPosition.fromObject(object.readPosition); + var message = new $root.google.cloud.bigquery.storage.v1.TableSchema(); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.cloud.bigquery.storage.v1.TableSchema.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.TableSchema.fields: object expected"); + message.fields[i] = $root.google.cloud.bigquery.storage.v1.TableFieldSchema.fromObject(object.fields[i]); + } } return message; }; /** - * Creates a plain object from a ReadRowsRequest message. Also converts values to other types if specified. + * Creates a plain object from a TableSchema message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @memberof google.cloud.bigquery.storage.v1.TableSchema * @static - * @param {google.cloud.bigquery.storage.v1beta1.ReadRowsRequest} message ReadRowsRequest + * @param {google.cloud.bigquery.storage.v1.TableSchema} message TableSchema * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadRowsRequest.toObject = function toObject(message, options) { + TableSchema.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.readPosition = null; - if (message.readPosition != null && message.hasOwnProperty("readPosition")) - object.readPosition = $root.google.cloud.bigquery.storage.v1beta1.StreamPosition.toObject(message.readPosition, options); + if (options.arrays || options.defaults) + object.fields = []; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.cloud.bigquery.storage.v1.TableFieldSchema.toObject(message.fields[j], options); + } return object; }; /** - * Converts this ReadRowsRequest to JSON. + * Converts this TableSchema to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @memberof google.cloud.bigquery.storage.v1.TableSchema * @instance * @returns {Object.} JSON object */ - ReadRowsRequest.prototype.toJSON = function toJSON() { + TableSchema.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ReadRowsRequest; + return TableSchema; })(); - v1beta1.StreamStatus = (function() { + v1.TableFieldSchema = (function() { /** - * Properties of a StreamStatus. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface IStreamStatus - * @property {number|Long|null} [estimatedRowCount] StreamStatus estimatedRowCount - * @property {number|null} [fractionConsumed] StreamStatus fractionConsumed - * @property {google.cloud.bigquery.storage.v1beta1.IProgress|null} [progress] StreamStatus progress - * @property {boolean|null} [isSplittable] StreamStatus isSplittable + * Properties of a TableFieldSchema. + * @memberof google.cloud.bigquery.storage.v1 + * @interface ITableFieldSchema + * @property {string|null} [name] TableFieldSchema name + * @property {google.cloud.bigquery.storage.v1.TableFieldSchema.Type|null} [type] TableFieldSchema type + * @property {google.cloud.bigquery.storage.v1.TableFieldSchema.Mode|null} [mode] TableFieldSchema mode + * @property {Array.|null} [fields] TableFieldSchema fields + * @property {string|null} [description] TableFieldSchema description + * @property {number|Long|null} [maxLength] TableFieldSchema maxLength + * @property {number|Long|null} [precision] TableFieldSchema precision + * @property {number|Long|null} [scale] TableFieldSchema scale */ /** - * Constructs a new StreamStatus. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a StreamStatus. - * @implements IStreamStatus + * Constructs a new TableFieldSchema. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a TableFieldSchema. + * @implements ITableFieldSchema * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IStreamStatus=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1.ITableFieldSchema=} [properties] Properties to set */ - function StreamStatus(properties) { + function TableFieldSchema(properties) { + this.fields = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7093,114 +8475,169 @@ } /** - * StreamStatus estimatedRowCount. - * @member {number|Long} estimatedRowCount - * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * TableFieldSchema name. + * @member {string} name + * @memberof google.cloud.bigquery.storage.v1.TableFieldSchema * @instance */ - StreamStatus.prototype.estimatedRowCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + TableFieldSchema.prototype.name = ""; /** - * StreamStatus fractionConsumed. - * @member {number} fractionConsumed - * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * TableFieldSchema type. + * @member {google.cloud.bigquery.storage.v1.TableFieldSchema.Type} type + * @memberof google.cloud.bigquery.storage.v1.TableFieldSchema * @instance */ - StreamStatus.prototype.fractionConsumed = 0; + TableFieldSchema.prototype.type = 0; /** - * StreamStatus progress. - * @member {google.cloud.bigquery.storage.v1beta1.IProgress|null|undefined} progress - * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * TableFieldSchema mode. + * @member {google.cloud.bigquery.storage.v1.TableFieldSchema.Mode} mode + * @memberof google.cloud.bigquery.storage.v1.TableFieldSchema * @instance */ - StreamStatus.prototype.progress = null; + TableFieldSchema.prototype.mode = 0; /** - * StreamStatus isSplittable. - * @member {boolean} isSplittable - * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * TableFieldSchema fields. + * @member {Array.} fields + * @memberof google.cloud.bigquery.storage.v1.TableFieldSchema * @instance */ - StreamStatus.prototype.isSplittable = false; + TableFieldSchema.prototype.fields = $util.emptyArray; /** - * Creates a new StreamStatus instance using the specified properties. - * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * TableFieldSchema description. + * @member {string} description + * @memberof google.cloud.bigquery.storage.v1.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.description = ""; + + /** + * TableFieldSchema maxLength. + * @member {number|Long} maxLength + * @memberof google.cloud.bigquery.storage.v1.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.maxLength = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TableFieldSchema precision. + * @member {number|Long} precision + * @memberof google.cloud.bigquery.storage.v1.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.precision = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TableFieldSchema scale. + * @member {number|Long} scale + * @memberof google.cloud.bigquery.storage.v1.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.scale = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TableFieldSchema instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.TableFieldSchema * @static - * @param {google.cloud.bigquery.storage.v1beta1.IStreamStatus=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.StreamStatus} StreamStatus instance + * @param {google.cloud.bigquery.storage.v1.ITableFieldSchema=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.TableFieldSchema} TableFieldSchema instance */ - StreamStatus.create = function create(properties) { - return new StreamStatus(properties); + TableFieldSchema.create = function create(properties) { + return new TableFieldSchema(properties); }; /** - * Encodes the specified StreamStatus message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamStatus.verify|verify} messages. + * Encodes the specified TableFieldSchema message. Does not implicitly {@link google.cloud.bigquery.storage.v1.TableFieldSchema.verify|verify} messages. * @function encode - * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @memberof google.cloud.bigquery.storage.v1.TableFieldSchema * @static - * @param {google.cloud.bigquery.storage.v1beta1.IStreamStatus} message StreamStatus message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.ITableFieldSchema} message TableFieldSchema message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StreamStatus.encode = function encode(message, writer) { + TableFieldSchema.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.estimatedRowCount != null && Object.hasOwnProperty.call(message, "estimatedRowCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.estimatedRowCount); - if (message.fractionConsumed != null && Object.hasOwnProperty.call(message, "fractionConsumed")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.fractionConsumed); - if (message.isSplittable != null && Object.hasOwnProperty.call(message, "isSplittable")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isSplittable); - if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.cloud.bigquery.storage.v1beta1.Progress.encode(message.progress, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.mode); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.cloud.bigquery.storage.v1.TableFieldSchema.encode(message.fields[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.maxLength != null && Object.hasOwnProperty.call(message, "maxLength")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.maxLength); + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.precision); + if (message.scale != null && Object.hasOwnProperty.call(message, "scale")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.scale); return writer; }; /** - * Encodes the specified StreamStatus message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamStatus.verify|verify} messages. + * Encodes the specified TableFieldSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.TableFieldSchema.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @memberof google.cloud.bigquery.storage.v1.TableFieldSchema * @static - * @param {google.cloud.bigquery.storage.v1beta1.IStreamStatus} message StreamStatus message or plain object to encode + * @param {google.cloud.bigquery.storage.v1.ITableFieldSchema} message TableFieldSchema message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StreamStatus.encodeDelimited = function encodeDelimited(message, writer) { + TableFieldSchema.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a StreamStatus message from the specified reader or buffer. + * Decodes a TableFieldSchema message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @memberof google.cloud.bigquery.storage.v1.TableFieldSchema * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1beta1.StreamStatus} StreamStatus + * @returns {google.cloud.bigquery.storage.v1.TableFieldSchema} TableFieldSchema * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StreamStatus.decode = function decode(reader, length) { + TableFieldSchema.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1beta1.StreamStatus(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1.TableFieldSchema(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.estimatedRowCount = reader.int64(); + message.name = reader.string(); break; case 2: - message.fractionConsumed = reader.float(); + message.type = reader.int32(); + break; + case 3: + message.mode = reader.int32(); break; case 4: - message.progress = $root.google.cloud.bigquery.storage.v1beta1.Progress.decode(reader, reader.uint32()); + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.cloud.bigquery.storage.v1.TableFieldSchema.decode(reader, reader.uint32())); break; - case 3: - message.isSplittable = reader.bool(); + case 6: + message.description = reader.string(); + break; + case 7: + message.maxLength = reader.int64(); + break; + case 8: + message.precision = reader.int64(); + break; + case 9: + message.scale = reader.int64(); break; default: reader.skipType(tag & 7); @@ -7211,152 +8648,402 @@ }; /** - * Decodes a StreamStatus message from the specified reader or buffer, length delimited. + * Decodes a TableFieldSchema message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @memberof google.cloud.bigquery.storage.v1.TableFieldSchema * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1beta1.StreamStatus} StreamStatus + * @returns {google.cloud.bigquery.storage.v1.TableFieldSchema} TableFieldSchema * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StreamStatus.decodeDelimited = function decodeDelimited(reader) { + TableFieldSchema.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a StreamStatus message. + * Verifies a TableFieldSchema message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @memberof google.cloud.bigquery.storage.v1.TableFieldSchema * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - StreamStatus.verify = function verify(message) { + TableFieldSchema.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.estimatedRowCount != null && message.hasOwnProperty("estimatedRowCount")) - if (!$util.isInteger(message.estimatedRowCount) && !(message.estimatedRowCount && $util.isInteger(message.estimatedRowCount.low) && $util.isInteger(message.estimatedRowCount.high))) - return "estimatedRowCount: integer|Long expected"; - if (message.fractionConsumed != null && message.hasOwnProperty("fractionConsumed")) - if (typeof message.fractionConsumed !== "number") - return "fractionConsumed: number expected"; - if (message.progress != null && message.hasOwnProperty("progress")) { - var error = $root.google.cloud.bigquery.storage.v1beta1.Progress.verify(message.progress); - if (error) - return "progress." + error; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + break; + } + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.cloud.bigquery.storage.v1.TableFieldSchema.verify(message.fields[i]); + if (error) + return "fields." + error; + } } - if (message.isSplittable != null && message.hasOwnProperty("isSplittable")) - if (typeof message.isSplittable !== "boolean") - return "isSplittable: boolean expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.maxLength != null && message.hasOwnProperty("maxLength")) + if (!$util.isInteger(message.maxLength) && !(message.maxLength && $util.isInteger(message.maxLength.low) && $util.isInteger(message.maxLength.high))) + return "maxLength: integer|Long expected"; + if (message.precision != null && message.hasOwnProperty("precision")) + if (!$util.isInteger(message.precision) && !(message.precision && $util.isInteger(message.precision.low) && $util.isInteger(message.precision.high))) + return "precision: integer|Long expected"; + if (message.scale != null && message.hasOwnProperty("scale")) + if (!$util.isInteger(message.scale) && !(message.scale && $util.isInteger(message.scale.low) && $util.isInteger(message.scale.high))) + return "scale: integer|Long expected"; return null; }; /** - * Creates a StreamStatus message from a plain object. Also converts values to their respective internal types. + * Creates a TableFieldSchema message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @memberof google.cloud.bigquery.storage.v1.TableFieldSchema * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.StreamStatus} StreamStatus + * @returns {google.cloud.bigquery.storage.v1.TableFieldSchema} TableFieldSchema */ - StreamStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.StreamStatus) + TableFieldSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.TableFieldSchema) return object; - var message = new $root.google.cloud.bigquery.storage.v1beta1.StreamStatus(); - if (object.estimatedRowCount != null) - if ($util.Long) - (message.estimatedRowCount = $util.Long.fromValue(object.estimatedRowCount)).unsigned = false; - else if (typeof object.estimatedRowCount === "string") - message.estimatedRowCount = parseInt(object.estimatedRowCount, 10); - else if (typeof object.estimatedRowCount === "number") - message.estimatedRowCount = object.estimatedRowCount; - else if (typeof object.estimatedRowCount === "object") - message.estimatedRowCount = new $util.LongBits(object.estimatedRowCount.low >>> 0, object.estimatedRowCount.high >>> 0).toNumber(); - if (object.fractionConsumed != null) - message.fractionConsumed = Number(object.fractionConsumed); - if (object.progress != null) { - if (typeof object.progress !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1beta1.StreamStatus.progress: object expected"); - message.progress = $root.google.cloud.bigquery.storage.v1beta1.Progress.fromObject(object.progress); + var message = new $root.google.cloud.bigquery.storage.v1.TableFieldSchema(); + if (object.name != null) + message.name = String(object.name); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "STRING": + case 1: + message.type = 1; + break; + case "INT64": + case 2: + message.type = 2; + break; + case "DOUBLE": + case 3: + message.type = 3; + break; + case "STRUCT": + case 4: + message.type = 4; + break; + case "BYTES": + case 5: + message.type = 5; + break; + case "BOOL": + case 6: + message.type = 6; + break; + case "TIMESTAMP": + case 7: + message.type = 7; + break; + case "DATE": + case 8: + message.type = 8; + break; + case "TIME": + case 9: + message.type = 9; + break; + case "DATETIME": + case 10: + message.type = 10; + break; + case "GEOGRAPHY": + case 11: + message.type = 11; + break; + case "NUMERIC": + case 12: + message.type = 12; + break; + case "BIGNUMERIC": + case 13: + message.type = 13; + break; + case "INTERVAL": + case 14: + message.type = 14; + break; + case "JSON": + case 15: + message.type = 15; + break; } - if (object.isSplittable != null) - message.isSplittable = Boolean(object.isSplittable); + switch (object.mode) { + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "NULLABLE": + case 1: + message.mode = 1; + break; + case "REQUIRED": + case 2: + message.mode = 2; + break; + case "REPEATED": + case 3: + message.mode = 3; + break; + } + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.cloud.bigquery.storage.v1.TableFieldSchema.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.TableFieldSchema.fields: object expected"); + message.fields[i] = $root.google.cloud.bigquery.storage.v1.TableFieldSchema.fromObject(object.fields[i]); + } + } + if (object.description != null) + message.description = String(object.description); + if (object.maxLength != null) + if ($util.Long) + (message.maxLength = $util.Long.fromValue(object.maxLength)).unsigned = false; + else if (typeof object.maxLength === "string") + message.maxLength = parseInt(object.maxLength, 10); + else if (typeof object.maxLength === "number") + message.maxLength = object.maxLength; + else if (typeof object.maxLength === "object") + message.maxLength = new $util.LongBits(object.maxLength.low >>> 0, object.maxLength.high >>> 0).toNumber(); + if (object.precision != null) + if ($util.Long) + (message.precision = $util.Long.fromValue(object.precision)).unsigned = false; + else if (typeof object.precision === "string") + message.precision = parseInt(object.precision, 10); + else if (typeof object.precision === "number") + message.precision = object.precision; + else if (typeof object.precision === "object") + message.precision = new $util.LongBits(object.precision.low >>> 0, object.precision.high >>> 0).toNumber(); + if (object.scale != null) + if ($util.Long) + (message.scale = $util.Long.fromValue(object.scale)).unsigned = false; + else if (typeof object.scale === "string") + message.scale = parseInt(object.scale, 10); + else if (typeof object.scale === "number") + message.scale = object.scale; + else if (typeof object.scale === "object") + message.scale = new $util.LongBits(object.scale.low >>> 0, object.scale.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a StreamStatus message. Also converts values to other types if specified. + * Creates a plain object from a TableFieldSchema message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @memberof google.cloud.bigquery.storage.v1.TableFieldSchema * @static - * @param {google.cloud.bigquery.storage.v1beta1.StreamStatus} message StreamStatus + * @param {google.cloud.bigquery.storage.v1.TableFieldSchema} message TableFieldSchema * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StreamStatus.toObject = function toObject(message, options) { + TableFieldSchema.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.fields = []; if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + object.description = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.estimatedRowCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.maxLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.estimatedRowCount = options.longs === String ? "0" : 0; - object.fractionConsumed = 0; - object.isSplittable = false; - object.progress = null; + object.maxLength = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.precision = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.precision = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.scale = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.scale = options.longs === String ? "0" : 0; } - if (message.estimatedRowCount != null && message.hasOwnProperty("estimatedRowCount")) - if (typeof message.estimatedRowCount === "number") - object.estimatedRowCount = options.longs === String ? String(message.estimatedRowCount) : message.estimatedRowCount; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.bigquery.storage.v1.TableFieldSchema.Type[message.type] : message.type; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.cloud.bigquery.storage.v1.TableFieldSchema.Mode[message.mode] : message.mode; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.cloud.bigquery.storage.v1.TableFieldSchema.toObject(message.fields[j], options); + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.maxLength != null && message.hasOwnProperty("maxLength")) + if (typeof message.maxLength === "number") + object.maxLength = options.longs === String ? String(message.maxLength) : message.maxLength; else - object.estimatedRowCount = options.longs === String ? $util.Long.prototype.toString.call(message.estimatedRowCount) : options.longs === Number ? new $util.LongBits(message.estimatedRowCount.low >>> 0, message.estimatedRowCount.high >>> 0).toNumber() : message.estimatedRowCount; - if (message.fractionConsumed != null && message.hasOwnProperty("fractionConsumed")) - object.fractionConsumed = options.json && !isFinite(message.fractionConsumed) ? String(message.fractionConsumed) : message.fractionConsumed; - if (message.isSplittable != null && message.hasOwnProperty("isSplittable")) - object.isSplittable = message.isSplittable; - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.cloud.bigquery.storage.v1beta1.Progress.toObject(message.progress, options); + object.maxLength = options.longs === String ? $util.Long.prototype.toString.call(message.maxLength) : options.longs === Number ? new $util.LongBits(message.maxLength.low >>> 0, message.maxLength.high >>> 0).toNumber() : message.maxLength; + if (message.precision != null && message.hasOwnProperty("precision")) + if (typeof message.precision === "number") + object.precision = options.longs === String ? String(message.precision) : message.precision; + else + object.precision = options.longs === String ? $util.Long.prototype.toString.call(message.precision) : options.longs === Number ? new $util.LongBits(message.precision.low >>> 0, message.precision.high >>> 0).toNumber() : message.precision; + if (message.scale != null && message.hasOwnProperty("scale")) + if (typeof message.scale === "number") + object.scale = options.longs === String ? String(message.scale) : message.scale; + else + object.scale = options.longs === String ? $util.Long.prototype.toString.call(message.scale) : options.longs === Number ? new $util.LongBits(message.scale.low >>> 0, message.scale.high >>> 0).toNumber() : message.scale; return object; }; /** - * Converts this StreamStatus to JSON. + * Converts this TableFieldSchema to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @memberof google.cloud.bigquery.storage.v1.TableFieldSchema * @instance * @returns {Object.} JSON object */ - StreamStatus.prototype.toJSON = function toJSON() { + TableFieldSchema.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return StreamStatus; + /** + * Type enum. + * @name google.cloud.bigquery.storage.v1.TableFieldSchema.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} STRING=1 STRING value + * @property {number} INT64=2 INT64 value + * @property {number} DOUBLE=3 DOUBLE value + * @property {number} STRUCT=4 STRUCT value + * @property {number} BYTES=5 BYTES value + * @property {number} BOOL=6 BOOL value + * @property {number} TIMESTAMP=7 TIMESTAMP value + * @property {number} DATE=8 DATE value + * @property {number} TIME=9 TIME value + * @property {number} DATETIME=10 DATETIME value + * @property {number} GEOGRAPHY=11 GEOGRAPHY value + * @property {number} NUMERIC=12 NUMERIC value + * @property {number} BIGNUMERIC=13 BIGNUMERIC value + * @property {number} INTERVAL=14 INTERVAL value + * @property {number} JSON=15 JSON value + */ + TableFieldSchema.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRING"] = 1; + values[valuesById[2] = "INT64"] = 2; + values[valuesById[3] = "DOUBLE"] = 3; + values[valuesById[4] = "STRUCT"] = 4; + values[valuesById[5] = "BYTES"] = 5; + values[valuesById[6] = "BOOL"] = 6; + values[valuesById[7] = "TIMESTAMP"] = 7; + values[valuesById[8] = "DATE"] = 8; + values[valuesById[9] = "TIME"] = 9; + values[valuesById[10] = "DATETIME"] = 10; + values[valuesById[11] = "GEOGRAPHY"] = 11; + values[valuesById[12] = "NUMERIC"] = 12; + values[valuesById[13] = "BIGNUMERIC"] = 13; + values[valuesById[14] = "INTERVAL"] = 14; + values[valuesById[15] = "JSON"] = 15; + return values; + })(); + + /** + * Mode enum. + * @name google.cloud.bigquery.storage.v1.TableFieldSchema.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} NULLABLE=1 NULLABLE value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} REPEATED=3 REPEATED value + */ + TableFieldSchema.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NULLABLE"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "REPEATED"] = 3; + return values; + })(); + + return TableFieldSchema; })(); - v1beta1.Progress = (function() { + return v1; + })(); + + storage.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.bigquery.storage + * @namespace + */ + var v1beta1 = {}; + + v1beta1.ArrowSchema = (function() { /** - * Properties of a Progress. + * Properties of an ArrowSchema. * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface IProgress - * @property {number|null} [atResponseStart] Progress atResponseStart - * @property {number|null} [atResponseEnd] Progress atResponseEnd + * @interface IArrowSchema + * @property {Uint8Array|null} [serializedSchema] ArrowSchema serializedSchema */ /** - * Constructs a new Progress. + * Constructs a new ArrowSchema. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a Progress. - * @implements IProgress + * @classdesc Represents an ArrowSchema. + * @implements IArrowSchema * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IProgress=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.IArrowSchema=} [properties] Properties to set */ - function Progress(properties) { + function ArrowSchema(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7364,88 +9051,75 @@ } /** - * Progress atResponseStart. - * @member {number} atResponseStart - * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * ArrowSchema serializedSchema. + * @member {Uint8Array} serializedSchema + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema * @instance */ - Progress.prototype.atResponseStart = 0; + ArrowSchema.prototype.serializedSchema = $util.newBuffer([]); /** - * Progress atResponseEnd. - * @member {number} atResponseEnd - * @memberof google.cloud.bigquery.storage.v1beta1.Progress - * @instance - */ - Progress.prototype.atResponseEnd = 0; - - /** - * Creates a new Progress instance using the specified properties. + * Creates a new ArrowSchema instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema * @static - * @param {google.cloud.bigquery.storage.v1beta1.IProgress=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.Progress} Progress instance + * @param {google.cloud.bigquery.storage.v1beta1.IArrowSchema=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.ArrowSchema} ArrowSchema instance */ - Progress.create = function create(properties) { - return new Progress(properties); + ArrowSchema.create = function create(properties) { + return new ArrowSchema(properties); }; /** - * Encodes the specified Progress message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Progress.verify|verify} messages. + * Encodes the specified ArrowSchema message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowSchema.verify|verify} messages. * @function encode - * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema * @static - * @param {google.cloud.bigquery.storage.v1beta1.IProgress} message Progress message or plain object to encode + * @param {google.cloud.bigquery.storage.v1beta1.IArrowSchema} message ArrowSchema message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Progress.encode = function encode(message, writer) { + ArrowSchema.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.atResponseStart != null && Object.hasOwnProperty.call(message, "atResponseStart")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.atResponseStart); - if (message.atResponseEnd != null && Object.hasOwnProperty.call(message, "atResponseEnd")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.atResponseEnd); + if (message.serializedSchema != null && Object.hasOwnProperty.call(message, "serializedSchema")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.serializedSchema); return writer; }; /** - * Encodes the specified Progress message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Progress.verify|verify} messages. + * Encodes the specified ArrowSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowSchema.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema * @static - * @param {google.cloud.bigquery.storage.v1beta1.IProgress} message Progress message or plain object to encode + * @param {google.cloud.bigquery.storage.v1beta1.IArrowSchema} message ArrowSchema message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Progress.encodeDelimited = function encodeDelimited(message, writer) { + ArrowSchema.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Progress message from the specified reader or buffer. + * Decodes an ArrowSchema message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1beta1.Progress} Progress + * @returns {google.cloud.bigquery.storage.v1beta1.ArrowSchema} ArrowSchema * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Progress.decode = function decode(reader, length) { + ArrowSchema.decode = function decode(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.storage.v1beta1.Progress(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.atResponseStart = reader.float(); - break; - case 2: - message.atResponseEnd = reader.float(); + message.serializedSchema = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -7456,116 +9130,117 @@ }; /** - * Decodes a Progress message from the specified reader or buffer, length delimited. + * Decodes an ArrowSchema message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1beta1.Progress} Progress + * @returns {google.cloud.bigquery.storage.v1beta1.ArrowSchema} ArrowSchema * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Progress.decodeDelimited = function decodeDelimited(reader) { + ArrowSchema.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Progress message. + * Verifies an ArrowSchema message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Progress.verify = function verify(message) { + ArrowSchema.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.atResponseStart != null && message.hasOwnProperty("atResponseStart")) - if (typeof message.atResponseStart !== "number") - return "atResponseStart: number expected"; - if (message.atResponseEnd != null && message.hasOwnProperty("atResponseEnd")) - if (typeof message.atResponseEnd !== "number") - return "atResponseEnd: number expected"; + if (message.serializedSchema != null && message.hasOwnProperty("serializedSchema")) + if (!(message.serializedSchema && typeof message.serializedSchema.length === "number" || $util.isString(message.serializedSchema))) + return "serializedSchema: buffer expected"; return null; }; /** - * Creates a Progress message from a plain object. Also converts values to their respective internal types. + * Creates an ArrowSchema message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.Progress} Progress + * @returns {google.cloud.bigquery.storage.v1beta1.ArrowSchema} ArrowSchema */ - Progress.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.Progress) + ArrowSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema) return object; - var message = new $root.google.cloud.bigquery.storage.v1beta1.Progress(); - if (object.atResponseStart != null) - message.atResponseStart = Number(object.atResponseStart); - if (object.atResponseEnd != null) - message.atResponseEnd = Number(object.atResponseEnd); + var message = new $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema(); + if (object.serializedSchema != null) + if (typeof object.serializedSchema === "string") + $util.base64.decode(object.serializedSchema, message.serializedSchema = $util.newBuffer($util.base64.length(object.serializedSchema)), 0); + else if (object.serializedSchema.length) + message.serializedSchema = object.serializedSchema; return message; }; /** - * Creates a plain object from a Progress message. Also converts values to other types if specified. + * Creates a plain object from an ArrowSchema message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema * @static - * @param {google.cloud.bigquery.storage.v1beta1.Progress} message Progress + * @param {google.cloud.bigquery.storage.v1beta1.ArrowSchema} message ArrowSchema * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Progress.toObject = function toObject(message, options) { + ArrowSchema.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.atResponseStart = 0; - object.atResponseEnd = 0; - } - if (message.atResponseStart != null && message.hasOwnProperty("atResponseStart")) - object.atResponseStart = options.json && !isFinite(message.atResponseStart) ? String(message.atResponseStart) : message.atResponseStart; - if (message.atResponseEnd != null && message.hasOwnProperty("atResponseEnd")) - object.atResponseEnd = options.json && !isFinite(message.atResponseEnd) ? String(message.atResponseEnd) : message.atResponseEnd; + if (options.defaults) + if (options.bytes === String) + object.serializedSchema = ""; + else { + object.serializedSchema = []; + if (options.bytes !== Array) + object.serializedSchema = $util.newBuffer(object.serializedSchema); + } + if (message.serializedSchema != null && message.hasOwnProperty("serializedSchema")) + object.serializedSchema = options.bytes === String ? $util.base64.encode(message.serializedSchema, 0, message.serializedSchema.length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedSchema) : message.serializedSchema; return object; }; /** - * Converts this Progress to JSON. + * Converts this ArrowSchema to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema * @instance * @returns {Object.} JSON object */ - Progress.prototype.toJSON = function toJSON() { + ArrowSchema.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Progress; + return ArrowSchema; })(); - v1beta1.ThrottleStatus = (function() { + v1beta1.ArrowRecordBatch = (function() { /** - * Properties of a ThrottleStatus. + * Properties of an ArrowRecordBatch. * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface IThrottleStatus - * @property {number|null} [throttlePercent] ThrottleStatus throttlePercent + * @interface IArrowRecordBatch + * @property {Uint8Array|null} [serializedRecordBatch] ArrowRecordBatch serializedRecordBatch + * @property {number|Long|null} [rowCount] ArrowRecordBatch rowCount */ /** - * Constructs a new ThrottleStatus. + * Constructs a new ArrowRecordBatch. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a ThrottleStatus. - * @implements IThrottleStatus + * @classdesc Represents an ArrowRecordBatch. + * @implements IArrowRecordBatch * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IThrottleStatus=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch=} [properties] Properties to set */ - function ThrottleStatus(properties) { + function ArrowRecordBatch(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7573,75 +9248,88 @@ } /** - * ThrottleStatus throttlePercent. - * @member {number} throttlePercent - * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * ArrowRecordBatch serializedRecordBatch. + * @member {Uint8Array} serializedRecordBatch + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch * @instance */ - ThrottleStatus.prototype.throttlePercent = 0; + ArrowRecordBatch.prototype.serializedRecordBatch = $util.newBuffer([]); /** - * Creates a new ThrottleStatus instance using the specified properties. + * ArrowRecordBatch rowCount. + * @member {number|Long} rowCount + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * @instance + */ + ArrowRecordBatch.prototype.rowCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ArrowRecordBatch instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch * @static - * @param {google.cloud.bigquery.storage.v1beta1.IThrottleStatus=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.ThrottleStatus} ThrottleStatus instance + * @param {google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch} ArrowRecordBatch instance */ - ThrottleStatus.create = function create(properties) { - return new ThrottleStatus(properties); + ArrowRecordBatch.create = function create(properties) { + return new ArrowRecordBatch(properties); }; /** - * Encodes the specified ThrottleStatus message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ThrottleStatus.verify|verify} messages. + * Encodes the specified ArrowRecordBatch message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.verify|verify} messages. * @function encode - * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch * @static - * @param {google.cloud.bigquery.storage.v1beta1.IThrottleStatus} message ThrottleStatus message or plain object to encode + * @param {google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch} message ArrowRecordBatch message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ThrottleStatus.encode = function encode(message, writer) { + ArrowRecordBatch.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.throttlePercent != null && Object.hasOwnProperty.call(message, "throttlePercent")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.throttlePercent); + if (message.serializedRecordBatch != null && Object.hasOwnProperty.call(message, "serializedRecordBatch")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.serializedRecordBatch); + if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.rowCount); return writer; }; /** - * Encodes the specified ThrottleStatus message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ThrottleStatus.verify|verify} messages. + * Encodes the specified ArrowRecordBatch message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch * @static - * @param {google.cloud.bigquery.storage.v1beta1.IThrottleStatus} message ThrottleStatus message or plain object to encode + * @param {google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch} message ArrowRecordBatch message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ThrottleStatus.encodeDelimited = function encodeDelimited(message, writer) { + ArrowRecordBatch.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ThrottleStatus message from the specified reader or buffer. + * Decodes an ArrowRecordBatch message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1beta1.ThrottleStatus} ThrottleStatus + * @returns {google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch} ArrowRecordBatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ThrottleStatus.decode = function decode(reader, length) { + ArrowRecordBatch.decode = function decode(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.storage.v1beta1.ThrottleStatus(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.throttlePercent = reader.int32(); + message.serializedRecordBatch = reader.bytes(); + break; + case 2: + message.rowCount = reader.int64(); break; default: reader.skipType(tag & 7); @@ -7652,111 +9340,139 @@ }; /** - * Decodes a ThrottleStatus message from the specified reader or buffer, length delimited. + * Decodes an ArrowRecordBatch message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1beta1.ThrottleStatus} ThrottleStatus + * @returns {google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch} ArrowRecordBatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ThrottleStatus.decodeDelimited = function decodeDelimited(reader) { + ArrowRecordBatch.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ThrottleStatus message. + * Verifies an ArrowRecordBatch message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ThrottleStatus.verify = function verify(message) { + ArrowRecordBatch.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.throttlePercent != null && message.hasOwnProperty("throttlePercent")) - if (!$util.isInteger(message.throttlePercent)) - return "throttlePercent: integer expected"; + if (message.serializedRecordBatch != null && message.hasOwnProperty("serializedRecordBatch")) + if (!(message.serializedRecordBatch && typeof message.serializedRecordBatch.length === "number" || $util.isString(message.serializedRecordBatch))) + return "serializedRecordBatch: buffer expected"; + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (!$util.isInteger(message.rowCount) && !(message.rowCount && $util.isInteger(message.rowCount.low) && $util.isInteger(message.rowCount.high))) + return "rowCount: integer|Long expected"; return null; }; /** - * Creates a ThrottleStatus message from a plain object. Also converts values to their respective internal types. + * Creates an ArrowRecordBatch message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.ThrottleStatus} ThrottleStatus + * @returns {google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch} ArrowRecordBatch */ - ThrottleStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus) + ArrowRecordBatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch) return object; - var message = new $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus(); - if (object.throttlePercent != null) - message.throttlePercent = object.throttlePercent | 0; - return message; - }; - + var message = new $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch(); + if (object.serializedRecordBatch != null) + if (typeof object.serializedRecordBatch === "string") + $util.base64.decode(object.serializedRecordBatch, message.serializedRecordBatch = $util.newBuffer($util.base64.length(object.serializedRecordBatch)), 0); + else if (object.serializedRecordBatch.length) + message.serializedRecordBatch = object.serializedRecordBatch; + if (object.rowCount != null) + if ($util.Long) + (message.rowCount = $util.Long.fromValue(object.rowCount)).unsigned = false; + else if (typeof object.rowCount === "string") + message.rowCount = parseInt(object.rowCount, 10); + else if (typeof object.rowCount === "number") + message.rowCount = object.rowCount; + else if (typeof object.rowCount === "object") + message.rowCount = new $util.LongBits(object.rowCount.low >>> 0, object.rowCount.high >>> 0).toNumber(); + return message; + }; + /** - * Creates a plain object from a ThrottleStatus message. Also converts values to other types if specified. + * Creates a plain object from an ArrowRecordBatch message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch * @static - * @param {google.cloud.bigquery.storage.v1beta1.ThrottleStatus} message ThrottleStatus + * @param {google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch} message ArrowRecordBatch * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ThrottleStatus.toObject = function toObject(message, options) { + ArrowRecordBatch.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.throttlePercent = 0; - if (message.throttlePercent != null && message.hasOwnProperty("throttlePercent")) - object.throttlePercent = message.throttlePercent; + if (options.defaults) { + if (options.bytes === String) + object.serializedRecordBatch = ""; + else { + object.serializedRecordBatch = []; + if (options.bytes !== Array) + object.serializedRecordBatch = $util.newBuffer(object.serializedRecordBatch); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rowCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowCount = options.longs === String ? "0" : 0; + } + if (message.serializedRecordBatch != null && message.hasOwnProperty("serializedRecordBatch")) + object.serializedRecordBatch = options.bytes === String ? $util.base64.encode(message.serializedRecordBatch, 0, message.serializedRecordBatch.length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedRecordBatch) : message.serializedRecordBatch; + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (typeof message.rowCount === "number") + object.rowCount = options.longs === String ? String(message.rowCount) : message.rowCount; + else + object.rowCount = options.longs === String ? $util.Long.prototype.toString.call(message.rowCount) : options.longs === Number ? new $util.LongBits(message.rowCount.low >>> 0, message.rowCount.high >>> 0).toNumber() : message.rowCount; return object; }; /** - * Converts this ThrottleStatus to JSON. + * Converts this ArrowRecordBatch to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch * @instance * @returns {Object.} JSON object */ - ThrottleStatus.prototype.toJSON = function toJSON() { + ArrowRecordBatch.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ThrottleStatus; + return ArrowRecordBatch; })(); - v1beta1.ReadRowsResponse = (function() { + v1beta1.AvroSchema = (function() { /** - * Properties of a ReadRowsResponse. + * Properties of an AvroSchema. * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface IReadRowsResponse - * @property {google.cloud.bigquery.storage.v1beta1.IAvroRows|null} [avroRows] ReadRowsResponse avroRows - * @property {google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch|null} [arrowRecordBatch] ReadRowsResponse arrowRecordBatch - * @property {number|Long|null} [rowCount] ReadRowsResponse rowCount - * @property {google.cloud.bigquery.storage.v1beta1.IStreamStatus|null} [status] ReadRowsResponse status - * @property {google.cloud.bigquery.storage.v1beta1.IThrottleStatus|null} [throttleStatus] ReadRowsResponse throttleStatus + * @interface IAvroSchema + * @property {string|null} [schema] AvroSchema schema */ /** - * Constructs a new ReadRowsResponse. + * Constructs a new AvroSchema. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a ReadRowsResponse. - * @implements IReadRowsResponse + * @classdesc Represents an AvroSchema. + * @implements IAvroSchema * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsResponse=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.IAvroSchema=} [properties] Properties to set */ - function ReadRowsResponse(properties) { + function AvroSchema(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7764,141 +9480,75 @@ } /** - * ReadRowsResponse avroRows. - * @member {google.cloud.bigquery.storage.v1beta1.IAvroRows|null|undefined} avroRows - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse - * @instance - */ - ReadRowsResponse.prototype.avroRows = null; - - /** - * ReadRowsResponse arrowRecordBatch. - * @member {google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch|null|undefined} arrowRecordBatch - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse - * @instance - */ - ReadRowsResponse.prototype.arrowRecordBatch = null; - - /** - * ReadRowsResponse rowCount. - * @member {number|Long} rowCount - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse - * @instance - */ - ReadRowsResponse.prototype.rowCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ReadRowsResponse status. - * @member {google.cloud.bigquery.storage.v1beta1.IStreamStatus|null|undefined} status - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse - * @instance - */ - ReadRowsResponse.prototype.status = null; - - /** - * ReadRowsResponse throttleStatus. - * @member {google.cloud.bigquery.storage.v1beta1.IThrottleStatus|null|undefined} throttleStatus - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse - * @instance - */ - ReadRowsResponse.prototype.throttleStatus = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ReadRowsResponse rows. - * @member {"avroRows"|"arrowRecordBatch"|undefined} rows - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * AvroSchema schema. + * @member {string} schema + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema * @instance */ - Object.defineProperty(ReadRowsResponse.prototype, "rows", { - get: $util.oneOfGetter($oneOfFields = ["avroRows", "arrowRecordBatch"]), - set: $util.oneOfSetter($oneOfFields) - }); + AvroSchema.prototype.schema = ""; /** - * Creates a new ReadRowsResponse instance using the specified properties. + * Creates a new AvroSchema instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema * @static - * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsResponse=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} ReadRowsResponse instance + * @param {google.cloud.bigquery.storage.v1beta1.IAvroSchema=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.AvroSchema} AvroSchema instance */ - ReadRowsResponse.create = function create(properties) { - return new ReadRowsResponse(properties); + AvroSchema.create = function create(properties) { + return new AvroSchema(properties); }; /** - * Encodes the specified ReadRowsResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.verify|verify} messages. + * Encodes the specified AvroSchema message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroSchema.verify|verify} messages. * @function encode - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema * @static - * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsResponse} message ReadRowsResponse message or plain object to encode + * @param {google.cloud.bigquery.storage.v1beta1.IAvroSchema} message AvroSchema message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadRowsResponse.encode = function encode(message, writer) { + AvroSchema.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.cloud.bigquery.storage.v1beta1.StreamStatus.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.avroRows != null && Object.hasOwnProperty.call(message, "avroRows")) - $root.google.cloud.bigquery.storage.v1beta1.AvroRows.encode(message.avroRows, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.arrowRecordBatch != null && Object.hasOwnProperty.call(message, "arrowRecordBatch")) - $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.encode(message.arrowRecordBatch, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.throttleStatus != null && Object.hasOwnProperty.call(message, "throttleStatus")) - $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus.encode(message.throttleStatus, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) - writer.uint32(/* id 6, wireType 0 =*/48).int64(message.rowCount); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.schema); return writer; }; /** - * Encodes the specified ReadRowsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.verify|verify} messages. + * Encodes the specified AvroSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroSchema.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema * @static - * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsResponse} message ReadRowsResponse message or plain object to encode + * @param {google.cloud.bigquery.storage.v1beta1.IAvroSchema} message AvroSchema message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadRowsResponse.encodeDelimited = function encodeDelimited(message, writer) { + AvroSchema.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReadRowsResponse message from the specified reader or buffer. + * Decodes an AvroSchema message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} ReadRowsResponse + * @returns {google.cloud.bigquery.storage.v1beta1.AvroSchema} AvroSchema * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadRowsResponse.decode = function decode(reader, length) { + AvroSchema.decode = function decode(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.storage.v1beta1.ReadRowsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1beta1.AvroSchema(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: - message.avroRows = $root.google.cloud.bigquery.storage.v1beta1.AvroRows.decode(reader, reader.uint32()); - break; - case 4: - message.arrowRecordBatch = $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.decode(reader, reader.uint32()); - break; - case 6: - message.rowCount = reader.int64(); - break; - case 2: - message.status = $root.google.cloud.bigquery.storage.v1beta1.StreamStatus.decode(reader, reader.uint32()); - break; - case 5: - message.throttleStatus = $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus.decode(reader, reader.uint32()); + case 1: + message.schema = reader.string(); break; default: reader.skipType(tag & 7); @@ -7909,188 +9559,108 @@ }; /** - * Decodes a ReadRowsResponse message from the specified reader or buffer, length delimited. + * Decodes an AvroSchema message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} ReadRowsResponse + * @returns {google.cloud.bigquery.storage.v1beta1.AvroSchema} AvroSchema * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadRowsResponse.decodeDelimited = function decodeDelimited(reader) { + AvroSchema.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReadRowsResponse message. + * Verifies an AvroSchema message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReadRowsResponse.verify = function verify(message) { + AvroSchema.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.avroRows != null && message.hasOwnProperty("avroRows")) { - properties.rows = 1; - { - var error = $root.google.cloud.bigquery.storage.v1beta1.AvroRows.verify(message.avroRows); - if (error) - return "avroRows." + error; - } - } - if (message.arrowRecordBatch != null && message.hasOwnProperty("arrowRecordBatch")) { - if (properties.rows === 1) - return "rows: multiple values"; - properties.rows = 1; - { - var error = $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.verify(message.arrowRecordBatch); - if (error) - return "arrowRecordBatch." + error; - } - } - if (message.rowCount != null && message.hasOwnProperty("rowCount")) - if (!$util.isInteger(message.rowCount) && !(message.rowCount && $util.isInteger(message.rowCount.low) && $util.isInteger(message.rowCount.high))) - return "rowCount: integer|Long expected"; - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.cloud.bigquery.storage.v1beta1.StreamStatus.verify(message.status); - if (error) - return "status." + error; - } - if (message.throttleStatus != null && message.hasOwnProperty("throttleStatus")) { - var error = $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus.verify(message.throttleStatus); - if (error) - return "throttleStatus." + error; - } + if (message.schema != null && message.hasOwnProperty("schema")) + if (!$util.isString(message.schema)) + return "schema: string expected"; return null; }; /** - * Creates a ReadRowsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AvroSchema message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} ReadRowsResponse + * @returns {google.cloud.bigquery.storage.v1beta1.AvroSchema} AvroSchema */ - ReadRowsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.ReadRowsResponse) + AvroSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.AvroSchema) return object; - var message = new $root.google.cloud.bigquery.storage.v1beta1.ReadRowsResponse(); - if (object.avroRows != null) { - if (typeof object.avroRows !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.avroRows: object expected"); - message.avroRows = $root.google.cloud.bigquery.storage.v1beta1.AvroRows.fromObject(object.avroRows); - } - if (object.arrowRecordBatch != null) { - if (typeof object.arrowRecordBatch !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.arrowRecordBatch: object expected"); - message.arrowRecordBatch = $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.fromObject(object.arrowRecordBatch); - } - if (object.rowCount != null) - if ($util.Long) - (message.rowCount = $util.Long.fromValue(object.rowCount)).unsigned = false; - else if (typeof object.rowCount === "string") - message.rowCount = parseInt(object.rowCount, 10); - else if (typeof object.rowCount === "number") - message.rowCount = object.rowCount; - else if (typeof object.rowCount === "object") - message.rowCount = new $util.LongBits(object.rowCount.low >>> 0, object.rowCount.high >>> 0).toNumber(); - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.status: object expected"); - message.status = $root.google.cloud.bigquery.storage.v1beta1.StreamStatus.fromObject(object.status); - } - if (object.throttleStatus != null) { - if (typeof object.throttleStatus !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.throttleStatus: object expected"); - message.throttleStatus = $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus.fromObject(object.throttleStatus); - } + var message = new $root.google.cloud.bigquery.storage.v1beta1.AvroSchema(); + if (object.schema != null) + message.schema = String(object.schema); return message; }; /** - * Creates a plain object from a ReadRowsResponse message. Also converts values to other types if specified. + * Creates a plain object from an AvroSchema message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema * @static - * @param {google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} message ReadRowsResponse + * @param {google.cloud.bigquery.storage.v1beta1.AvroSchema} message AvroSchema * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadRowsResponse.toObject = function toObject(message, options) { + AvroSchema.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.status = null; - object.throttleStatus = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.rowCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.rowCount = options.longs === String ? "0" : 0; - } - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.cloud.bigquery.storage.v1beta1.StreamStatus.toObject(message.status, options); - if (message.avroRows != null && message.hasOwnProperty("avroRows")) { - object.avroRows = $root.google.cloud.bigquery.storage.v1beta1.AvroRows.toObject(message.avroRows, options); - if (options.oneofs) - object.rows = "avroRows"; - } - if (message.arrowRecordBatch != null && message.hasOwnProperty("arrowRecordBatch")) { - object.arrowRecordBatch = $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.toObject(message.arrowRecordBatch, options); - if (options.oneofs) - object.rows = "arrowRecordBatch"; - } - if (message.throttleStatus != null && message.hasOwnProperty("throttleStatus")) - object.throttleStatus = $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus.toObject(message.throttleStatus, options); - if (message.rowCount != null && message.hasOwnProperty("rowCount")) - if (typeof message.rowCount === "number") - object.rowCount = options.longs === String ? String(message.rowCount) : message.rowCount; - else - object.rowCount = options.longs === String ? $util.Long.prototype.toString.call(message.rowCount) : options.longs === Number ? new $util.LongBits(message.rowCount.low >>> 0, message.rowCount.high >>> 0).toNumber() : message.rowCount; + if (options.defaults) + object.schema = ""; + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = message.schema; return object; }; /** - * Converts this ReadRowsResponse to JSON. + * Converts this AvroSchema to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema * @instance * @returns {Object.} JSON object */ - ReadRowsResponse.prototype.toJSON = function toJSON() { + AvroSchema.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ReadRowsResponse; + return AvroSchema; })(); - v1beta1.BatchCreateReadSessionStreamsRequest = (function() { + v1beta1.AvroRows = (function() { /** - * Properties of a BatchCreateReadSessionStreamsRequest. + * Properties of an AvroRows. * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface IBatchCreateReadSessionStreamsRequest - * @property {google.cloud.bigquery.storage.v1beta1.IReadSession|null} [session] BatchCreateReadSessionStreamsRequest session - * @property {number|null} [requestedStreams] BatchCreateReadSessionStreamsRequest requestedStreams + * @interface IAvroRows + * @property {Uint8Array|null} [serializedBinaryRows] AvroRows serializedBinaryRows + * @property {number|Long|null} [rowCount] AvroRows rowCount */ /** - * Constructs a new BatchCreateReadSessionStreamsRequest. + * Constructs a new AvroRows. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a BatchCreateReadSessionStreamsRequest. - * @implements IBatchCreateReadSessionStreamsRequest + * @classdesc Represents an AvroRows. + * @implements IAvroRows * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.IAvroRows=} [properties] Properties to set */ - function BatchCreateReadSessionStreamsRequest(properties) { + function AvroRows(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8098,88 +9668,88 @@ } /** - * BatchCreateReadSessionStreamsRequest session. - * @member {google.cloud.bigquery.storage.v1beta1.IReadSession|null|undefined} session - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * AvroRows serializedBinaryRows. + * @member {Uint8Array} serializedBinaryRows + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows * @instance */ - BatchCreateReadSessionStreamsRequest.prototype.session = null; + AvroRows.prototype.serializedBinaryRows = $util.newBuffer([]); /** - * BatchCreateReadSessionStreamsRequest requestedStreams. - * @member {number} requestedStreams - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * AvroRows rowCount. + * @member {number|Long} rowCount + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows * @instance */ - BatchCreateReadSessionStreamsRequest.prototype.requestedStreams = 0; + AvroRows.prototype.rowCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new BatchCreateReadSessionStreamsRequest instance using the specified properties. + * Creates a new AvroRows instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows * @static - * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest} BatchCreateReadSessionStreamsRequest instance + * @param {google.cloud.bigquery.storage.v1beta1.IAvroRows=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.AvroRows} AvroRows instance */ - BatchCreateReadSessionStreamsRequest.create = function create(properties) { - return new BatchCreateReadSessionStreamsRequest(properties); + AvroRows.create = function create(properties) { + return new AvroRows(properties); }; /** - * Encodes the specified BatchCreateReadSessionStreamsRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest.verify|verify} messages. + * Encodes the specified AvroRows message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroRows.verify|verify} messages. * @function encode - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows * @static - * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest} message BatchCreateReadSessionStreamsRequest message or plain object to encode + * @param {google.cloud.bigquery.storage.v1beta1.IAvroRows} message AvroRows message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateReadSessionStreamsRequest.encode = function encode(message, writer) { + AvroRows.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - $root.google.cloud.bigquery.storage.v1beta1.ReadSession.encode(message.session, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.requestedStreams != null && Object.hasOwnProperty.call(message, "requestedStreams")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.requestedStreams); + if (message.serializedBinaryRows != null && Object.hasOwnProperty.call(message, "serializedBinaryRows")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.serializedBinaryRows); + if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.rowCount); return writer; }; /** - * Encodes the specified BatchCreateReadSessionStreamsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest.verify|verify} messages. + * Encodes the specified AvroRows message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroRows.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows * @static - * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest} message BatchCreateReadSessionStreamsRequest message or plain object to encode + * @param {google.cloud.bigquery.storage.v1beta1.IAvroRows} message AvroRows message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateReadSessionStreamsRequest.encodeDelimited = function encodeDelimited(message, writer) { + AvroRows.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateReadSessionStreamsRequest message from the specified reader or buffer. + * Decodes an AvroRows message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest} BatchCreateReadSessionStreamsRequest + * @returns {google.cloud.bigquery.storage.v1beta1.AvroRows} AvroRows * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateReadSessionStreamsRequest.decode = function decode(reader, length) { + AvroRows.decode = function decode(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.storage.v1beta1.BatchCreateReadSessionStreamsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1beta1.AvroRows(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.session = $root.google.cloud.bigquery.storage.v1beta1.ReadSession.decode(reader, reader.uint32()); + message.serializedBinaryRows = reader.bytes(); break; case 2: - message.requestedStreams = reader.int32(); + message.rowCount = reader.int64(); break; default: reader.skipType(tag & 7); @@ -8190,122 +9760,141 @@ }; /** - * Decodes a BatchCreateReadSessionStreamsRequest message from the specified reader or buffer, length delimited. + * Decodes an AvroRows message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest} BatchCreateReadSessionStreamsRequest + * @returns {google.cloud.bigquery.storage.v1beta1.AvroRows} AvroRows * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateReadSessionStreamsRequest.decodeDelimited = function decodeDelimited(reader) { + AvroRows.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchCreateReadSessionStreamsRequest message. + * Verifies an AvroRows message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchCreateReadSessionStreamsRequest.verify = function verify(message) { + AvroRows.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) { - var error = $root.google.cloud.bigquery.storage.v1beta1.ReadSession.verify(message.session); - if (error) - return "session." + error; - } - if (message.requestedStreams != null && message.hasOwnProperty("requestedStreams")) - if (!$util.isInteger(message.requestedStreams)) - return "requestedStreams: integer expected"; + if (message.serializedBinaryRows != null && message.hasOwnProperty("serializedBinaryRows")) + if (!(message.serializedBinaryRows && typeof message.serializedBinaryRows.length === "number" || $util.isString(message.serializedBinaryRows))) + return "serializedBinaryRows: buffer expected"; + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (!$util.isInteger(message.rowCount) && !(message.rowCount && $util.isInteger(message.rowCount.low) && $util.isInteger(message.rowCount.high))) + return "rowCount: integer|Long expected"; return null; }; /** - * Creates a BatchCreateReadSessionStreamsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AvroRows message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest} BatchCreateReadSessionStreamsRequest + * @returns {google.cloud.bigquery.storage.v1beta1.AvroRows} AvroRows */ - BatchCreateReadSessionStreamsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest) + AvroRows.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.AvroRows) return object; - var message = new $root.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest(); - if (object.session != null) { - if (typeof object.session !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest.session: object expected"); - message.session = $root.google.cloud.bigquery.storage.v1beta1.ReadSession.fromObject(object.session); - } - if (object.requestedStreams != null) - message.requestedStreams = object.requestedStreams | 0; + var message = new $root.google.cloud.bigquery.storage.v1beta1.AvroRows(); + if (object.serializedBinaryRows != null) + if (typeof object.serializedBinaryRows === "string") + $util.base64.decode(object.serializedBinaryRows, message.serializedBinaryRows = $util.newBuffer($util.base64.length(object.serializedBinaryRows)), 0); + else if (object.serializedBinaryRows.length) + message.serializedBinaryRows = object.serializedBinaryRows; + if (object.rowCount != null) + if ($util.Long) + (message.rowCount = $util.Long.fromValue(object.rowCount)).unsigned = false; + else if (typeof object.rowCount === "string") + message.rowCount = parseInt(object.rowCount, 10); + else if (typeof object.rowCount === "number") + message.rowCount = object.rowCount; + else if (typeof object.rowCount === "object") + message.rowCount = new $util.LongBits(object.rowCount.low >>> 0, object.rowCount.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a BatchCreateReadSessionStreamsRequest message. Also converts values to other types if specified. + * Creates a plain object from an AvroRows message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows * @static - * @param {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest} message BatchCreateReadSessionStreamsRequest + * @param {google.cloud.bigquery.storage.v1beta1.AvroRows} message AvroRows * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateReadSessionStreamsRequest.toObject = function toObject(message, options) { + AvroRows.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.session = null; - object.requestedStreams = 0; + if (options.bytes === String) + object.serializedBinaryRows = ""; + else { + object.serializedBinaryRows = []; + if (options.bytes !== Array) + object.serializedBinaryRows = $util.newBuffer(object.serializedBinaryRows); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rowCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowCount = options.longs === String ? "0" : 0; } - if (message.session != null && message.hasOwnProperty("session")) - object.session = $root.google.cloud.bigquery.storage.v1beta1.ReadSession.toObject(message.session, options); - if (message.requestedStreams != null && message.hasOwnProperty("requestedStreams")) - object.requestedStreams = message.requestedStreams; + if (message.serializedBinaryRows != null && message.hasOwnProperty("serializedBinaryRows")) + object.serializedBinaryRows = options.bytes === String ? $util.base64.encode(message.serializedBinaryRows, 0, message.serializedBinaryRows.length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedBinaryRows) : message.serializedBinaryRows; + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (typeof message.rowCount === "number") + object.rowCount = options.longs === String ? String(message.rowCount) : message.rowCount; + else + object.rowCount = options.longs === String ? $util.Long.prototype.toString.call(message.rowCount) : options.longs === Number ? new $util.LongBits(message.rowCount.low >>> 0, message.rowCount.high >>> 0).toNumber() : message.rowCount; return object; }; /** - * Converts this BatchCreateReadSessionStreamsRequest to JSON. + * Converts this AvroRows to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows * @instance * @returns {Object.} JSON object */ - BatchCreateReadSessionStreamsRequest.prototype.toJSON = function toJSON() { + AvroRows.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchCreateReadSessionStreamsRequest; + return AvroRows; })(); - v1beta1.BatchCreateReadSessionStreamsResponse = (function() { + v1beta1.TableReadOptions = (function() { /** - * Properties of a BatchCreateReadSessionStreamsResponse. + * Properties of a TableReadOptions. * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface IBatchCreateReadSessionStreamsResponse - * @property {Array.|null} [streams] BatchCreateReadSessionStreamsResponse streams + * @interface ITableReadOptions + * @property {Array.|null} [selectedFields] TableReadOptions selectedFields + * @property {string|null} [rowRestriction] TableReadOptions rowRestriction */ /** - * Constructs a new BatchCreateReadSessionStreamsResponse. + * Constructs a new TableReadOptions. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a BatchCreateReadSessionStreamsResponse. - * @implements IBatchCreateReadSessionStreamsResponse + * @classdesc Represents a TableReadOptions. + * @implements ITableReadOptions * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.ITableReadOptions=} [properties] Properties to set */ - function BatchCreateReadSessionStreamsResponse(properties) { - this.streams = []; + function TableReadOptions(properties) { + this.selectedFields = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8313,78 +9902,91 @@ } /** - * BatchCreateReadSessionStreamsResponse streams. - * @member {Array.} streams - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * TableReadOptions selectedFields. + * @member {Array.} selectedFields + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions * @instance */ - BatchCreateReadSessionStreamsResponse.prototype.streams = $util.emptyArray; + TableReadOptions.prototype.selectedFields = $util.emptyArray; /** - * Creates a new BatchCreateReadSessionStreamsResponse instance using the specified properties. + * TableReadOptions rowRestriction. + * @member {string} rowRestriction + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @instance + */ + TableReadOptions.prototype.rowRestriction = ""; + + /** + * Creates a new TableReadOptions instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions * @static - * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse} BatchCreateReadSessionStreamsResponse instance + * @param {google.cloud.bigquery.storage.v1beta1.ITableReadOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.TableReadOptions} TableReadOptions instance */ - BatchCreateReadSessionStreamsResponse.create = function create(properties) { - return new BatchCreateReadSessionStreamsResponse(properties); + TableReadOptions.create = function create(properties) { + return new TableReadOptions(properties); }; /** - * Encodes the specified BatchCreateReadSessionStreamsResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse.verify|verify} messages. + * Encodes the specified TableReadOptions message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableReadOptions.verify|verify} messages. * @function encode - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions * @static - * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse} message BatchCreateReadSessionStreamsResponse message or plain object to encode + * @param {google.cloud.bigquery.storage.v1beta1.ITableReadOptions} message TableReadOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateReadSessionStreamsResponse.encode = function encode(message, writer) { + TableReadOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.streams != null && message.streams.length) - for (var i = 0; i < message.streams.length; ++i) - $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.streams[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.selectedFields != null && message.selectedFields.length) + for (var i = 0; i < message.selectedFields.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectedFields[i]); + if (message.rowRestriction != null && Object.hasOwnProperty.call(message, "rowRestriction")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rowRestriction); return writer; }; /** - * Encodes the specified BatchCreateReadSessionStreamsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse.verify|verify} messages. + * Encodes the specified TableReadOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableReadOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions * @static - * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse} message BatchCreateReadSessionStreamsResponse message or plain object to encode + * @param {google.cloud.bigquery.storage.v1beta1.ITableReadOptions} message TableReadOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateReadSessionStreamsResponse.encodeDelimited = function encodeDelimited(message, writer) { + TableReadOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateReadSessionStreamsResponse message from the specified reader or buffer. + * Decodes a TableReadOptions message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse} BatchCreateReadSessionStreamsResponse + * @returns {google.cloud.bigquery.storage.v1beta1.TableReadOptions} TableReadOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateReadSessionStreamsResponse.decode = function decode(reader, length) { + TableReadOptions.decode = function decode(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.storage.v1beta1.BatchCreateReadSessionStreamsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.streams && message.streams.length)) - message.streams = []; - message.streams.push($root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32())); + if (!(message.selectedFields && message.selectedFields.length)) + message.selectedFields = []; + message.selectedFields.push(reader.string()); + break; + case 2: + message.rowRestriction = reader.string(); break; default: reader.skipType(tag & 7); @@ -8395,200 +9997,404 @@ }; /** - * Decodes a BatchCreateReadSessionStreamsResponse message from the specified reader or buffer, length delimited. + * Decodes a TableReadOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse} BatchCreateReadSessionStreamsResponse + * @returns {google.cloud.bigquery.storage.v1beta1.TableReadOptions} TableReadOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateReadSessionStreamsResponse.decodeDelimited = function decodeDelimited(reader) { + TableReadOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchCreateReadSessionStreamsResponse message. + * Verifies a TableReadOptions message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchCreateReadSessionStreamsResponse.verify = function verify(message) { + TableReadOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.streams != null && message.hasOwnProperty("streams")) { - if (!Array.isArray(message.streams)) - return "streams: array expected"; - for (var i = 0; i < message.streams.length; ++i) { - var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.streams[i]); - if (error) - return "streams." + error; - } + if (message.selectedFields != null && message.hasOwnProperty("selectedFields")) { + if (!Array.isArray(message.selectedFields)) + return "selectedFields: array expected"; + for (var i = 0; i < message.selectedFields.length; ++i) + if (!$util.isString(message.selectedFields[i])) + return "selectedFields: string[] expected"; } + if (message.rowRestriction != null && message.hasOwnProperty("rowRestriction")) + if (!$util.isString(message.rowRestriction)) + return "rowRestriction: string expected"; return null; }; /** - * Creates a BatchCreateReadSessionStreamsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a TableReadOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse} BatchCreateReadSessionStreamsResponse + * @returns {google.cloud.bigquery.storage.v1beta1.TableReadOptions} TableReadOptions */ - BatchCreateReadSessionStreamsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse) + TableReadOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions) return object; - var message = new $root.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse(); - if (object.streams) { - if (!Array.isArray(object.streams)) - throw TypeError(".google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse.streams: array expected"); - message.streams = []; - for (var i = 0; i < object.streams.length; ++i) { - if (typeof object.streams[i] !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse.streams: object expected"); - message.streams[i] = $root.google.cloud.bigquery.storage.v1beta1.Stream.fromObject(object.streams[i]); - } + var message = new $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions(); + if (object.selectedFields) { + if (!Array.isArray(object.selectedFields)) + throw TypeError(".google.cloud.bigquery.storage.v1beta1.TableReadOptions.selectedFields: array expected"); + message.selectedFields = []; + for (var i = 0; i < object.selectedFields.length; ++i) + message.selectedFields[i] = String(object.selectedFields[i]); } + if (object.rowRestriction != null) + message.rowRestriction = String(object.rowRestriction); return message; }; /** - * Creates a plain object from a BatchCreateReadSessionStreamsResponse message. Also converts values to other types if specified. + * Creates a plain object from a TableReadOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions * @static - * @param {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse} message BatchCreateReadSessionStreamsResponse + * @param {google.cloud.bigquery.storage.v1beta1.TableReadOptions} message TableReadOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateReadSessionStreamsResponse.toObject = function toObject(message, options) { + TableReadOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.streams = []; - if (message.streams && message.streams.length) { - object.streams = []; - for (var j = 0; j < message.streams.length; ++j) - object.streams[j] = $root.google.cloud.bigquery.storage.v1beta1.Stream.toObject(message.streams[j], options); + object.selectedFields = []; + if (options.defaults) + object.rowRestriction = ""; + if (message.selectedFields && message.selectedFields.length) { + object.selectedFields = []; + for (var j = 0; j < message.selectedFields.length; ++j) + object.selectedFields[j] = message.selectedFields[j]; } + if (message.rowRestriction != null && message.hasOwnProperty("rowRestriction")) + object.rowRestriction = message.rowRestriction; return object; }; /** - * Converts this BatchCreateReadSessionStreamsResponse to JSON. + * Converts this TableReadOptions to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions * @instance * @returns {Object.} JSON object */ - BatchCreateReadSessionStreamsResponse.prototype.toJSON = function toJSON() { + TableReadOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchCreateReadSessionStreamsResponse; + return TableReadOptions; })(); - v1beta1.FinalizeStreamRequest = (function() { - - /** - * Properties of a FinalizeStreamRequest. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface IFinalizeStreamRequest - * @property {google.cloud.bigquery.storage.v1beta1.IStream|null} [stream] FinalizeStreamRequest stream - */ + v1beta1.BigQueryStorage = (function() { /** - * Constructs a new FinalizeStreamRequest. + * Constructs a new BigQueryStorage service. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a FinalizeStreamRequest. - * @implements IFinalizeStreamRequest + * @classdesc Represents a BigQueryStorage + * @extends $protobuf.rpc.Service * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest=} [properties] Properties to set + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ - function FinalizeStreamRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + function BigQueryStorage(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } - /** - * FinalizeStreamRequest stream. - * @member {google.cloud.bigquery.storage.v1beta1.IStream|null|undefined} stream - * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest - * @instance - */ - FinalizeStreamRequest.prototype.stream = null; + (BigQueryStorage.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BigQueryStorage; /** - * Creates a new FinalizeStreamRequest instance using the specified properties. + * Creates new BigQueryStorage service using the specified rpc implementation. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage * @static - * @param {google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest} FinalizeStreamRequest instance + * @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 {BigQueryStorage} RPC service. Useful where requests and/or responses are streamed. */ - FinalizeStreamRequest.create = function create(properties) { - return new FinalizeStreamRequest(properties); + BigQueryStorage.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * Encodes the specified FinalizeStreamRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest - * @static - * @param {google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest} message FinalizeStreamRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FinalizeStreamRequest.encode = function encode(message, writer) { + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#createReadSession}. + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @typedef CreateReadSessionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.storage.v1beta1.ReadSession} [response] ReadSession + */ + + /** + * Calls CreateReadSession. + * @function createReadSession + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @instance + * @param {google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest} request CreateReadSessionRequest message or plain object + * @param {google.cloud.bigquery.storage.v1beta1.BigQueryStorage.CreateReadSessionCallback} callback Node-style callback called with the error, if any, and ReadSession + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigQueryStorage.prototype.createReadSession = function createReadSession(request, callback) { + return this.rpcCall(createReadSession, $root.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest, $root.google.cloud.bigquery.storage.v1beta1.ReadSession, request, callback); + }, "name", { value: "CreateReadSession" }); + + /** + * Calls CreateReadSession. + * @function createReadSession + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @instance + * @param {google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest} request CreateReadSessionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#readRows}. + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @typedef ReadRowsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} [response] ReadRowsResponse + */ + + /** + * Calls ReadRows. + * @function readRows + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @instance + * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsRequest} request ReadRowsRequest message or plain object + * @param {google.cloud.bigquery.storage.v1beta1.BigQueryStorage.ReadRowsCallback} callback Node-style callback called with the error, if any, and ReadRowsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigQueryStorage.prototype.readRows = function readRows(request, callback) { + return this.rpcCall(readRows, $root.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest, $root.google.cloud.bigquery.storage.v1beta1.ReadRowsResponse, request, callback); + }, "name", { value: "ReadRows" }); + + /** + * Calls ReadRows. + * @function readRows + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @instance + * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsRequest} request ReadRowsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#batchCreateReadSessionStreams}. + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @typedef BatchCreateReadSessionStreamsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse} [response] BatchCreateReadSessionStreamsResponse + */ + + /** + * Calls BatchCreateReadSessionStreams. + * @function batchCreateReadSessionStreams + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @instance + * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest} request BatchCreateReadSessionStreamsRequest message or plain object + * @param {google.cloud.bigquery.storage.v1beta1.BigQueryStorage.BatchCreateReadSessionStreamsCallback} callback Node-style callback called with the error, if any, and BatchCreateReadSessionStreamsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigQueryStorage.prototype.batchCreateReadSessionStreams = function batchCreateReadSessionStreams(request, callback) { + return this.rpcCall(batchCreateReadSessionStreams, $root.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest, $root.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse, request, callback); + }, "name", { value: "BatchCreateReadSessionStreams" }); + + /** + * Calls BatchCreateReadSessionStreams. + * @function batchCreateReadSessionStreams + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @instance + * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest} request BatchCreateReadSessionStreamsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#finalizeStream}. + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @typedef FinalizeStreamCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls FinalizeStream. + * @function finalizeStream + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @instance + * @param {google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest} request FinalizeStreamRequest message or plain object + * @param {google.cloud.bigquery.storage.v1beta1.BigQueryStorage.FinalizeStreamCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigQueryStorage.prototype.finalizeStream = function finalizeStream(request, callback) { + return this.rpcCall(finalizeStream, $root.google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "FinalizeStream" }); + + /** + * Calls FinalizeStream. + * @function finalizeStream + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @instance + * @param {google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest} request FinalizeStreamRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#splitReadStream}. + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @typedef SplitReadStreamCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse} [response] SplitReadStreamResponse + */ + + /** + * Calls SplitReadStream. + * @function splitReadStream + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @instance + * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest} request SplitReadStreamRequest message or plain object + * @param {google.cloud.bigquery.storage.v1beta1.BigQueryStorage.SplitReadStreamCallback} callback Node-style callback called with the error, if any, and SplitReadStreamResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BigQueryStorage.prototype.splitReadStream = function splitReadStream(request, callback) { + return this.rpcCall(splitReadStream, $root.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest, $root.google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse, request, callback); + }, "name", { value: "SplitReadStream" }); + + /** + * Calls SplitReadStream. + * @function splitReadStream + * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * @instance + * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest} request SplitReadStreamRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return BigQueryStorage; + })(); + + v1beta1.Stream = (function() { + + /** + * Properties of a Stream. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IStream + * @property {string|null} [name] Stream name + */ + + /** + * Constructs a new Stream. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a Stream. + * @implements IStream + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IStream=} [properties] Properties to set + */ + function Stream(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Stream name. + * @member {string} name + * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @instance + */ + Stream.prototype.name = ""; + + /** + * Creates a new Stream instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IStream=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.Stream} Stream instance + */ + Stream.create = function create(properties) { + return new Stream(properties); + }; + + /** + * Encodes the specified Stream message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Stream.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IStream} message Stream message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Stream.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.stream != null && Object.hasOwnProperty.call(message, "stream")) - $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.stream, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified FinalizeStreamRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest.verify|verify} messages. + * Encodes the specified Stream message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Stream.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.Stream * @static - * @param {google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest} message FinalizeStreamRequest message or plain object to encode + * @param {google.cloud.bigquery.storage.v1beta1.IStream} message Stream message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FinalizeStreamRequest.encodeDelimited = function encodeDelimited(message, writer) { + Stream.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FinalizeStreamRequest message from the specified reader or buffer. + * Decodes a Stream message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.Stream * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest} FinalizeStreamRequest + * @returns {google.cloud.bigquery.storage.v1beta1.Stream} Stream * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FinalizeStreamRequest.decode = function decode(reader, length) { + Stream.decode = function decode(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.storage.v1beta1.FinalizeStreamRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1beta1.Stream(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - message.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); + case 1: + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -8599,113 +10405,108 @@ }; /** - * Decodes a FinalizeStreamRequest message from the specified reader or buffer, length delimited. + * Decodes a Stream message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.Stream * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest} FinalizeStreamRequest + * @returns {google.cloud.bigquery.storage.v1beta1.Stream} Stream * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FinalizeStreamRequest.decodeDelimited = function decodeDelimited(reader) { + Stream.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FinalizeStreamRequest message. + * Verifies a Stream message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.Stream * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FinalizeStreamRequest.verify = function verify(message) { + Stream.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.stream != null && message.hasOwnProperty("stream")) { - var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.stream); - if (error) - return "stream." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a FinalizeStreamRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Stream message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.Stream * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest} FinalizeStreamRequest + * @returns {google.cloud.bigquery.storage.v1beta1.Stream} Stream */ - FinalizeStreamRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest) + Stream.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.Stream) return object; - var message = new $root.google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest(); - if (object.stream != null) { - if (typeof object.stream !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest.stream: object expected"); - message.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.fromObject(object.stream); - } + var message = new $root.google.cloud.bigquery.storage.v1beta1.Stream(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a FinalizeStreamRequest message. Also converts values to other types if specified. + * Creates a plain object from a Stream message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.Stream * @static - * @param {google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest} message FinalizeStreamRequest + * @param {google.cloud.bigquery.storage.v1beta1.Stream} message Stream * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FinalizeStreamRequest.toObject = function toObject(message, options) { + Stream.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.stream = null; - if (message.stream != null && message.hasOwnProperty("stream")) - object.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.toObject(message.stream, options); + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this FinalizeStreamRequest to JSON. + * Converts this Stream to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.Stream * @instance * @returns {Object.} JSON object */ - FinalizeStreamRequest.prototype.toJSON = function toJSON() { + Stream.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return FinalizeStreamRequest; + return Stream; })(); - v1beta1.SplitReadStreamRequest = (function() { + v1beta1.StreamPosition = (function() { /** - * Properties of a SplitReadStreamRequest. + * Properties of a StreamPosition. * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface ISplitReadStreamRequest - * @property {google.cloud.bigquery.storage.v1beta1.IStream|null} [originalStream] SplitReadStreamRequest originalStream - * @property {number|null} [fraction] SplitReadStreamRequest fraction + * @interface IStreamPosition + * @property {google.cloud.bigquery.storage.v1beta1.IStream|null} [stream] StreamPosition stream + * @property {number|Long|null} [offset] StreamPosition offset */ /** - * Constructs a new SplitReadStreamRequest. + * Constructs a new StreamPosition. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a SplitReadStreamRequest. - * @implements ISplitReadStreamRequest + * @classdesc Represents a StreamPosition. + * @implements IStreamPosition * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.IStreamPosition=} [properties] Properties to set */ - function SplitReadStreamRequest(properties) { + function StreamPosition(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8713,88 +10514,88 @@ } /** - * SplitReadStreamRequest originalStream. - * @member {google.cloud.bigquery.storage.v1beta1.IStream|null|undefined} originalStream - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * StreamPosition stream. + * @member {google.cloud.bigquery.storage.v1beta1.IStream|null|undefined} stream + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition * @instance */ - SplitReadStreamRequest.prototype.originalStream = null; + StreamPosition.prototype.stream = null; /** - * SplitReadStreamRequest fraction. - * @member {number} fraction - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * StreamPosition offset. + * @member {number|Long} offset + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition * @instance */ - SplitReadStreamRequest.prototype.fraction = 0; + StreamPosition.prototype.offset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new SplitReadStreamRequest instance using the specified properties. + * Creates a new StreamPosition instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition * @static - * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest} SplitReadStreamRequest instance + * @param {google.cloud.bigquery.storage.v1beta1.IStreamPosition=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.StreamPosition} StreamPosition instance */ - SplitReadStreamRequest.create = function create(properties) { - return new SplitReadStreamRequest(properties); + StreamPosition.create = function create(properties) { + return new StreamPosition(properties); }; /** - * Encodes the specified SplitReadStreamRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest.verify|verify} messages. + * Encodes the specified StreamPosition message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamPosition.verify|verify} messages. * @function encode - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition * @static - * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest} message SplitReadStreamRequest message or plain object to encode + * @param {google.cloud.bigquery.storage.v1beta1.IStreamPosition} message StreamPosition message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SplitReadStreamRequest.encode = function encode(message, writer) { + StreamPosition.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.originalStream != null && Object.hasOwnProperty.call(message, "originalStream")) - $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.originalStream, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fraction != null && Object.hasOwnProperty.call(message, "fraction")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.fraction); + if (message.stream != null && Object.hasOwnProperty.call(message, "stream")) + $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.stream, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.offset); return writer; }; /** - * Encodes the specified SplitReadStreamRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest.verify|verify} messages. + * Encodes the specified StreamPosition message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamPosition.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition * @static - * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest} message SplitReadStreamRequest message or plain object to encode + * @param {google.cloud.bigquery.storage.v1beta1.IStreamPosition} message StreamPosition message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SplitReadStreamRequest.encodeDelimited = function encodeDelimited(message, writer) { + StreamPosition.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SplitReadStreamRequest message from the specified reader or buffer. + * Decodes a StreamPosition message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest} SplitReadStreamRequest + * @returns {google.cloud.bigquery.storage.v1beta1.StreamPosition} StreamPosition * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SplitReadStreamRequest.decode = function decode(reader, length) { + StreamPosition.decode = function decode(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.storage.v1beta1.SplitReadStreamRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1beta1.StreamPosition(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.originalStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); + message.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); break; case 2: - message.fraction = reader.float(); + message.offset = reader.int64(); break; default: reader.skipType(tag & 7); @@ -8805,122 +10606,143 @@ }; /** - * Decodes a SplitReadStreamRequest message from the specified reader or buffer, length delimited. + * Decodes a StreamPosition message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest} SplitReadStreamRequest + * @returns {google.cloud.bigquery.storage.v1beta1.StreamPosition} StreamPosition * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SplitReadStreamRequest.decodeDelimited = function decodeDelimited(reader) { + StreamPosition.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SplitReadStreamRequest message. + * Verifies a StreamPosition message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SplitReadStreamRequest.verify = function verify(message) { + StreamPosition.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.originalStream != null && message.hasOwnProperty("originalStream")) { - var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.originalStream); + if (message.stream != null && message.hasOwnProperty("stream")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.stream); if (error) - return "originalStream." + error; + return "stream." + error; } - if (message.fraction != null && message.hasOwnProperty("fraction")) - if (typeof message.fraction !== "number") - return "fraction: number expected"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset) && !(message.offset && $util.isInteger(message.offset.low) && $util.isInteger(message.offset.high))) + return "offset: integer|Long expected"; return null; }; /** - * Creates a SplitReadStreamRequest message from a plain object. Also converts values to their respective internal types. + * Creates a StreamPosition message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest} SplitReadStreamRequest + * @returns {google.cloud.bigquery.storage.v1beta1.StreamPosition} StreamPosition */ - SplitReadStreamRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest) + StreamPosition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.StreamPosition) return object; - var message = new $root.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest(); - if (object.originalStream != null) { - if (typeof object.originalStream !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest.originalStream: object expected"); - message.originalStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.fromObject(object.originalStream); + var message = new $root.google.cloud.bigquery.storage.v1beta1.StreamPosition(); + if (object.stream != null) { + if (typeof object.stream !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.StreamPosition.stream: object expected"); + message.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.fromObject(object.stream); } - if (object.fraction != null) - message.fraction = Number(object.fraction); + if (object.offset != null) + if ($util.Long) + (message.offset = $util.Long.fromValue(object.offset)).unsigned = false; + else if (typeof object.offset === "string") + message.offset = parseInt(object.offset, 10); + else if (typeof object.offset === "number") + message.offset = object.offset; + else if (typeof object.offset === "object") + message.offset = new $util.LongBits(object.offset.low >>> 0, object.offset.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a SplitReadStreamRequest message. Also converts values to other types if specified. + * Creates a plain object from a StreamPosition message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition * @static - * @param {google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest} message SplitReadStreamRequest + * @param {google.cloud.bigquery.storage.v1beta1.StreamPosition} message StreamPosition * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SplitReadStreamRequest.toObject = function toObject(message, options) { + StreamPosition.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.originalStream = null; - object.fraction = 0; + object.stream = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.offset = options.longs === String ? "0" : 0; } - if (message.originalStream != null && message.hasOwnProperty("originalStream")) - object.originalStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.toObject(message.originalStream, options); - if (message.fraction != null && message.hasOwnProperty("fraction")) - object.fraction = options.json && !isFinite(message.fraction) ? String(message.fraction) : message.fraction; + if (message.stream != null && message.hasOwnProperty("stream")) + object.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.toObject(message.stream, options); + if (message.offset != null && message.hasOwnProperty("offset")) + if (typeof message.offset === "number") + object.offset = options.longs === String ? String(message.offset) : message.offset; + else + object.offset = options.longs === String ? $util.Long.prototype.toString.call(message.offset) : options.longs === Number ? new $util.LongBits(message.offset.low >>> 0, message.offset.high >>> 0).toNumber() : message.offset; return object; }; /** - * Converts this SplitReadStreamRequest to JSON. + * Converts this StreamPosition to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition * @instance * @returns {Object.} JSON object */ - SplitReadStreamRequest.prototype.toJSON = function toJSON() { + StreamPosition.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SplitReadStreamRequest; + return StreamPosition; })(); - v1beta1.SplitReadStreamResponse = (function() { + v1beta1.ReadSession = (function() { /** - * Properties of a SplitReadStreamResponse. + * Properties of a ReadSession. * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface ISplitReadStreamResponse - * @property {google.cloud.bigquery.storage.v1beta1.IStream|null} [primaryStream] SplitReadStreamResponse primaryStream - * @property {google.cloud.bigquery.storage.v1beta1.IStream|null} [remainderStream] SplitReadStreamResponse remainderStream + * @interface IReadSession + * @property {string|null} [name] ReadSession name + * @property {google.protobuf.ITimestamp|null} [expireTime] ReadSession expireTime + * @property {google.cloud.bigquery.storage.v1beta1.IAvroSchema|null} [avroSchema] ReadSession avroSchema + * @property {google.cloud.bigquery.storage.v1beta1.IArrowSchema|null} [arrowSchema] ReadSession arrowSchema + * @property {Array.|null} [streams] ReadSession streams + * @property {google.cloud.bigquery.storage.v1beta1.ITableReference|null} [tableReference] ReadSession tableReference + * @property {google.cloud.bigquery.storage.v1beta1.ITableModifiers|null} [tableModifiers] ReadSession tableModifiers + * @property {google.cloud.bigquery.storage.v1beta1.ShardingStrategy|null} [shardingStrategy] ReadSession shardingStrategy */ /** - * Constructs a new SplitReadStreamResponse. + * Constructs a new ReadSession. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a SplitReadStreamResponse. - * @implements ISplitReadStreamResponse + * @classdesc Represents a ReadSession. + * @implements IReadSession * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.IReadSession=} [properties] Properties to set */ - function SplitReadStreamResponse(properties) { + function ReadSession(properties) { + this.streams = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8928,88 +10750,183 @@ } /** - * SplitReadStreamResponse primaryStream. - * @member {google.cloud.bigquery.storage.v1beta1.IStream|null|undefined} primaryStream - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * ReadSession name. + * @member {string} name + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @instance */ - SplitReadStreamResponse.prototype.primaryStream = null; + ReadSession.prototype.name = ""; /** - * SplitReadStreamResponse remainderStream. - * @member {google.cloud.bigquery.storage.v1beta1.IStream|null|undefined} remainderStream - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * ReadSession expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @instance */ - SplitReadStreamResponse.prototype.remainderStream = null; + ReadSession.prototype.expireTime = null; /** - * Creates a new SplitReadStreamResponse instance using the specified properties. + * ReadSession avroSchema. + * @member {google.cloud.bigquery.storage.v1beta1.IAvroSchema|null|undefined} avroSchema + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @instance + */ + ReadSession.prototype.avroSchema = null; + + /** + * ReadSession arrowSchema. + * @member {google.cloud.bigquery.storage.v1beta1.IArrowSchema|null|undefined} arrowSchema + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @instance + */ + ReadSession.prototype.arrowSchema = null; + + /** + * ReadSession streams. + * @member {Array.} streams + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @instance + */ + ReadSession.prototype.streams = $util.emptyArray; + + /** + * ReadSession tableReference. + * @member {google.cloud.bigquery.storage.v1beta1.ITableReference|null|undefined} tableReference + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @instance + */ + ReadSession.prototype.tableReference = null; + + /** + * ReadSession tableModifiers. + * @member {google.cloud.bigquery.storage.v1beta1.ITableModifiers|null|undefined} tableModifiers + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @instance + */ + ReadSession.prototype.tableModifiers = null; + + /** + * ReadSession shardingStrategy. + * @member {google.cloud.bigquery.storage.v1beta1.ShardingStrategy} shardingStrategy + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @instance + */ + ReadSession.prototype.shardingStrategy = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReadSession schema. + * @member {"avroSchema"|"arrowSchema"|undefined} schema + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @instance + */ + Object.defineProperty(ReadSession.prototype, "schema", { + get: $util.oneOfGetter($oneOfFields = ["avroSchema", "arrowSchema"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReadSession instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @static - * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse} SplitReadStreamResponse instance + * @param {google.cloud.bigquery.storage.v1beta1.IReadSession=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.ReadSession} ReadSession instance */ - SplitReadStreamResponse.create = function create(properties) { - return new SplitReadStreamResponse(properties); + ReadSession.create = function create(properties) { + return new ReadSession(properties); }; /** - * Encodes the specified SplitReadStreamResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse.verify|verify} messages. + * Encodes the specified ReadSession message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadSession.verify|verify} messages. * @function encode - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @static - * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse} message SplitReadStreamResponse message or plain object to encode + * @param {google.cloud.bigquery.storage.v1beta1.IReadSession} message ReadSession message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SplitReadStreamResponse.encode = function encode(message, writer) { + ReadSession.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.primaryStream != null && Object.hasOwnProperty.call(message, "primaryStream")) - $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.primaryStream, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.remainderStream != null && Object.hasOwnProperty.call(message, "remainderStream")) - $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.remainderStream, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.streams != null && message.streams.length) + for (var i = 0; i < message.streams.length; ++i) + $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.streams[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.avroSchema != null && Object.hasOwnProperty.call(message, "avroSchema")) + $root.google.cloud.bigquery.storage.v1beta1.AvroSchema.encode(message.avroSchema, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.arrowSchema != null && Object.hasOwnProperty.call(message, "arrowSchema")) + $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema.encode(message.arrowSchema, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.tableReference != null && Object.hasOwnProperty.call(message, "tableReference")) + $root.google.cloud.bigquery.storage.v1beta1.TableReference.encode(message.tableReference, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.tableModifiers != null && Object.hasOwnProperty.call(message, "tableModifiers")) + $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.encode(message.tableModifiers, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.shardingStrategy != null && Object.hasOwnProperty.call(message, "shardingStrategy")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.shardingStrategy); return writer; }; /** - * Encodes the specified SplitReadStreamResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse.verify|verify} messages. + * Encodes the specified ReadSession message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadSession.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @static - * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse} message SplitReadStreamResponse message or plain object to encode + * @param {google.cloud.bigquery.storage.v1beta1.IReadSession} message ReadSession message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SplitReadStreamResponse.encodeDelimited = function encodeDelimited(message, writer) { + ReadSession.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SplitReadStreamResponse message from the specified reader or buffer. + * Decodes a ReadSession message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse} SplitReadStreamResponse + * @returns {google.cloud.bigquery.storage.v1beta1.ReadSession} ReadSession * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SplitReadStreamResponse.decode = function decode(reader, length) { + ReadSession.decode = function decode(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.storage.v1beta1.SplitReadStreamResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1beta1.ReadSession(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.primaryStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); + message.name = reader.string(); break; case 2: - message.remainderStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.avroSchema = $root.google.cloud.bigquery.storage.v1beta1.AvroSchema.decode(reader, reader.uint32()); + break; + case 6: + message.arrowSchema = $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.streams && message.streams.length)) + message.streams = []; + message.streams.push($root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32())); + break; + case 7: + message.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.decode(reader, reader.uint32()); + break; + case 8: + message.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.decode(reader, reader.uint32()); + break; + case 9: + message.shardingStrategy = reader.int32(); break; default: reader.skipType(tag & 7); @@ -9020,128 +10937,244 @@ }; /** - * Decodes a SplitReadStreamResponse message from the specified reader or buffer, length delimited. + * Decodes a ReadSession message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse} SplitReadStreamResponse + * @returns {google.cloud.bigquery.storage.v1beta1.ReadSession} ReadSession * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SplitReadStreamResponse.decodeDelimited = function decodeDelimited(reader) { + ReadSession.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SplitReadStreamResponse message. + * Verifies a ReadSession message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SplitReadStreamResponse.verify = function verify(message) { + ReadSession.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.primaryStream != null && message.hasOwnProperty("primaryStream")) { - var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.primaryStream); + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); if (error) - return "primaryStream." + error; + return "expireTime." + error; } - if (message.remainderStream != null && message.hasOwnProperty("remainderStream")) { - var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.remainderStream); + if (message.avroSchema != null && message.hasOwnProperty("avroSchema")) { + properties.schema = 1; + { + var error = $root.google.cloud.bigquery.storage.v1beta1.AvroSchema.verify(message.avroSchema); + if (error) + return "avroSchema." + error; + } + } + if (message.arrowSchema != null && message.hasOwnProperty("arrowSchema")) { + if (properties.schema === 1) + return "schema: multiple values"; + properties.schema = 1; + { + var error = $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema.verify(message.arrowSchema); + if (error) + return "arrowSchema." + error; + } + } + if (message.streams != null && message.hasOwnProperty("streams")) { + if (!Array.isArray(message.streams)) + return "streams: array expected"; + for (var i = 0; i < message.streams.length; ++i) { + var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.streams[i]); + if (error) + return "streams." + error; + } + } + if (message.tableReference != null && message.hasOwnProperty("tableReference")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.TableReference.verify(message.tableReference); if (error) - return "remainderStream." + error; + return "tableReference." + error; + } + if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.verify(message.tableModifiers); + if (error) + return "tableModifiers." + error; } + if (message.shardingStrategy != null && message.hasOwnProperty("shardingStrategy")) + switch (message.shardingStrategy) { + default: + return "shardingStrategy: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates a SplitReadStreamResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ReadSession message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse} SplitReadStreamResponse + * @returns {google.cloud.bigquery.storage.v1beta1.ReadSession} ReadSession */ - SplitReadStreamResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse) + ReadSession.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.ReadSession) return object; - var message = new $root.google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse(); - if (object.primaryStream != null) { - if (typeof object.primaryStream !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse.primaryStream: object expected"); - message.primaryStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.fromObject(object.primaryStream); - } - if (object.remainderStream != null) { - if (typeof object.remainderStream !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse.remainderStream: object expected"); - message.remainderStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.fromObject(object.remainderStream); - } + var message = new $root.google.cloud.bigquery.storage.v1beta1.ReadSession(); + if (object.name != null) + message.name = String(object.name); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadSession.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.avroSchema != null) { + if (typeof object.avroSchema !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadSession.avroSchema: object expected"); + message.avroSchema = $root.google.cloud.bigquery.storage.v1beta1.AvroSchema.fromObject(object.avroSchema); + } + if (object.arrowSchema != null) { + if (typeof object.arrowSchema !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadSession.arrowSchema: object expected"); + message.arrowSchema = $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema.fromObject(object.arrowSchema); + } + if (object.streams) { + if (!Array.isArray(object.streams)) + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadSession.streams: array expected"); + message.streams = []; + for (var i = 0; i < object.streams.length; ++i) { + if (typeof object.streams[i] !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadSession.streams: object expected"); + message.streams[i] = $root.google.cloud.bigquery.storage.v1beta1.Stream.fromObject(object.streams[i]); + } + } + if (object.tableReference != null) { + if (typeof object.tableReference !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadSession.tableReference: object expected"); + message.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.fromObject(object.tableReference); + } + if (object.tableModifiers != null) { + if (typeof object.tableModifiers !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadSession.tableModifiers: object expected"); + message.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.fromObject(object.tableModifiers); + } + switch (object.shardingStrategy) { + case "SHARDING_STRATEGY_UNSPECIFIED": + case 0: + message.shardingStrategy = 0; + break; + case "LIQUID": + case 1: + message.shardingStrategy = 1; + break; + case "BALANCED": + case 2: + message.shardingStrategy = 2; + break; + } return message; }; /** - * Creates a plain object from a SplitReadStreamResponse message. Also converts values to other types if specified. + * Creates a plain object from a ReadSession message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @static - * @param {google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse} message SplitReadStreamResponse + * @param {google.cloud.bigquery.storage.v1beta1.ReadSession} message ReadSession * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SplitReadStreamResponse.toObject = function toObject(message, options) { + ReadSession.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.streams = []; if (options.defaults) { - object.primaryStream = null; - object.remainderStream = null; + object.name = ""; + object.expireTime = null; + object.tableReference = null; + object.tableModifiers = null; + object.shardingStrategy = options.enums === String ? "SHARDING_STRATEGY_UNSPECIFIED" : 0; } - if (message.primaryStream != null && message.hasOwnProperty("primaryStream")) - object.primaryStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.toObject(message.primaryStream, options); - if (message.remainderStream != null && message.hasOwnProperty("remainderStream")) - object.remainderStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.toObject(message.remainderStream, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.streams && message.streams.length) { + object.streams = []; + for (var j = 0; j < message.streams.length; ++j) + object.streams[j] = $root.google.cloud.bigquery.storage.v1beta1.Stream.toObject(message.streams[j], options); + } + if (message.avroSchema != null && message.hasOwnProperty("avroSchema")) { + object.avroSchema = $root.google.cloud.bigquery.storage.v1beta1.AvroSchema.toObject(message.avroSchema, options); + if (options.oneofs) + object.schema = "avroSchema"; + } + if (message.arrowSchema != null && message.hasOwnProperty("arrowSchema")) { + object.arrowSchema = $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema.toObject(message.arrowSchema, options); + if (options.oneofs) + object.schema = "arrowSchema"; + } + if (message.tableReference != null && message.hasOwnProperty("tableReference")) + object.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.toObject(message.tableReference, options); + if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) + object.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.toObject(message.tableModifiers, options); + if (message.shardingStrategy != null && message.hasOwnProperty("shardingStrategy")) + object.shardingStrategy = options.enums === String ? $root.google.cloud.bigquery.storage.v1beta1.ShardingStrategy[message.shardingStrategy] : message.shardingStrategy; return object; }; /** - * Converts this SplitReadStreamResponse to JSON. + * Converts this ReadSession to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @instance * @returns {Object.} JSON object */ - SplitReadStreamResponse.prototype.toJSON = function toJSON() { + ReadSession.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SplitReadStreamResponse; + return ReadSession; })(); - v1beta1.TableReference = (function() { + v1beta1.CreateReadSessionRequest = (function() { /** - * Properties of a TableReference. + * Properties of a CreateReadSessionRequest. * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface ITableReference - * @property {string|null} [projectId] TableReference projectId - * @property {string|null} [datasetId] TableReference datasetId - * @property {string|null} [tableId] TableReference tableId + * @interface ICreateReadSessionRequest + * @property {google.cloud.bigquery.storage.v1beta1.ITableReference|null} [tableReference] CreateReadSessionRequest tableReference + * @property {string|null} [parent] CreateReadSessionRequest parent + * @property {google.cloud.bigquery.storage.v1beta1.ITableModifiers|null} [tableModifiers] CreateReadSessionRequest tableModifiers + * @property {number|null} [requestedStreams] CreateReadSessionRequest requestedStreams + * @property {google.cloud.bigquery.storage.v1beta1.ITableReadOptions|null} [readOptions] CreateReadSessionRequest readOptions + * @property {google.cloud.bigquery.storage.v1beta1.DataFormat|null} [format] CreateReadSessionRequest format + * @property {google.cloud.bigquery.storage.v1beta1.ShardingStrategy|null} [shardingStrategy] CreateReadSessionRequest shardingStrategy */ /** - * Constructs a new TableReference. + * Constructs a new CreateReadSessionRequest. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a TableReference. - * @implements ITableReference + * @classdesc Represents a CreateReadSessionRequest. + * @implements ICreateReadSessionRequest * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.ITableReference=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest=} [properties] Properties to set */ - function TableReference(properties) { + function CreateReadSessionRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9149,103 +11182,155 @@ } /** - * TableReference projectId. - * @member {string} projectId - * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * CreateReadSessionRequest tableReference. + * @member {google.cloud.bigquery.storage.v1beta1.ITableReference|null|undefined} tableReference + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest * @instance */ - TableReference.prototype.projectId = ""; + CreateReadSessionRequest.prototype.tableReference = null; /** - * TableReference datasetId. - * @member {string} datasetId - * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * CreateReadSessionRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest * @instance */ - TableReference.prototype.datasetId = ""; + CreateReadSessionRequest.prototype.parent = ""; /** - * TableReference tableId. - * @member {string} tableId - * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * CreateReadSessionRequest tableModifiers. + * @member {google.cloud.bigquery.storage.v1beta1.ITableModifiers|null|undefined} tableModifiers + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest * @instance */ - TableReference.prototype.tableId = ""; + CreateReadSessionRequest.prototype.tableModifiers = null; /** - * Creates a new TableReference instance using the specified properties. + * CreateReadSessionRequest requestedStreams. + * @member {number} requestedStreams + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @instance + */ + CreateReadSessionRequest.prototype.requestedStreams = 0; + + /** + * CreateReadSessionRequest readOptions. + * @member {google.cloud.bigquery.storage.v1beta1.ITableReadOptions|null|undefined} readOptions + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @instance + */ + CreateReadSessionRequest.prototype.readOptions = null; + + /** + * CreateReadSessionRequest format. + * @member {google.cloud.bigquery.storage.v1beta1.DataFormat} format + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @instance + */ + CreateReadSessionRequest.prototype.format = 0; + + /** + * CreateReadSessionRequest shardingStrategy. + * @member {google.cloud.bigquery.storage.v1beta1.ShardingStrategy} shardingStrategy + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @instance + */ + CreateReadSessionRequest.prototype.shardingStrategy = 0; + + /** + * Creates a new CreateReadSessionRequest instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.ITableReference=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.TableReference} TableReference instance + * @param {google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest} CreateReadSessionRequest instance */ - TableReference.create = function create(properties) { - return new TableReference(properties); + CreateReadSessionRequest.create = function create(properties) { + return new CreateReadSessionRequest(properties); }; /** - * Encodes the specified TableReference message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableReference.verify|verify} messages. + * Encodes the specified CreateReadSessionRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.ITableReference} message TableReference message or plain object to encode + * @param {google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest} message CreateReadSessionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TableReference.encode = function encode(message, writer) { + CreateReadSessionRequest.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); + if (message.tableReference != null && Object.hasOwnProperty.call(message, "tableReference")) + $root.google.cloud.bigquery.storage.v1beta1.TableReference.encode(message.tableReference, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tableModifiers != null && Object.hasOwnProperty.call(message, "tableModifiers")) + $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.encode(message.tableModifiers, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestedStreams != null && Object.hasOwnProperty.call(message, "requestedStreams")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.requestedStreams); + if (message.readOptions != null && Object.hasOwnProperty.call(message, "readOptions")) + $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions.encode(message.readOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.format); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.parent); + if (message.shardingStrategy != null && Object.hasOwnProperty.call(message, "shardingStrategy")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.shardingStrategy); return writer; }; /** - * Encodes the specified TableReference message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableReference.verify|verify} messages. + * Encodes the specified CreateReadSessionRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.ITableReference} message TableReference message or plain object to encode + * @param {google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest} message CreateReadSessionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TableReference.encodeDelimited = function encodeDelimited(message, writer) { + CreateReadSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TableReference message from the specified reader or buffer. + * Decodes a CreateReadSessionRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1beta1.TableReference} TableReference + * @returns {google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest} CreateReadSessionRequest * @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) { + CreateReadSessionRequest.decode = function decode(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.storage.v1beta1.TableReference(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.projectId = reader.string(); + message.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.decode(reader, reader.uint32()); + break; + case 6: + message.parent = reader.string(); break; case 2: - message.datasetId = reader.string(); + message.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.decode(reader, reader.uint32()); break; case 3: - message.tableId = reader.string(); + message.requestedStreams = reader.int32(); break; - default: + case 4: + message.readOptions = $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions.decode(reader, reader.uint32()); + break; + case 5: + message.format = reader.int32(); + break; + case 7: + message.shardingStrategy = reader.int32(); + break; + default: reader.skipType(tag & 7); break; } @@ -9254,578 +11339,6290 @@ }; /** - * Decodes a TableReference message from the specified reader or buffer, length delimited. + * Decodes a CreateReadSessionRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1beta1.TableReference} TableReference + * @returns {google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest} CreateReadSessionRequest * @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) { + CreateReadSessionRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TableReference message. + * Verifies a CreateReadSessionRequest message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest * @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) { + CreateReadSessionRequest.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"; + if (message.tableReference != null && message.hasOwnProperty("tableReference")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.TableReference.verify(message.tableReference); + if (error) + return "tableReference." + error; + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.verify(message.tableModifiers); + if (error) + return "tableModifiers." + error; + } + if (message.requestedStreams != null && message.hasOwnProperty("requestedStreams")) + if (!$util.isInteger(message.requestedStreams)) + return "requestedStreams: integer expected"; + if (message.readOptions != null && message.hasOwnProperty("readOptions")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions.verify(message.readOptions); + if (error) + return "readOptions." + error; + } + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + case 3: + break; + } + if (message.shardingStrategy != null && message.hasOwnProperty("shardingStrategy")) + switch (message.shardingStrategy) { + default: + return "shardingStrategy: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates a TableReference message from a plain object. Also converts values to their respective internal types. + * Creates a CreateReadSessionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.TableReference} TableReference + * @returns {google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest} CreateReadSessionRequest */ - TableReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.TableReference) + CreateReadSessionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest) return object; - var message = new $root.google.cloud.bigquery.storage.v1beta1.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); + var message = new $root.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest(); + if (object.tableReference != null) { + if (typeof object.tableReference !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest.tableReference: object expected"); + message.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.fromObject(object.tableReference); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.tableModifiers != null) { + if (typeof object.tableModifiers !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest.tableModifiers: object expected"); + message.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.fromObject(object.tableModifiers); + } + if (object.requestedStreams != null) + message.requestedStreams = object.requestedStreams | 0; + if (object.readOptions != null) { + if (typeof object.readOptions !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest.readOptions: object expected"); + message.readOptions = $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions.fromObject(object.readOptions); + } + switch (object.format) { + case "DATA_FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "AVRO": + case 1: + message.format = 1; + break; + case "ARROW": + case 3: + message.format = 3; + break; + } + switch (object.shardingStrategy) { + case "SHARDING_STRATEGY_UNSPECIFIED": + case 0: + message.shardingStrategy = 0; + break; + case "LIQUID": + case 1: + message.shardingStrategy = 1; + break; + case "BALANCED": + case 2: + message.shardingStrategy = 2; + break; + } return message; }; /** - * Creates a plain object from a TableReference message. Also converts values to other types if specified. + * Creates a plain object from a CreateReadSessionRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.TableReference} message TableReference + * @param {google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest} message CreateReadSessionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TableReference.toObject = function toObject(message, options) { + CreateReadSessionRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.projectId = ""; - object.datasetId = ""; - object.tableId = ""; + object.tableReference = null; + object.tableModifiers = null; + object.requestedStreams = 0; + object.readOptions = null; + object.format = options.enums === String ? "DATA_FORMAT_UNSPECIFIED" : 0; + object.parent = ""; + object.shardingStrategy = options.enums === String ? "SHARDING_STRATEGY_UNSPECIFIED" : 0; } - 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; + if (message.tableReference != null && message.hasOwnProperty("tableReference")) + object.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.toObject(message.tableReference, options); + if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) + object.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.toObject(message.tableModifiers, options); + if (message.requestedStreams != null && message.hasOwnProperty("requestedStreams")) + object.requestedStreams = message.requestedStreams; + if (message.readOptions != null && message.hasOwnProperty("readOptions")) + object.readOptions = $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions.toObject(message.readOptions, options); + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.cloud.bigquery.storage.v1beta1.DataFormat[message.format] : message.format; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.shardingStrategy != null && message.hasOwnProperty("shardingStrategy")) + object.shardingStrategy = options.enums === String ? $root.google.cloud.bigquery.storage.v1beta1.ShardingStrategy[message.shardingStrategy] : message.shardingStrategy; return object; }; /** - * Converts this TableReference to JSON. + * Converts this CreateReadSessionRequest to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest * @instance * @returns {Object.} JSON object */ - TableReference.prototype.toJSON = function toJSON() { + CreateReadSessionRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TableReference; - })(); + return CreateReadSessionRequest; + })(); + + /** + * DataFormat enum. + * @name google.cloud.bigquery.storage.v1beta1.DataFormat + * @enum {number} + * @property {number} DATA_FORMAT_UNSPECIFIED=0 DATA_FORMAT_UNSPECIFIED value + * @property {number} AVRO=1 AVRO value + * @property {number} ARROW=3 ARROW value + */ + v1beta1.DataFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATA_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "AVRO"] = 1; + values[valuesById[3] = "ARROW"] = 3; + return values; + })(); + + /** + * ShardingStrategy enum. + * @name google.cloud.bigquery.storage.v1beta1.ShardingStrategy + * @enum {number} + * @property {number} SHARDING_STRATEGY_UNSPECIFIED=0 SHARDING_STRATEGY_UNSPECIFIED value + * @property {number} LIQUID=1 LIQUID value + * @property {number} BALANCED=2 BALANCED value + */ + v1beta1.ShardingStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHARDING_STRATEGY_UNSPECIFIED"] = 0; + values[valuesById[1] = "LIQUID"] = 1; + values[valuesById[2] = "BALANCED"] = 2; + return values; + })(); + + v1beta1.ReadRowsRequest = (function() { + + /** + * Properties of a ReadRowsRequest. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IReadRowsRequest + * @property {google.cloud.bigquery.storage.v1beta1.IStreamPosition|null} [readPosition] ReadRowsRequest readPosition + */ + + /** + * Constructs a new ReadRowsRequest. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a ReadRowsRequest. + * @implements IReadRowsRequest + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsRequest=} [properties] Properties to set + */ + function ReadRowsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadRowsRequest readPosition. + * @member {google.cloud.bigquery.storage.v1beta1.IStreamPosition|null|undefined} readPosition + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @instance + */ + ReadRowsRequest.prototype.readPosition = null; + + /** + * Creates a new ReadRowsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsRequest} ReadRowsRequest instance + */ + ReadRowsRequest.create = function create(properties) { + return new ReadRowsRequest(properties); + }; + + /** + * Encodes the specified ReadRowsRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsRequest} message ReadRowsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadRowsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readPosition != null && Object.hasOwnProperty.call(message, "readPosition")) + $root.google.cloud.bigquery.storage.v1beta1.StreamPosition.encode(message.readPosition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadRowsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsRequest} message ReadRowsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadRowsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadRowsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsRequest} ReadRowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadRowsRequest.decode = function decode(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.storage.v1beta1.ReadRowsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.readPosition = $root.google.cloud.bigquery.storage.v1beta1.StreamPosition.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadRowsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsRequest} ReadRowsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadRowsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadRowsRequest message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadRowsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readPosition != null && message.hasOwnProperty("readPosition")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.StreamPosition.verify(message.readPosition); + if (error) + return "readPosition." + error; + } + return null; + }; + + /** + * Creates a ReadRowsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsRequest} ReadRowsRequest + */ + ReadRowsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest(); + if (object.readPosition != null) { + if (typeof object.readPosition !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadRowsRequest.readPosition: object expected"); + message.readPosition = $root.google.cloud.bigquery.storage.v1beta1.StreamPosition.fromObject(object.readPosition); + } + return message; + }; + + /** + * Creates a plain object from a ReadRowsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ReadRowsRequest} message ReadRowsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadRowsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.readPosition = null; + if (message.readPosition != null && message.hasOwnProperty("readPosition")) + object.readPosition = $root.google.cloud.bigquery.storage.v1beta1.StreamPosition.toObject(message.readPosition, options); + return object; + }; + + /** + * Converts this ReadRowsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @instance + * @returns {Object.} JSON object + */ + ReadRowsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReadRowsRequest; + })(); + + v1beta1.StreamStatus = (function() { + + /** + * Properties of a StreamStatus. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IStreamStatus + * @property {number|Long|null} [estimatedRowCount] StreamStatus estimatedRowCount + * @property {number|null} [fractionConsumed] StreamStatus fractionConsumed + * @property {google.cloud.bigquery.storage.v1beta1.IProgress|null} [progress] StreamStatus progress + * @property {boolean|null} [isSplittable] StreamStatus isSplittable + */ + + /** + * Constructs a new StreamStatus. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a StreamStatus. + * @implements IStreamStatus + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IStreamStatus=} [properties] Properties to set + */ + function StreamStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamStatus estimatedRowCount. + * @member {number|Long} estimatedRowCount + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @instance + */ + StreamStatus.prototype.estimatedRowCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * StreamStatus fractionConsumed. + * @member {number} fractionConsumed + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @instance + */ + StreamStatus.prototype.fractionConsumed = 0; + + /** + * StreamStatus progress. + * @member {google.cloud.bigquery.storage.v1beta1.IProgress|null|undefined} progress + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @instance + */ + StreamStatus.prototype.progress = null; + + /** + * StreamStatus isSplittable. + * @member {boolean} isSplittable + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @instance + */ + StreamStatus.prototype.isSplittable = false; + + /** + * Creates a new StreamStatus instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IStreamStatus=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.StreamStatus} StreamStatus instance + */ + StreamStatus.create = function create(properties) { + return new StreamStatus(properties); + }; + + /** + * Encodes the specified StreamStatus message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IStreamStatus} message StreamStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.estimatedRowCount != null && Object.hasOwnProperty.call(message, "estimatedRowCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.estimatedRowCount); + if (message.fractionConsumed != null && Object.hasOwnProperty.call(message, "fractionConsumed")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.fractionConsumed); + if (message.isSplittable != null && Object.hasOwnProperty.call(message, "isSplittable")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isSplittable); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + $root.google.cloud.bigquery.storage.v1beta1.Progress.encode(message.progress, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamStatus message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IStreamStatus} message StreamStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.StreamStatus} StreamStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamStatus.decode = function decode(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.storage.v1beta1.StreamStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.estimatedRowCount = reader.int64(); + break; + case 2: + message.fractionConsumed = reader.float(); + break; + case 4: + message.progress = $root.google.cloud.bigquery.storage.v1beta1.Progress.decode(reader, reader.uint32()); + break; + case 3: + message.isSplittable = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.StreamStatus} StreamStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamStatus message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.estimatedRowCount != null && message.hasOwnProperty("estimatedRowCount")) + if (!$util.isInteger(message.estimatedRowCount) && !(message.estimatedRowCount && $util.isInteger(message.estimatedRowCount.low) && $util.isInteger(message.estimatedRowCount.high))) + return "estimatedRowCount: integer|Long expected"; + if (message.fractionConsumed != null && message.hasOwnProperty("fractionConsumed")) + if (typeof message.fractionConsumed !== "number") + return "fractionConsumed: number expected"; + if (message.progress != null && message.hasOwnProperty("progress")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.Progress.verify(message.progress); + if (error) + return "progress." + error; + } + if (message.isSplittable != null && message.hasOwnProperty("isSplittable")) + if (typeof message.isSplittable !== "boolean") + return "isSplittable: boolean expected"; + return null; + }; + + /** + * Creates a StreamStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.StreamStatus} StreamStatus + */ + StreamStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.StreamStatus) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.StreamStatus(); + if (object.estimatedRowCount != null) + if ($util.Long) + (message.estimatedRowCount = $util.Long.fromValue(object.estimatedRowCount)).unsigned = false; + else if (typeof object.estimatedRowCount === "string") + message.estimatedRowCount = parseInt(object.estimatedRowCount, 10); + else if (typeof object.estimatedRowCount === "number") + message.estimatedRowCount = object.estimatedRowCount; + else if (typeof object.estimatedRowCount === "object") + message.estimatedRowCount = new $util.LongBits(object.estimatedRowCount.low >>> 0, object.estimatedRowCount.high >>> 0).toNumber(); + if (object.fractionConsumed != null) + message.fractionConsumed = Number(object.fractionConsumed); + if (object.progress != null) { + if (typeof object.progress !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.StreamStatus.progress: object expected"); + message.progress = $root.google.cloud.bigquery.storage.v1beta1.Progress.fromObject(object.progress); + } + if (object.isSplittable != null) + message.isSplittable = Boolean(object.isSplittable); + return message; + }; + + /** + * Creates a plain object from a StreamStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @static + * @param {google.cloud.bigquery.storage.v1beta1.StreamStatus} message StreamStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamStatus.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.estimatedRowCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.estimatedRowCount = options.longs === String ? "0" : 0; + object.fractionConsumed = 0; + object.isSplittable = false; + object.progress = null; + } + if (message.estimatedRowCount != null && message.hasOwnProperty("estimatedRowCount")) + if (typeof message.estimatedRowCount === "number") + object.estimatedRowCount = options.longs === String ? String(message.estimatedRowCount) : message.estimatedRowCount; + else + object.estimatedRowCount = options.longs === String ? $util.Long.prototype.toString.call(message.estimatedRowCount) : options.longs === Number ? new $util.LongBits(message.estimatedRowCount.low >>> 0, message.estimatedRowCount.high >>> 0).toNumber() : message.estimatedRowCount; + if (message.fractionConsumed != null && message.hasOwnProperty("fractionConsumed")) + object.fractionConsumed = options.json && !isFinite(message.fractionConsumed) ? String(message.fractionConsumed) : message.fractionConsumed; + if (message.isSplittable != null && message.hasOwnProperty("isSplittable")) + object.isSplittable = message.isSplittable; + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = $root.google.cloud.bigquery.storage.v1beta1.Progress.toObject(message.progress, options); + return object; + }; + + /** + * Converts this StreamStatus to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @instance + * @returns {Object.} JSON object + */ + StreamStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StreamStatus; + })(); + + v1beta1.Progress = (function() { + + /** + * Properties of a Progress. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IProgress + * @property {number|null} [atResponseStart] Progress atResponseStart + * @property {number|null} [atResponseEnd] Progress atResponseEnd + */ + + /** + * Constructs a new Progress. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a Progress. + * @implements IProgress + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IProgress=} [properties] Properties to set + */ + function Progress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Progress atResponseStart. + * @member {number} atResponseStart + * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @instance + */ + Progress.prototype.atResponseStart = 0; + + /** + * Progress atResponseEnd. + * @member {number} atResponseEnd + * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @instance + */ + Progress.prototype.atResponseEnd = 0; + + /** + * Creates a new Progress instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IProgress=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.Progress} Progress instance + */ + Progress.create = function create(properties) { + return new Progress(properties); + }; + + /** + * Encodes the specified Progress message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Progress.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IProgress} message Progress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Progress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.atResponseStart != null && Object.hasOwnProperty.call(message, "atResponseStart")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.atResponseStart); + if (message.atResponseEnd != null && Object.hasOwnProperty.call(message, "atResponseEnd")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.atResponseEnd); + return writer; + }; + + /** + * Encodes the specified Progress message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Progress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IProgress} message Progress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Progress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Progress message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.Progress} Progress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Progress.decode = function decode(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.storage.v1beta1.Progress(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.atResponseStart = reader.float(); + break; + case 2: + message.atResponseEnd = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Progress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.Progress} Progress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Progress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Progress message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Progress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.atResponseStart != null && message.hasOwnProperty("atResponseStart")) + if (typeof message.atResponseStart !== "number") + return "atResponseStart: number expected"; + if (message.atResponseEnd != null && message.hasOwnProperty("atResponseEnd")) + if (typeof message.atResponseEnd !== "number") + return "atResponseEnd: number expected"; + return null; + }; + + /** + * Creates a Progress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.Progress} Progress + */ + Progress.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.Progress) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.Progress(); + if (object.atResponseStart != null) + message.atResponseStart = Number(object.atResponseStart); + if (object.atResponseEnd != null) + message.atResponseEnd = Number(object.atResponseEnd); + return message; + }; + + /** + * Creates a plain object from a Progress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @static + * @param {google.cloud.bigquery.storage.v1beta1.Progress} message Progress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Progress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.atResponseStart = 0; + object.atResponseEnd = 0; + } + if (message.atResponseStart != null && message.hasOwnProperty("atResponseStart")) + object.atResponseStart = options.json && !isFinite(message.atResponseStart) ? String(message.atResponseStart) : message.atResponseStart; + if (message.atResponseEnd != null && message.hasOwnProperty("atResponseEnd")) + object.atResponseEnd = options.json && !isFinite(message.atResponseEnd) ? String(message.atResponseEnd) : message.atResponseEnd; + return object; + }; + + /** + * Converts this Progress to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @instance + * @returns {Object.} JSON object + */ + Progress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Progress; + })(); + + v1beta1.ThrottleStatus = (function() { + + /** + * Properties of a ThrottleStatus. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IThrottleStatus + * @property {number|null} [throttlePercent] ThrottleStatus throttlePercent + */ + + /** + * Constructs a new ThrottleStatus. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a ThrottleStatus. + * @implements IThrottleStatus + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IThrottleStatus=} [properties] Properties to set + */ + function ThrottleStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ThrottleStatus throttlePercent. + * @member {number} throttlePercent + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @instance + */ + ThrottleStatus.prototype.throttlePercent = 0; + + /** + * Creates a new ThrottleStatus instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IThrottleStatus=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.ThrottleStatus} ThrottleStatus instance + */ + ThrottleStatus.create = function create(properties) { + return new ThrottleStatus(properties); + }; + + /** + * Encodes the specified ThrottleStatus message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ThrottleStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IThrottleStatus} message ThrottleStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThrottleStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.throttlePercent != null && Object.hasOwnProperty.call(message, "throttlePercent")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.throttlePercent); + return writer; + }; + + /** + * Encodes the specified ThrottleStatus message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ThrottleStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IThrottleStatus} message ThrottleStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThrottleStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ThrottleStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.ThrottleStatus} ThrottleStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThrottleStatus.decode = function decode(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.storage.v1beta1.ThrottleStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.throttlePercent = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ThrottleStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.ThrottleStatus} ThrottleStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThrottleStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ThrottleStatus message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ThrottleStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.throttlePercent != null && message.hasOwnProperty("throttlePercent")) + if (!$util.isInteger(message.throttlePercent)) + return "throttlePercent: integer expected"; + return null; + }; + + /** + * Creates a ThrottleStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.ThrottleStatus} ThrottleStatus + */ + ThrottleStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus(); + if (object.throttlePercent != null) + message.throttlePercent = object.throttlePercent | 0; + return message; + }; + + /** + * Creates a plain object from a ThrottleStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ThrottleStatus} message ThrottleStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ThrottleStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.throttlePercent = 0; + if (message.throttlePercent != null && message.hasOwnProperty("throttlePercent")) + object.throttlePercent = message.throttlePercent; + return object; + }; + + /** + * Converts this ThrottleStatus to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @instance + * @returns {Object.} JSON object + */ + ThrottleStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ThrottleStatus; + })(); + + v1beta1.ReadRowsResponse = (function() { + + /** + * Properties of a ReadRowsResponse. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IReadRowsResponse + * @property {google.cloud.bigquery.storage.v1beta1.IAvroRows|null} [avroRows] ReadRowsResponse avroRows + * @property {google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch|null} [arrowRecordBatch] ReadRowsResponse arrowRecordBatch + * @property {number|Long|null} [rowCount] ReadRowsResponse rowCount + * @property {google.cloud.bigquery.storage.v1beta1.IStreamStatus|null} [status] ReadRowsResponse status + * @property {google.cloud.bigquery.storage.v1beta1.IThrottleStatus|null} [throttleStatus] ReadRowsResponse throttleStatus + */ + + /** + * Constructs a new ReadRowsResponse. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a ReadRowsResponse. + * @implements IReadRowsResponse + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsResponse=} [properties] Properties to set + */ + function ReadRowsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReadRowsResponse avroRows. + * @member {google.cloud.bigquery.storage.v1beta1.IAvroRows|null|undefined} avroRows + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.avroRows = null; + + /** + * ReadRowsResponse arrowRecordBatch. + * @member {google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch|null|undefined} arrowRecordBatch + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.arrowRecordBatch = null; + + /** + * ReadRowsResponse rowCount. + * @member {number|Long} rowCount + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.rowCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ReadRowsResponse status. + * @member {google.cloud.bigquery.storage.v1beta1.IStreamStatus|null|undefined} status + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.status = null; + + /** + * ReadRowsResponse throttleStatus. + * @member {google.cloud.bigquery.storage.v1beta1.IThrottleStatus|null|undefined} throttleStatus + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @instance + */ + ReadRowsResponse.prototype.throttleStatus = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReadRowsResponse rows. + * @member {"avroRows"|"arrowRecordBatch"|undefined} rows + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @instance + */ + Object.defineProperty(ReadRowsResponse.prototype, "rows", { + get: $util.oneOfGetter($oneOfFields = ["avroRows", "arrowRecordBatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReadRowsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} ReadRowsResponse instance + */ + ReadRowsResponse.create = function create(properties) { + return new ReadRowsResponse(properties); + }; + + /** + * Encodes the specified ReadRowsResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsResponse} message ReadRowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadRowsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.bigquery.storage.v1beta1.StreamStatus.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.avroRows != null && Object.hasOwnProperty.call(message, "avroRows")) + $root.google.cloud.bigquery.storage.v1beta1.AvroRows.encode(message.avroRows, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.arrowRecordBatch != null && Object.hasOwnProperty.call(message, "arrowRecordBatch")) + $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.encode(message.arrowRecordBatch, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.throttleStatus != null && Object.hasOwnProperty.call(message, "throttleStatus")) + $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus.encode(message.throttleStatus, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.rowCount != null && Object.hasOwnProperty.call(message, "rowCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.rowCount); + return writer; + }; + + /** + * Encodes the specified ReadRowsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsResponse} message ReadRowsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadRowsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadRowsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} ReadRowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadRowsResponse.decode = function decode(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.storage.v1beta1.ReadRowsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.avroRows = $root.google.cloud.bigquery.storage.v1beta1.AvroRows.decode(reader, reader.uint32()); + break; + case 4: + message.arrowRecordBatch = $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.decode(reader, reader.uint32()); + break; + case 6: + message.rowCount = reader.int64(); + break; + case 2: + message.status = $root.google.cloud.bigquery.storage.v1beta1.StreamStatus.decode(reader, reader.uint32()); + break; + case 5: + message.throttleStatus = $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadRowsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} ReadRowsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadRowsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadRowsResponse message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadRowsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.avroRows != null && message.hasOwnProperty("avroRows")) { + properties.rows = 1; + { + var error = $root.google.cloud.bigquery.storage.v1beta1.AvroRows.verify(message.avroRows); + if (error) + return "avroRows." + error; + } + } + if (message.arrowRecordBatch != null && message.hasOwnProperty("arrowRecordBatch")) { + if (properties.rows === 1) + return "rows: multiple values"; + properties.rows = 1; + { + var error = $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.verify(message.arrowRecordBatch); + if (error) + return "arrowRecordBatch." + error; + } + } + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (!$util.isInteger(message.rowCount) && !(message.rowCount && $util.isInteger(message.rowCount.low) && $util.isInteger(message.rowCount.high))) + return "rowCount: integer|Long expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.StreamStatus.verify(message.status); + if (error) + return "status." + error; + } + if (message.throttleStatus != null && message.hasOwnProperty("throttleStatus")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus.verify(message.throttleStatus); + if (error) + return "throttleStatus." + error; + } + return null; + }; + + /** + * Creates a ReadRowsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} ReadRowsResponse + */ + ReadRowsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.ReadRowsResponse) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.ReadRowsResponse(); + if (object.avroRows != null) { + if (typeof object.avroRows !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.avroRows: object expected"); + message.avroRows = $root.google.cloud.bigquery.storage.v1beta1.AvroRows.fromObject(object.avroRows); + } + if (object.arrowRecordBatch != null) { + if (typeof object.arrowRecordBatch !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.arrowRecordBatch: object expected"); + message.arrowRecordBatch = $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.fromObject(object.arrowRecordBatch); + } + if (object.rowCount != null) + if ($util.Long) + (message.rowCount = $util.Long.fromValue(object.rowCount)).unsigned = false; + else if (typeof object.rowCount === "string") + message.rowCount = parseInt(object.rowCount, 10); + else if (typeof object.rowCount === "number") + message.rowCount = object.rowCount; + else if (typeof object.rowCount === "object") + message.rowCount = new $util.LongBits(object.rowCount.low >>> 0, object.rowCount.high >>> 0).toNumber(); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.status: object expected"); + message.status = $root.google.cloud.bigquery.storage.v1beta1.StreamStatus.fromObject(object.status); + } + if (object.throttleStatus != null) { + if (typeof object.throttleStatus !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.throttleStatus: object expected"); + message.throttleStatus = $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus.fromObject(object.throttleStatus); + } + return message; + }; + + /** + * Creates a plain object from a ReadRowsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} message ReadRowsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadRowsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.status = null; + object.throttleStatus = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rowCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.rowCount = options.longs === String ? "0" : 0; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.bigquery.storage.v1beta1.StreamStatus.toObject(message.status, options); + if (message.avroRows != null && message.hasOwnProperty("avroRows")) { + object.avroRows = $root.google.cloud.bigquery.storage.v1beta1.AvroRows.toObject(message.avroRows, options); + if (options.oneofs) + object.rows = "avroRows"; + } + if (message.arrowRecordBatch != null && message.hasOwnProperty("arrowRecordBatch")) { + object.arrowRecordBatch = $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.toObject(message.arrowRecordBatch, options); + if (options.oneofs) + object.rows = "arrowRecordBatch"; + } + if (message.throttleStatus != null && message.hasOwnProperty("throttleStatus")) + object.throttleStatus = $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus.toObject(message.throttleStatus, options); + if (message.rowCount != null && message.hasOwnProperty("rowCount")) + if (typeof message.rowCount === "number") + object.rowCount = options.longs === String ? String(message.rowCount) : message.rowCount; + else + object.rowCount = options.longs === String ? $util.Long.prototype.toString.call(message.rowCount) : options.longs === Number ? new $util.LongBits(message.rowCount.low >>> 0, message.rowCount.high >>> 0).toNumber() : message.rowCount; + return object; + }; + + /** + * Converts this ReadRowsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @instance + * @returns {Object.} JSON object + */ + ReadRowsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReadRowsResponse; + })(); + + v1beta1.BatchCreateReadSessionStreamsRequest = (function() { + + /** + * Properties of a BatchCreateReadSessionStreamsRequest. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IBatchCreateReadSessionStreamsRequest + * @property {google.cloud.bigquery.storage.v1beta1.IReadSession|null} [session] BatchCreateReadSessionStreamsRequest session + * @property {number|null} [requestedStreams] BatchCreateReadSessionStreamsRequest requestedStreams + */ + + /** + * Constructs a new BatchCreateReadSessionStreamsRequest. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a BatchCreateReadSessionStreamsRequest. + * @implements IBatchCreateReadSessionStreamsRequest + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest=} [properties] Properties to set + */ + function BatchCreateReadSessionStreamsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateReadSessionStreamsRequest session. + * @member {google.cloud.bigquery.storage.v1beta1.IReadSession|null|undefined} session + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @instance + */ + BatchCreateReadSessionStreamsRequest.prototype.session = null; + + /** + * BatchCreateReadSessionStreamsRequest requestedStreams. + * @member {number} requestedStreams + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @instance + */ + BatchCreateReadSessionStreamsRequest.prototype.requestedStreams = 0; + + /** + * Creates a new BatchCreateReadSessionStreamsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest} BatchCreateReadSessionStreamsRequest instance + */ + BatchCreateReadSessionStreamsRequest.create = function create(properties) { + return new BatchCreateReadSessionStreamsRequest(properties); + }; + + /** + * Encodes the specified BatchCreateReadSessionStreamsRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest} message BatchCreateReadSessionStreamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateReadSessionStreamsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + $root.google.cloud.bigquery.storage.v1beta1.ReadSession.encode(message.session, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestedStreams != null && Object.hasOwnProperty.call(message, "requestedStreams")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.requestedStreams); + return writer; + }; + + /** + * Encodes the specified BatchCreateReadSessionStreamsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest} message BatchCreateReadSessionStreamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateReadSessionStreamsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateReadSessionStreamsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest} BatchCreateReadSessionStreamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateReadSessionStreamsRequest.decode = function decode(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.storage.v1beta1.BatchCreateReadSessionStreamsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.session = $root.google.cloud.bigquery.storage.v1beta1.ReadSession.decode(reader, reader.uint32()); + break; + case 2: + message.requestedStreams = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateReadSessionStreamsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest} BatchCreateReadSessionStreamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateReadSessionStreamsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateReadSessionStreamsRequest message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateReadSessionStreamsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.ReadSession.verify(message.session); + if (error) + return "session." + error; + } + if (message.requestedStreams != null && message.hasOwnProperty("requestedStreams")) + if (!$util.isInteger(message.requestedStreams)) + return "requestedStreams: integer expected"; + return null; + }; + + /** + * Creates a BatchCreateReadSessionStreamsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest} BatchCreateReadSessionStreamsRequest + */ + BatchCreateReadSessionStreamsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest(); + if (object.session != null) { + if (typeof object.session !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest.session: object expected"); + message.session = $root.google.cloud.bigquery.storage.v1beta1.ReadSession.fromObject(object.session); + } + if (object.requestedStreams != null) + message.requestedStreams = object.requestedStreams | 0; + return message; + }; + + /** + * Creates a plain object from a BatchCreateReadSessionStreamsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest} message BatchCreateReadSessionStreamsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateReadSessionStreamsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.session = null; + object.requestedStreams = 0; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = $root.google.cloud.bigquery.storage.v1beta1.ReadSession.toObject(message.session, options); + if (message.requestedStreams != null && message.hasOwnProperty("requestedStreams")) + object.requestedStreams = message.requestedStreams; + return object; + }; + + /** + * Converts this BatchCreateReadSessionStreamsRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @instance + * @returns {Object.} JSON object + */ + BatchCreateReadSessionStreamsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchCreateReadSessionStreamsRequest; + })(); + + v1beta1.BatchCreateReadSessionStreamsResponse = (function() { + + /** + * Properties of a BatchCreateReadSessionStreamsResponse. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IBatchCreateReadSessionStreamsResponse + * @property {Array.|null} [streams] BatchCreateReadSessionStreamsResponse streams + */ + + /** + * Constructs a new BatchCreateReadSessionStreamsResponse. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a BatchCreateReadSessionStreamsResponse. + * @implements IBatchCreateReadSessionStreamsResponse + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse=} [properties] Properties to set + */ + function BatchCreateReadSessionStreamsResponse(properties) { + this.streams = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateReadSessionStreamsResponse streams. + * @member {Array.} streams + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @instance + */ + BatchCreateReadSessionStreamsResponse.prototype.streams = $util.emptyArray; + + /** + * Creates a new BatchCreateReadSessionStreamsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse} BatchCreateReadSessionStreamsResponse instance + */ + BatchCreateReadSessionStreamsResponse.create = function create(properties) { + return new BatchCreateReadSessionStreamsResponse(properties); + }; + + /** + * Encodes the specified BatchCreateReadSessionStreamsResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse} message BatchCreateReadSessionStreamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateReadSessionStreamsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.streams != null && message.streams.length) + for (var i = 0; i < message.streams.length; ++i) + $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.streams[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchCreateReadSessionStreamsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse} message BatchCreateReadSessionStreamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateReadSessionStreamsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateReadSessionStreamsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse} BatchCreateReadSessionStreamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateReadSessionStreamsResponse.decode = function decode(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.storage.v1beta1.BatchCreateReadSessionStreamsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.streams && message.streams.length)) + message.streams = []; + message.streams.push($root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateReadSessionStreamsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse} BatchCreateReadSessionStreamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateReadSessionStreamsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateReadSessionStreamsResponse message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateReadSessionStreamsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.streams != null && message.hasOwnProperty("streams")) { + if (!Array.isArray(message.streams)) + return "streams: array expected"; + for (var i = 0; i < message.streams.length; ++i) { + var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.streams[i]); + if (error) + return "streams." + error; + } + } + return null; + }; + + /** + * Creates a BatchCreateReadSessionStreamsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse} BatchCreateReadSessionStreamsResponse + */ + BatchCreateReadSessionStreamsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse(); + if (object.streams) { + if (!Array.isArray(object.streams)) + throw TypeError(".google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse.streams: array expected"); + message.streams = []; + for (var i = 0; i < object.streams.length; ++i) { + if (typeof object.streams[i] !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse.streams: object expected"); + message.streams[i] = $root.google.cloud.bigquery.storage.v1beta1.Stream.fromObject(object.streams[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateReadSessionStreamsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse} message BatchCreateReadSessionStreamsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateReadSessionStreamsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.streams = []; + if (message.streams && message.streams.length) { + object.streams = []; + for (var j = 0; j < message.streams.length; ++j) + object.streams[j] = $root.google.cloud.bigquery.storage.v1beta1.Stream.toObject(message.streams[j], options); + } + return object; + }; + + /** + * Converts this BatchCreateReadSessionStreamsResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @instance + * @returns {Object.} JSON object + */ + BatchCreateReadSessionStreamsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchCreateReadSessionStreamsResponse; + })(); + + v1beta1.FinalizeStreamRequest = (function() { + + /** + * Properties of a FinalizeStreamRequest. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface IFinalizeStreamRequest + * @property {google.cloud.bigquery.storage.v1beta1.IStream|null} [stream] FinalizeStreamRequest stream + */ + + /** + * Constructs a new FinalizeStreamRequest. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a FinalizeStreamRequest. + * @implements IFinalizeStreamRequest + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest=} [properties] Properties to set + */ + function FinalizeStreamRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FinalizeStreamRequest stream. + * @member {google.cloud.bigquery.storage.v1beta1.IStream|null|undefined} stream + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @instance + */ + FinalizeStreamRequest.prototype.stream = null; + + /** + * Creates a new FinalizeStreamRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest} FinalizeStreamRequest instance + */ + FinalizeStreamRequest.create = function create(properties) { + return new FinalizeStreamRequest(properties); + }; + + /** + * Encodes the specified FinalizeStreamRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest} message FinalizeStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FinalizeStreamRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stream != null && Object.hasOwnProperty.call(message, "stream")) + $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.stream, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FinalizeStreamRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest} message FinalizeStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FinalizeStreamRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FinalizeStreamRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest} FinalizeStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FinalizeStreamRequest.decode = function decode(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.storage.v1beta1.FinalizeStreamRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FinalizeStreamRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest} FinalizeStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FinalizeStreamRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FinalizeStreamRequest message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FinalizeStreamRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stream != null && message.hasOwnProperty("stream")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.stream); + if (error) + return "stream." + error; + } + return null; + }; + + /** + * Creates a FinalizeStreamRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest} FinalizeStreamRequest + */ + FinalizeStreamRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest(); + if (object.stream != null) { + if (typeof object.stream !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest.stream: object expected"); + message.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.fromObject(object.stream); + } + return message; + }; + + /** + * Creates a plain object from a FinalizeStreamRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest} message FinalizeStreamRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FinalizeStreamRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.stream = null; + if (message.stream != null && message.hasOwnProperty("stream")) + object.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.toObject(message.stream, options); + return object; + }; + + /** + * Converts this FinalizeStreamRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @instance + * @returns {Object.} JSON object + */ + FinalizeStreamRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FinalizeStreamRequest; + })(); + + v1beta1.SplitReadStreamRequest = (function() { + + /** + * Properties of a SplitReadStreamRequest. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface ISplitReadStreamRequest + * @property {google.cloud.bigquery.storage.v1beta1.IStream|null} [originalStream] SplitReadStreamRequest originalStream + * @property {number|null} [fraction] SplitReadStreamRequest fraction + */ + + /** + * Constructs a new SplitReadStreamRequest. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a SplitReadStreamRequest. + * @implements ISplitReadStreamRequest + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest=} [properties] Properties to set + */ + function SplitReadStreamRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SplitReadStreamRequest originalStream. + * @member {google.cloud.bigquery.storage.v1beta1.IStream|null|undefined} originalStream + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @instance + */ + SplitReadStreamRequest.prototype.originalStream = null; + + /** + * SplitReadStreamRequest fraction. + * @member {number} fraction + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @instance + */ + SplitReadStreamRequest.prototype.fraction = 0; + + /** + * Creates a new SplitReadStreamRequest instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest} SplitReadStreamRequest instance + */ + SplitReadStreamRequest.create = function create(properties) { + return new SplitReadStreamRequest(properties); + }; + + /** + * Encodes the specified SplitReadStreamRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest} message SplitReadStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitReadStreamRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.originalStream != null && Object.hasOwnProperty.call(message, "originalStream")) + $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.originalStream, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fraction != null && Object.hasOwnProperty.call(message, "fraction")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.fraction); + return writer; + }; + + /** + * Encodes the specified SplitReadStreamRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest} message SplitReadStreamRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitReadStreamRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SplitReadStreamRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest} SplitReadStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitReadStreamRequest.decode = function decode(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.storage.v1beta1.SplitReadStreamRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.originalStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); + break; + case 2: + message.fraction = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SplitReadStreamRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest} SplitReadStreamRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitReadStreamRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SplitReadStreamRequest message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SplitReadStreamRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.originalStream != null && message.hasOwnProperty("originalStream")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.originalStream); + if (error) + return "originalStream." + error; + } + if (message.fraction != null && message.hasOwnProperty("fraction")) + if (typeof message.fraction !== "number") + return "fraction: number expected"; + return null; + }; + + /** + * Creates a SplitReadStreamRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest} SplitReadStreamRequest + */ + SplitReadStreamRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest(); + if (object.originalStream != null) { + if (typeof object.originalStream !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest.originalStream: object expected"); + message.originalStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.fromObject(object.originalStream); + } + if (object.fraction != null) + message.fraction = Number(object.fraction); + return message; + }; + + /** + * Creates a plain object from a SplitReadStreamRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @static + * @param {google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest} message SplitReadStreamRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SplitReadStreamRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.originalStream = null; + object.fraction = 0; + } + if (message.originalStream != null && message.hasOwnProperty("originalStream")) + object.originalStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.toObject(message.originalStream, options); + if (message.fraction != null && message.hasOwnProperty("fraction")) + object.fraction = options.json && !isFinite(message.fraction) ? String(message.fraction) : message.fraction; + return object; + }; + + /** + * Converts this SplitReadStreamRequest to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @instance + * @returns {Object.} JSON object + */ + SplitReadStreamRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SplitReadStreamRequest; + })(); + + v1beta1.SplitReadStreamResponse = (function() { + + /** + * Properties of a SplitReadStreamResponse. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface ISplitReadStreamResponse + * @property {google.cloud.bigquery.storage.v1beta1.IStream|null} [primaryStream] SplitReadStreamResponse primaryStream + * @property {google.cloud.bigquery.storage.v1beta1.IStream|null} [remainderStream] SplitReadStreamResponse remainderStream + */ + + /** + * Constructs a new SplitReadStreamResponse. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a SplitReadStreamResponse. + * @implements ISplitReadStreamResponse + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse=} [properties] Properties to set + */ + function SplitReadStreamResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SplitReadStreamResponse primaryStream. + * @member {google.cloud.bigquery.storage.v1beta1.IStream|null|undefined} primaryStream + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @instance + */ + SplitReadStreamResponse.prototype.primaryStream = null; + + /** + * SplitReadStreamResponse remainderStream. + * @member {google.cloud.bigquery.storage.v1beta1.IStream|null|undefined} remainderStream + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @instance + */ + SplitReadStreamResponse.prototype.remainderStream = null; + + /** + * Creates a new SplitReadStreamResponse instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse} SplitReadStreamResponse instance + */ + SplitReadStreamResponse.create = function create(properties) { + return new SplitReadStreamResponse(properties); + }; + + /** + * Encodes the specified SplitReadStreamResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse} message SplitReadStreamResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitReadStreamResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.primaryStream != null && Object.hasOwnProperty.call(message, "primaryStream")) + $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.primaryStream, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.remainderStream != null && Object.hasOwnProperty.call(message, "remainderStream")) + $root.google.cloud.bigquery.storage.v1beta1.Stream.encode(message.remainderStream, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SplitReadStreamResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse} message SplitReadStreamResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SplitReadStreamResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SplitReadStreamResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse} SplitReadStreamResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitReadStreamResponse.decode = function decode(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.storage.v1beta1.SplitReadStreamResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.primaryStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); + break; + case 2: + message.remainderStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SplitReadStreamResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse} SplitReadStreamResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SplitReadStreamResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SplitReadStreamResponse message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SplitReadStreamResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.primaryStream != null && message.hasOwnProperty("primaryStream")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.primaryStream); + if (error) + return "primaryStream." + error; + } + if (message.remainderStream != null && message.hasOwnProperty("remainderStream")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.remainderStream); + if (error) + return "remainderStream." + error; + } + return null; + }; + + /** + * Creates a SplitReadStreamResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse} SplitReadStreamResponse + */ + SplitReadStreamResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse(); + if (object.primaryStream != null) { + if (typeof object.primaryStream !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse.primaryStream: object expected"); + message.primaryStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.fromObject(object.primaryStream); + } + if (object.remainderStream != null) { + if (typeof object.remainderStream !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse.remainderStream: object expected"); + message.remainderStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.fromObject(object.remainderStream); + } + return message; + }; + + /** + * Creates a plain object from a SplitReadStreamResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @static + * @param {google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse} message SplitReadStreamResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SplitReadStreamResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.primaryStream = null; + object.remainderStream = null; + } + if (message.primaryStream != null && message.hasOwnProperty("primaryStream")) + object.primaryStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.toObject(message.primaryStream, options); + if (message.remainderStream != null && message.hasOwnProperty("remainderStream")) + object.remainderStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.toObject(message.remainderStream, options); + return object; + }; + + /** + * Converts this SplitReadStreamResponse to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @instance + * @returns {Object.} JSON object + */ + SplitReadStreamResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SplitReadStreamResponse; + })(); + + v1beta1.TableReference = (function() { + + /** + * Properties of a TableReference. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @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.storage.v1beta1 + * @classdesc Represents a TableReference. + * @implements ITableReference + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.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.storage.v1beta1.TableReference + * @instance + */ + TableReference.prototype.projectId = ""; + + /** + * TableReference datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * @instance + */ + TableReference.prototype.datasetId = ""; + + /** + * TableReference tableId. + * @member {string} tableId + * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * @instance + */ + TableReference.prototype.tableId = ""; + + /** + * Creates a new TableReference instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ITableReference=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.TableReference} TableReference instance + */ + TableReference.create = function create(properties) { + return new TableReference(properties); + }; + + /** + * Encodes the specified TableReference message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * @static + * @param {google.cloud.bigquery.storage.v1beta1.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.storage.v1beta1.TableReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * @static + * @param {google.cloud.bigquery.storage.v1beta1.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.storage.v1beta1.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.storage.v1beta1.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.storage.v1beta1.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.storage.v1beta1.TableReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.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.storage.v1beta1.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.storage.v1beta1.TableReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.TableReference} TableReference + */ + TableReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.TableReference) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.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.storage.v1beta1.TableReference + * @static + * @param {google.cloud.bigquery.storage.v1beta1.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.storage.v1beta1.TableReference + * @instance + * @returns {Object.} JSON object + */ + TableReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TableReference; + })(); + + v1beta1.TableModifiers = (function() { + + /** + * Properties of a TableModifiers. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @interface ITableModifiers + * @property {google.protobuf.ITimestamp|null} [snapshotTime] TableModifiers snapshotTime + */ + + /** + * Constructs a new TableModifiers. + * @memberof google.cloud.bigquery.storage.v1beta1 + * @classdesc Represents a TableModifiers. + * @implements ITableModifiers + * @constructor + * @param {google.cloud.bigquery.storage.v1beta1.ITableModifiers=} [properties] Properties to set + */ + function TableModifiers(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableModifiers snapshotTime. + * @member {google.protobuf.ITimestamp|null|undefined} snapshotTime + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * @instance + */ + TableModifiers.prototype.snapshotTime = null; + + /** + * Creates a new TableModifiers instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ITableModifiers=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.TableModifiers} TableModifiers instance + */ + TableModifiers.create = function create(properties) { + return new TableModifiers(properties); + }; + + /** + * Encodes the specified TableModifiers message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableModifiers.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ITableModifiers} message TableModifiers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableModifiers.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshotTime != null && Object.hasOwnProperty.call(message, "snapshotTime")) + $root.google.protobuf.Timestamp.encode(message.snapshotTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TableModifiers message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableModifiers.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * @static + * @param {google.cloud.bigquery.storage.v1beta1.ITableModifiers} message TableModifiers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableModifiers.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableModifiers message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1beta1.TableModifiers} TableModifiers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableModifiers.decode = function decode(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.storage.v1beta1.TableModifiers(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.snapshotTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableModifiers message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1beta1.TableModifiers} TableModifiers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableModifiers.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableModifiers message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableModifiers.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.snapshotTime); + if (error) + return "snapshotTime." + error; + } + return null; + }; + + /** + * Creates a TableModifiers message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1beta1.TableModifiers} TableModifiers + */ + TableModifiers.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.TableModifiers) + return object; + var message = new $root.google.cloud.bigquery.storage.v1beta1.TableModifiers(); + if (object.snapshotTime != null) { + if (typeof object.snapshotTime !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1beta1.TableModifiers.snapshotTime: object expected"); + message.snapshotTime = $root.google.protobuf.Timestamp.fromObject(object.snapshotTime); + } + return message; + }; + + /** + * Creates a plain object from a TableModifiers message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * @static + * @param {google.cloud.bigquery.storage.v1beta1.TableModifiers} message TableModifiers + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableModifiers.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.snapshotTime = null; + if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) + object.snapshotTime = $root.google.protobuf.Timestamp.toObject(message.snapshotTime, options); + return object; + }; + + /** + * Converts this TableModifiers to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * @instance + * @returns {Object.} JSON object + */ + TableModifiers.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TableModifiers; + })(); + + return v1beta1; + })(); + + return storage; + })(); + + return bigquery; + })(); + + return cloud; + })(); + + 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); + }; - v1beta1.TableModifiers = (function() { + /** + * 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; + })(); - /** - * Properties of a TableModifiers. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface ITableModifiers - * @property {google.protobuf.ITimestamp|null} [snapshotTime] TableModifiers snapshotTime - */ + /** + * 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; + })(); - /** - * Constructs a new TableModifiers. - * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a TableModifiers. - * @implements ITableModifiers - * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.ITableModifiers=} [properties] Properties to set - */ - function TableModifiers(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + return FieldDescriptorProto; + })(); - /** - * TableModifiers snapshotTime. - * @member {google.protobuf.ITimestamp|null|undefined} snapshotTime - * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers - * @instance - */ - TableModifiers.prototype.snapshotTime = null; + protobuf.OneofDescriptorProto = (function() { - /** - * Creates a new TableModifiers instance using the specified properties. - * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers - * @static - * @param {google.cloud.bigquery.storage.v1beta1.ITableModifiers=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.TableModifiers} TableModifiers instance - */ - TableModifiers.create = function create(properties) { - return new TableModifiers(properties); - }; + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ - /** - * Encodes the specified TableModifiers message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableModifiers.verify|verify} messages. - * @function encode - * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers - * @static - * @param {google.cloud.bigquery.storage.v1beta1.ITableModifiers} message TableModifiers message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TableModifiers.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.snapshotTime != null && Object.hasOwnProperty.call(message, "snapshotTime")) - $root.google.protobuf.Timestamp.encode(message.snapshotTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * 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]]; + } - /** - * Encodes the specified TableModifiers message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableModifiers.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers - * @static - * @param {google.cloud.bigquery.storage.v1beta1.ITableModifiers} message TableModifiers message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TableModifiers.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; - /** - * Decodes a TableModifiers message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.bigquery.storage.v1beta1.TableModifiers} TableModifiers - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TableModifiers.decode = function decode(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.storage.v1beta1.TableModifiers(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.snapshotTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; - /** - * Decodes a TableModifiers message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.bigquery.storage.v1beta1.TableModifiers} TableModifiers - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TableModifiers.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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); + }; - /** - * Verifies a TableModifiers message. - * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TableModifiers.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.snapshotTime); - if (error) - return "snapshotTime." + error; - } - return null; - }; + /** + * 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; + }; - /** - * Creates a TableModifiers message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.TableModifiers} TableModifiers - */ - TableModifiers.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.TableModifiers) - return object; - var message = new $root.google.cloud.bigquery.storage.v1beta1.TableModifiers(); - if (object.snapshotTime != null) { - if (typeof object.snapshotTime !== "object") - throw TypeError(".google.cloud.bigquery.storage.v1beta1.TableModifiers.snapshotTime: object expected"); - message.snapshotTime = $root.google.protobuf.Timestamp.fromObject(object.snapshotTime); - } - return message; - }; + /** + * 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(); + }; - /** - * Creates a plain object from a TableModifiers message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers - * @static - * @param {google.cloud.bigquery.storage.v1beta1.TableModifiers} message TableModifiers - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TableModifiers.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.snapshotTime = null; - if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) - object.snapshotTime = $root.google.protobuf.Timestamp.toObject(message.snapshotTime, options); - return object; - }; + /** + * 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; + }; - /** - * Converts this TableModifiers to JSON. - * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers - * @instance - * @returns {Object.} JSON object - */ - TableModifiers.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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()); + }; - return TableModifiers; - })(); + /** + * 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; + }; - return v1beta1; - })(); + /** + * 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; + }; - return storage; - })(); + /** + * 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; + }; - return bigquery; + /** + * 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; })(); - return cloud; - })(); + protobuf.EnumDescriptorProto = (function() { - google.api = (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 + */ - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; + /** + * 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]]; + } - api.Http = (function() { + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance */ + EnumDescriptorProto.prototype.value = $util.emptyArray; /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance */ - 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]]; - } + EnumDescriptorProto.prototype.options = null; /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - Http.prototype.rules = $util.emptyArray; + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto * @instance */ - Http.prototype.fullyDecodeReservedExpansion = false; + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; /** - * Creates a new Http instance using the specified properties. + * Creates a new EnumDescriptorProto instance using the specified properties. * @function create - * @memberof google.api.Http + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance */ - Http.create = function create(properties) { - return new Http(properties); + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); }; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.api.Http + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encode = function encode(message, writer) { + EnumDescriptorProto.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); + 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 Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.Http + * @memberof google.protobuf.EnumDescriptorProto * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encodeDelimited = function encodeDelimited(message, writer) { + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Http message from the specified reader or buffer. + * Decodes an EnumDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.api.Http + * @memberof google.protobuf.EnumDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http + * @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 */ - Http.decode = function decode(reader, length) { + EnumDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + 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: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + message.name = reader.string(); break; case 2: - message.fullyDecodeReservedExpansion = reader.bool(); + 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; + 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; }; /** - * 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 + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * 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; - } + 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]]; } - 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]); + /** + * 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 (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; - /** - * 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 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); + }; - /** - * 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 EnumReservedRange; + })(); - return Http; + return EnumDescriptorProto; })(); - api.HttpRule = (function() { + protobuf.EnumValueDescriptorProto = (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 + * 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 HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set */ - function HttpRule(properties) { - this.additionalBindings = []; + function EnumValueDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9833,209 +17630,101 @@ } /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * 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 + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ - HttpRule.prototype.responseBody = ""; + EnumValueDescriptorProto.prototype.name = ""; /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + EnumValueDescriptorProto.prototype.number = 0; /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto * @instance */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); + EnumValueDescriptorProto.prototype.options = null; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new EnumValueDescriptorProto instance using the specified properties. * @function create - * @memberof google.api.HttpRule + * @memberof google.protobuf.EnumValueDescriptorProto * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); }; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.api.HttpRule + * @memberof google.protobuf.EnumValueDescriptorProto * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encode = function encode(message, writer) { + EnumValueDescriptorProto.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); + 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 HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.HttpRule + * @memberof google.protobuf.EnumValueDescriptorProto * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.api.HttpRule + * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule + * @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 */ - HttpRule.decode = function decode(reader, length) { + EnumValueDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + 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.selector = reader.string(); + message.name = reader.string(); break; case 2: - message.get = reader.string(); + message.number = reader.int32(); break; case 3: - message.put = reader.string(); - break; - case 4: - message.post = reader.string(); - break; - case 5: - message["delete"] = reader.string(); - break; - case 6: - message.patch = reader.string(); - break; - case 8: - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - case 7: - message.body = reader.string(); - break; - case 12: - message.responseBody = reader.string(); - break; - case 11: - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -10046,240 +17735,132 @@ }; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.HttpRule + * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule + * @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 */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HttpRule message. + * Verifies an EnumValueDescriptorProto message. * @function verify - * @memberof google.api.HttpRule + * @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 */ - HttpRule.verify = function verify(message) { + EnumValueDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; } return null; }; /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.HttpRule + * @memberof google.protobuf.EnumValueDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); } return message; }; /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.HttpRule + * @memberof google.protobuf.EnumValueDescriptorProto * @static - * @param {google.api.HttpRule} message HttpRule + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HttpRule.toObject = function toObject(message, options) { + EnumValueDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + object.name = ""; + object.number = 0; + object.options = null; } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; + 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 HttpRule to JSON. + * Converts this EnumValueDescriptorProto to JSON. * @function toJSON - * @memberof google.api.HttpRule + * @memberof google.protobuf.EnumValueDescriptorProto * @instance * @returns {Object.} JSON object */ - HttpRule.prototype.toJSON = function toJSON() { + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HttpRule; + return EnumValueDescriptorProto; })(); - api.CustomHttpPattern = (function() { + protobuf.ServiceDescriptorProto = (function() { /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path + * 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 CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set */ - function CustomHttpPattern(properties) { + function ServiceDescriptorProto(properties) { + this.method = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10287,88 +17868,104 @@ } /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto * @instance */ - CustomHttpPattern.prototype.kind = ""; + ServiceDescriptorProto.prototype.name = ""; /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto * @instance */ - CustomHttpPattern.prototype.path = ""; + ServiceDescriptorProto.prototype.method = $util.emptyArray; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * 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.api.CustomHttpPattern + * @memberof google.protobuf.ServiceDescriptorProto * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); }; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.ServiceDescriptorProto * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encode = function encode(message, writer) { + ServiceDescriptorProto.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); + 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 CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.ServiceDescriptorProto * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.api.CustomHttpPattern + * @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.api.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decode = function decode(reader, length) { + ServiceDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + 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.kind = reader.string(); + message.name = reader.string(); break; case 2: - message.path = reader.string(); + 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); @@ -10379,148 +17976,152 @@ }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CustomHttpPattern message. + * Verifies a ServiceDescriptorProto message. * @function verify - * @memberof google.api.CustomHttpPattern + * @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 */ - CustomHttpPattern.verify = function verify(message) { + ServiceDescriptorProto.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.ServiceDescriptorProto * @static * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); + var message = new $root.google.protobuf.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 CustomHttpPattern message. Also converts values to other types if specified. + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.ServiceDescriptorProto * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomHttpPattern.toObject = function toObject(message, options) { + ServiceDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.method = []; if (options.defaults) { - object.kind = ""; - object.path = ""; + object.name = ""; + object.options = null; } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.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 CustomHttpPattern to JSON. + * Converts this ServiceDescriptorProto to JSON. * @function toJSON - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.ServiceDescriptorProto * @instance * @returns {Object.} JSON object */ - CustomHttpPattern.prototype.toJSON = function toJSON() { + ServiceDescriptorProto.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 - * @property {number} UNORDERED_LIST=6 UNORDERED_LIST 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; - values[valuesById[6] = "UNORDERED_LIST"] = 6; - return values; + return ServiceDescriptorProto; })(); - api.ResourceDescriptor = (function() { + protobuf.MethodDescriptorProto = (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 - * @property {Array.|null} [style] ResourceDescriptor style + * 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 ResourceDescriptor. - * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; + function MethodDescriptorProto(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10528,167 +18129,140 @@ } /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; - - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto * @instance */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; + MethodDescriptorProto.prototype.name = ""; /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto * @instance */ - ResourceDescriptor.prototype.nameField = ""; + MethodDescriptorProto.prototype.inputType = ""; /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto * @instance */ - ResourceDescriptor.prototype.history = 0; + MethodDescriptorProto.prototype.outputType = ""; /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto * @instance */ - ResourceDescriptor.prototype.plural = ""; + MethodDescriptorProto.prototype.options = null; /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto * @instance */ - ResourceDescriptor.prototype.singular = ""; + MethodDescriptorProto.prototype.clientStreaming = false; /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto * @instance */ - ResourceDescriptor.prototype.style = $util.emptyArray; + MethodDescriptorProto.prototype.serverStreaming = false; /** - * Creates a new ResourceDescriptor instance using the specified properties. + * Creates a new MethodDescriptorProto instance using the specified properties. * @function create - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); }; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. * @function encode - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encode = function encode(message, writer) { + MethodDescriptorProto.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); - 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(); - } + 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 ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * Decodes a MethodDescriptorProto message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceDescriptor + * @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.api.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.decode = function decode(reader, length) { + MethodDescriptorProto.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + 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.type = reader.string(); + message.name = reader.string(); break; case 2: - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); + message.inputType = reader.string(); break; case 3: - message.nameField = reader.string(); + message.outputType = reader.string(); break; case 4: - message.history = reader.int32(); + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); break; case 5: - message.plural = reader.string(); + message.clientStreaming = reader.bool(); 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()); + message.serverStreaming = reader.bool(); break; default: reader.skipType(tag & 7); @@ -10699,335 +18273,531 @@ }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.MethodDescriptorProto * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceDescriptor message. + * Verifies a MethodDescriptorProto message. * @function verify - * @memberof google.api.ResourceDescriptor + * @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 */ - ResourceDescriptor.verify = function verify(message) { + MethodDescriptorProto.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"; - 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; - }; - - /** - * 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 (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 (object.plural != null) - 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; - } + 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 ResourceDescriptor message. Also converts values to other types if specified. + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.MethodDescriptorProto * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceDescriptor.toObject = function toObject(message, options) { + MethodDescriptorProto.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; - } 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; - if (message.style && message.style.length) { - object.style = []; - for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + object.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 ResourceDescriptor to JSON. - * @function toJSON - * @memberof google.api.ResourceDescriptor + * 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 - * @returns {Object.} JSON object */ - ResourceDescriptor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + FileOptions.prototype.deprecated = false; /** - * 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 + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance */ - 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; - })(); + FileOptions.prototype.ccEnableArenas = true; /** - * 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 + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance */ - ResourceDescriptor.Style = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; - return values; - })(); + FileOptions.prototype.objcClassPrefix = ""; - return ResourceDescriptor; - })(); + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; - api.ResourceReference = (function() { + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance */ + FileOptions.prototype.phpClassPrefix = ""; /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference - * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance */ - function ResourceReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + FileOptions.prototype.phpNamespace = ""; /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions * @instance */ - ResourceReference.prototype.type = ""; + FileOptions.prototype.phpMetadataNamespace = ""; /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions * @instance */ - ResourceReference.prototype.childType = ""; + FileOptions.prototype.rubyPackage = ""; /** - * Creates a new ResourceReference instance using the specified properties. + * 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.api.ResourceReference + * @memberof google.protobuf.FileOptions * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); + FileOptions.create = function create(properties) { + return new FileOptions(properties); }; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. * @function encode - * @memberof google.api.ResourceReference + * @memberof google.protobuf.FileOptions * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encode = function encode(message, writer) { + FileOptions.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); + 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 ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.protobuf.FileOptions * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * Decodes a FileOptions message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceReference + * @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.api.ResourceReference} ResourceReference + * @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 */ - ResourceReference.decode = function decode(reader, length) { + FileOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + 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.type = reader.string(); + 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 2: - message.childType = reader.string(); + 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); @@ -11038,129 +18808,352 @@ }; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes a FileOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.protobuf.FileOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference + * @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 */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { + FileOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceReference message. + * Verifies a FileOptions message. * @function verify - * @memberof google.api.ResourceReference + * @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 */ - ResourceReference.verify = function verify(message) { + FileOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) - if (!$util.isString(message.childType)) - return "childType: string expected"; + if (message.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 ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceReference + * @memberof google.protobuf.FileOptions * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.protobuf.FileOptions} FileOptions */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) return object; - var message = new $root.google.api.ResourceReference(); - if (object.type != null) - message.type = String(object.type); - if (object.childType != null) - message.childType = String(object.childType); + var message = new $root.google.protobuf.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 ResourceReference message. Also converts values to other types if specified. + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceReference + * @memberof google.protobuf.FileOptions * @static - * @param {google.api.ResourceReference} message ResourceReference + * @param {google.protobuf.FileOptions} message FileOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceReference.toObject = function toObject(message, options) { + 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.type = ""; - object.childType = ""; + 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); } - 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. + * Converts this FileOptions to JSON. * @function toJSON - * @memberof google.api.ResourceReference + * @memberof google.protobuf.FileOptions * @instance * @returns {Object.} JSON object */ - ResourceReference.prototype.toJSON = function toJSON() { + FileOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ResourceReference; - })(); - - return api; - })(); - - google.protobuf = (function() { + /** + * 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; + })(); - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; + return FileOptions; + })(); - protobuf.FileDescriptorSet = (function() { + protobuf.MessageOptions = (function() { /** - * Properties of a FileDescriptorSet. + * Properties of a MessageOptions. * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file + * @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 FileDescriptorSet. + * Constructs a new MessageOptions. * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set */ - function FileDescriptorSet(properties) { - this.file = []; + function MessageOptions(properties) { + this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11168,78 +19161,143 @@ } /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions * @instance */ - FileDescriptorSet.prototype.file = $util.emptyArray; + MessageOptions.prototype.messageSetWireFormat = false; /** - * Creates a new FileDescriptorSet instance using the specified properties. + * 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.FileDescriptorSet + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); }; /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorSet.encode = function encode(message, writer) { + MessageOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.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 FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. + * Decodes a MessageOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FileDescriptorSet + * @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.FileDescriptorSet} FileDescriptorSet + * @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 */ - FileDescriptorSet.decode = function decode(reader, length) { + 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.FileDescriptorSet(); + 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: - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + 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); @@ -11250,142 +19308,181 @@ }; /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.MessageOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @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 */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + MessageOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FileDescriptorSet message. + * Verifies a MessageOptions message. * @function verify - * @memberof google.protobuf.FileDescriptorSet + * @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 */ - FileDescriptorSet.verify = function verify(message) { + MessageOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (message.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 "file." + 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 FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.MessageOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @returns {google.protobuf.MessageOptions} MessageOptions */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + var message = new $root.google.protobuf.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 FileDescriptorSet message. Also converts values to other types if specified. + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.MessageOptions * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {google.protobuf.MessageOptions} message MessageOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileDescriptorSet.toObject = function toObject(message, options) { + MessageOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + object.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 FileDescriptorSet to JSON. + * Converts this MessageOptions to JSON. * @function toJSON - * @memberof google.protobuf.FileDescriptorSet + * @memberof google.protobuf.MessageOptions * @instance * @returns {Object.} JSON object */ - FileDescriptorSet.prototype.toJSON = function toJSON() { + MessageOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return FileDescriptorSet; + return MessageOptions; })(); - protobuf.FileDescriptorProto = (function() { + protobuf.FieldOptions = (function() { /** - * Properties of a FileDescriptorProto. + * Properties of a FieldOptions. * @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 + * @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 FileDescriptorProto. + * Constructs a new FieldOptions. * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; + 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) @@ -11393,249 +19490,193 @@ } /** - * 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 + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions * @instance */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + FieldOptions.prototype.ctype = 0; /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions * @instance */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + FieldOptions.prototype.packed = false; /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions * @instance */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; + FieldOptions.prototype.jstype = 0; /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions * @instance */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; + FieldOptions.prototype.lazy = false; /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions * @instance */ - FileDescriptorProto.prototype.service = $util.emptyArray; + FieldOptions.prototype.deprecated = false; /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions * @instance */ - FileDescriptorProto.prototype.extension = $util.emptyArray; + FieldOptions.prototype.weak = false; /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions * @instance */ - FileDescriptorProto.prototype.options = null; + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions * @instance */ - FileDescriptorProto.prototype.sourceCodeInfo = null; + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions * @instance */ - FileDescriptorProto.prototype.syntax = ""; + FieldOptions.prototype[".google.api.resourceReference"] = null; /** - * Creates a new FileDescriptorProto instance using the specified properties. + * Creates a new FieldOptions instance using the specified properties. * @function create - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); }; /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorProto.encode = function encode(message, writer) { + FieldOptions.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); + 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 FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. + * Decodes a FieldOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FileDescriptorProto + * @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.FileDescriptorProto} FileDescriptorProto + * @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 */ - FileDescriptorProto.decode = function decode(reader, length) { + FieldOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + 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.name = reader.string(); + message.ctype = reader.int32(); break; case 2: - message["package"] = reader.string(); + message.packed = reader.bool(); + break; + case 6: + message.jstype = reader.int32(); + break; + case 5: + message.lazy = reader.bool(); break; case 3: - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); + message.deprecated = reader.bool(); 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()); + message.weak = reader.bool(); break; - case 11: - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; + 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.weakDependency.push(reader.int32()); + message[".google.api.fieldBehavior"].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()); + message[".google.api.fieldBehavior"].push(reader.int32()); break; - case 12: - message.syntax = reader.string(); + case 1055: + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -11646,329 +19687,317 @@ }; /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.FieldOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @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 */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + FieldOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FileDescriptorProto message. + * Verifies a FieldOptions message. * @function verify - * @memberof google.protobuf.FileDescriptorProto + * @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 */ - FileDescriptorProto.verify = function verify(message) { + FieldOptions.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.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; } - } - 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.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.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 (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 "extension." + error; + return "uninterpretedOption." + error; } } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + 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: + case 6: + break; + } } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + 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 "sourceCodeInfo." + error; + return ".google.api.resourceReference." + 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. + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.FieldOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @returns {google.protobuf.FieldOptions} FieldOptions */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) 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]); - } + 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.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.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.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.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.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[".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; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + } } - 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[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); } - if (object.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. + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.FieldOptions * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {google.protobuf.FieldOptions} message FieldOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileDescriptorProto.toObject = function toObject(message, options) { + FieldOptions.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 = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; } 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); + 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.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.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.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; + 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.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; + 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 FileDescriptorProto to JSON. + * Converts this FieldOptions to JSON. * @function toJSON - * @memberof google.protobuf.FileDescriptorProto + * @memberof google.protobuf.FieldOptions * @instance * @returns {Object.} JSON object */ - FileDescriptorProto.prototype.toJSON = function toJSON() { + FieldOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return FileDescriptorProto; + /** + * 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.DescriptorProto = (function() { + protobuf.OneofOptions = (function() { /** - * Properties of a DescriptorProto. + * Properties of an OneofOptions. * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nestedType] DescriptorProto nestedType - * @property {Array.|null} [enumType] DescriptorProto enumType - * @property {Array.|null} [extensionRange] DescriptorProto extensionRange - * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reservedRange] DescriptorProto reservedRange - * @property {Array.|null} [reservedName] DescriptorProto reservedName + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption */ /** - * Constructs a new DescriptorProto. + * Constructs a new OneofOptions. * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; + function OneofOptions(properties) { + this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11976,216 +20005,78 @@ } /** - * 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 + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions * @instance */ - DescriptorProto.prototype.reservedName = $util.emptyArray; + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new DescriptorProto instance using the specified properties. + * Creates a new OneofOptions instance using the specified properties. * @function create - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.OneofOptions * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); }; /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.OneofOptions * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DescriptorProto.encode = function encode(message, writer) { + OneofOptions.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]); + 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 DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.OneofOptions * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DescriptorProto message from the specified reader or buffer. + * Decodes an OneofOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.DescriptorProto + * @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.DescriptorProto} DescriptorProto + * @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 */ - DescriptorProto.decode = function decode(reader, length) { + OneofOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 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()); + 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); @@ -12196,765 +20087,612 @@ }; /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.OneofOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @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 */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + OneofOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DescriptorProto message. + * Verifies an OneofOptions message. * @function verify - * @memberof google.protobuf.DescriptorProto + * @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 */ - DescriptorProto.verify = function verify(message) { + OneofOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.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 (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); if (error) - return "reservedRange." + error; + return "uninterpretedOption." + error; } } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } return null; }; /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.OneofOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @returns {google.protobuf.OneofOptions} OneofOptions */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) 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]); + 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]); } } - 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. + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.OneofOptions * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {google.protobuf.OneofOptions} message OneofOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DescriptorProto.toObject = function toObject(message, options) { + OneofOptions.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]; + 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 DescriptorProto to JSON. + * Converts this OneofOptions to JSON. * @function toJSON - * @memberof google.protobuf.DescriptorProto + * @memberof google.protobuf.OneofOptions * @instance * @returns {Object.} JSON object */ - DescriptorProto.prototype.toJSON = function toJSON() { + OneofOptions.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 - */ + return OneofOptions; + })(); - /** - * 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]]; - } + protobuf.EnumOptions = (function() { - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; + /** + * 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 + */ - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; + /** + * 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]]; + } - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; - /** - * 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); - }; + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; - /** - * 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; - }; + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * 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(); - }; + /** + * 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); + }; - /** - * 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; - }; + /** + * 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; + }; - /** - * 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()); - }; + /** + * 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(); + }; - /** - * 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; + /** + * 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 null; - }; + } + return message; + }; - /** - * 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; - }; + /** + * 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()); + }; - /** - * 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; + /** + * 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; } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); - return object; - }; + } + return null; + }; - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates 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; + }; - return ExtensionRange; - })(); + /** + * 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; + }; - DescriptorProto.ReservedRange = (function() { + /** + * 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); + }; - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ + return EnumOptions; + })(); - /** - * 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]]; - } + protobuf.EnumValueOptions = (function() { - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; + /** + * 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]]; + } - /** - * 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); - }; + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && 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; - }; + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * 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(); - }; + /** + * 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); + }; - /** - * 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; - }; + /** + * 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; + }; - /** - * 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()); - }; + /** + * 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(); + }; - /** - * 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; - }; + /** + * 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; + }; - /** - * 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; - }; + /** + * 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()); + }; - /** - * 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; + /** + * 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; } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; + } + 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; + }; - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from 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; + }; - return ReservedRange; - })(); + /** + * 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 DescriptorProto; + return EnumValueOptions; })(); - protobuf.ExtensionRangeOptions = (function() { + protobuf.ServiceOptions = (function() { /** - * Properties of an ExtensionRangeOptions. + * Properties of a ServiceOptions. * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @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 ExtensionRangeOptions. + * Constructs a new ServiceOptions. * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set */ - function ExtensionRangeOptions(properties) { + function ServiceOptions(properties) { this.uninterpretedOption = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -12963,79 +20701,118 @@ } /** - * ExtensionRangeOptions uninterpretedOption. + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.ServiceOptions * @instance */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * Creates a new ExtensionRangeOptions instance using the specified properties. + * 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.ExtensionRangeOptions + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); }; /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExtensionRangeOptions.encode = function encode(message, 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 ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * Decodes a ServiceOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.ExtensionRangeOptions + * @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.ExtensionRangeOptions} ExtensionRangeOptions + * @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 */ - ExtensionRangeOptions.decode = function decode(reader, length) { + ServiceOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + 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; @@ -13045,32 +20822,35 @@ }; /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.ServiceOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @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 */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExtensionRangeOptions message. + * Verifies a ServiceOptions message. * @function verify - * @memberof google.protobuf.ExtensionRangeOptions + * @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 */ - ExtensionRangeOptions.verify = function verify(message) { + 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"; @@ -13080,99 +20860,118 @@ return "uninterpretedOption." + error; } } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; return null; }; /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.ServiceOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @returns {google.protobuf.ServiceOptions} ServiceOptions */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); + 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.ExtensionRangeOptions.uninterpretedOption: array expected"); + 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.ExtensionRangeOptions.uninterpretedOption: object expected"); + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); return message; }; /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.ServiceOptions * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {google.protobuf.ServiceOptions} message ServiceOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExtensionRangeOptions.toObject = function toObject(message, options) { + ServiceOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; + if (options.defaults) { + object.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 ExtensionRangeOptions to JSON. + * Converts this ServiceOptions to JSON. * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions + * @memberof google.protobuf.ServiceOptions * @instance * @returns {Object.} JSON object */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { + ServiceOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExtensionRangeOptions; + return ServiceOptions; })(); - protobuf.FieldDescriptorProto = (function() { + protobuf.MethodOptions = (function() { /** - * Properties of a FieldDescriptorProto. + * Properties of a MethodOptions. * @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 + * @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 FieldDescriptorProto. + * Constructs a new MethodOptions. * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set */ - function FieldDescriptorProto(properties) { + 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) @@ -13180,205 +20979,133 @@ } /** - * 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 + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions * @instance */ - FieldDescriptorProto.prototype.defaultValue = ""; + MethodOptions.prototype.deprecated = false; /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions * @instance */ - FieldDescriptorProto.prototype.oneofIndex = 0; + MethodOptions.prototype.idempotencyLevel = 0; /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions * @instance */ - FieldDescriptorProto.prototype.jsonName = ""; + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions * @instance */ - FieldDescriptorProto.prototype.options = null; + MethodOptions.prototype[".google.api.http"] = null; /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions * @instance */ - FieldDescriptorProto.prototype.proto3Optional = false; + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; /** - * Creates a new FieldDescriptorProto instance using the specified properties. + * Creates a new MethodOptions instance using the specified properties. * @function create - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); }; /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encode - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldDescriptorProto.encode = function encode(message, writer) { + MethodOptions.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); + 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 FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * Decodes a MethodOptions message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FieldDescriptorProto + * @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.FieldDescriptorProto} FieldDescriptorProto + * @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 */ - FieldDescriptorProto.decode = function decode(reader, length) { + MethodOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - 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(); + case 33: + message.deprecated = reader.bool(); break; - case 9: - message.oneofIndex = reader.int32(); + case 34: + message.idempotencyLevel = reader.int32(); break; - case 10: - message.jsonName = reader.string(); + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; - case 8: - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + case 72295728: + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); break; - case 17: - message.proto3Optional = reader.bool(); + 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); @@ -13389,588 +21116,800 @@ }; /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.MethodOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @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 */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + MethodOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FieldDescriptorProto message. + * Verifies a MethodOptions message. * @function verify - * @memberof google.protobuf.FieldDescriptorProto + * @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 */ - FieldDescriptorProto.verify = function verify(message) { + MethodOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { + 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 "label: enum value expected"; + return "idempotencyLevel: enum value expected"; + case 0: 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.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.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 (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); if (error) - return "options." + error; + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; } - if (message.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. + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.MethodOptions * @static * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @returns {google.protobuf.MethodOptions} MethodOptions */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) 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; + 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 "TYPE_SINT32": - case 17: - message.type = 17; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; break; - case "TYPE_SINT64": - case 18: - message.type = 18; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; 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.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); } - if (object.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. + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.MethodOptions * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {google.protobuf.MethodOptions} message MethodOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldDescriptorProto.toObject = function toObject(message, options) { + 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.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; + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.api.http"] = null; } - 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; + 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 FieldDescriptorProto to JSON. + * Converts this MethodOptions to JSON. * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto + * @memberof google.protobuf.MethodOptions * @instance * @returns {Object.} JSON object */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { + MethodOptions.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 + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel * @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 + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value */ - FieldDescriptorProto.Label = (function() { + MethodOptions.IdempotencyLevel = (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; + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; return values; })(); - return FieldDescriptorProto; + return MethodOptions; })(); - protobuf.OneofDescriptorProto = (function() { + protobuf.UninterpretedOption = (function() { /** - * Properties of an OneofDescriptorProto. + * Properties of an UninterpretedOption. * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + * @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 OneofDescriptorProto. + * Constructs a new UninterpretedOption. * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @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 */ - 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]]; - } + UninterpretedOption.prototype.doubleValue = 0; /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - OneofDescriptorProto.prototype.name = ""; + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption * @instance */ - OneofDescriptorProto.prototype.options = null; + UninterpretedOption.prototype.aggregateValue = ""; /** - * Creates a new OneofDescriptorProto instance using the specified properties. + * Creates a new UninterpretedOption instance using the specified properties. * @function create - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); }; /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encode - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofDescriptorProto.encode = function encode(message, writer) { + UninterpretedOption.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(); + 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 OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto + * @memberof google.protobuf.UninterpretedOption * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * Decodes an UninterpretedOption message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.OneofDescriptorProto + * @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.OneofDescriptorProto} OneofDescriptorProto + * @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 */ - OneofDescriptorProto.decode = function decode(reader, length) { + UninterpretedOption.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; case 2: - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + 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; + 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; }; /** - * 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 + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * 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; + 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]]; } - 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) + /** + * 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; - 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 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); + }; - /** - * 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 NamePart; + })(); - return OneofDescriptorProto; + return UninterpretedOption; })(); - protobuf.EnumDescriptorProto = (function() { + protobuf.SourceCodeInfo = (function() { /** - * Properties of an EnumDescriptorProto. + * Properties of a SourceCodeInfo. * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange - * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location */ /** - * Constructs a new EnumDescriptorProto. + * Constructs a new SourceCodeInfo. * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; + function SourceCodeInfo(properties) { + this.location = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13978,136 +21917,78 @@ } /** - * 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 + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo * @instance */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + SourceCodeInfo.prototype.location = $util.emptyArray; /** - * Creates a new EnumDescriptorProto instance using the specified properties. + * Creates a new SourceCodeInfo instance using the specified properties. * @function create - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); }; /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumDescriptorProto.encode = function encode(message, writer) { + SourceCodeInfo.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]); + 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 EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * Decodes a SourceCodeInfo message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumDescriptorProto + * @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.EnumDescriptorProto} EnumDescriptorProto + * @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 */ - EnumDescriptorProto.decode = function decode(reader, length) { + SourceCodeInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.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()); + 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); @@ -14118,191 +21999,128 @@ }; /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.SourceCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @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 */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + SourceCodeInfo.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]); + + /** + * 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 "reservedRange." + error; + return "location." + error; } } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } return null; }; /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.SourceCodeInfo * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + var message = new $root.google.protobuf.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]); } } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } return message; }; /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.SourceCodeInfo * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumDescriptorProto.toObject = function toObject(message, options) { + SourceCodeInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; + if (options.arrays || options.defaults) + object.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 EnumDescriptorProto to JSON. + * Converts this SourceCodeInfo to JSON. * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto + * @memberof google.protobuf.SourceCodeInfo * @instance * @returns {Object.} JSON object */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { + SourceCodeInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - EnumDescriptorProto.EnumReservedRange = (function() { + SourceCodeInfo.Location = (function() { /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end + * 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 EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set */ - function EnumReservedRange(properties) { + 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) @@ -14310,88 +22128,152 @@ } /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ - EnumReservedRange.prototype.start = 0; + Location.prototype.path = $util.emptyArray; /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ - EnumReservedRange.prototype.end = 0; + Location.prototype.span = $util.emptyArray; /** - * Creates a new EnumReservedRange instance using the specified properties. + * 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.EnumDescriptorProto.EnumReservedRange + * @memberof google.protobuf.SourceCodeInfo.Location * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); + Location.create = function create(properties) { + return new Location(properties); }; /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @memberof google.protobuf.SourceCodeInfo.Location * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @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 */ - EnumReservedRange.encode = function encode(message, writer) { + Location.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.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 EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @memberof google.protobuf.SourceCodeInfo.Location * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @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 */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + Location.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumReservedRange message from the specified reader or buffer. + * Decodes a Location message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @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.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @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 */ - EnumReservedRange.decode = function decode(reader, length) { + 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.EnumDescriptorProto.EnumReservedRange(); + 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: - message.start = reader.int32(); + 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.end = reader.int32(); + 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); @@ -14402,359 +22284,182 @@ }; /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * Decodes a Location message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @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 */ - EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + Location.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumReservedRange message. + * Verifies a Location message. * @function verify - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @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 */ - EnumReservedRange.verify = function verify(message) { + Location.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.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.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; + 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 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()); - }; + return null; + }; - /** - * 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 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 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) + /** + * 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; - 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 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); + }; - /** - * 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 Location; + })(); - return EnumValueDescriptorProto; + return SourceCodeInfo; })(); - protobuf.ServiceDescriptorProto = (function() { + protobuf.GeneratedCodeInfo = (function() { /** - * Properties of a ServiceDescriptorProto. + * Properties of a GeneratedCodeInfo. * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation */ /** - * Constructs a new ServiceDescriptorProto. + * Constructs a new GeneratedCodeInfo. * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set */ - function ServiceDescriptorProto(properties) { - this.method = []; + function GeneratedCodeInfo(properties) { + this.annotation = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14762,104 +22467,78 @@ } /** - * 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 + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo * @instance */ - ServiceDescriptorProto.prototype.options = null; + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; /** - * Creates a new ServiceDescriptorProto instance using the specified properties. + * Creates a new GeneratedCodeInfo instance using the specified properties. * @function create - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); }; /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encode - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceDescriptorProto.encode = function encode(message, writer) { + GeneratedCodeInfo.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(); + 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 ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.GeneratedCodeInfo * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.ServiceDescriptorProto + * @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.ServiceDescriptorProto} ServiceDescriptorProto + * @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 */ - ServiceDescriptorProto.decode = function decode(reader, length) { + GeneratedCodeInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.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()); + 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); @@ -14870,473 +22549,404 @@ }; /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto + * @memberof google.protobuf.GeneratedCodeInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @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 */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ServiceDescriptorProto message. + * Verifies a GeneratedCodeInfo message. * @function verify - * @memberof google.protobuf.ServiceDescriptorProto + * @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 */ - ServiceDescriptorProto.verify = function verify(message) { + GeneratedCodeInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (message.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 "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]); + return "annotation." + error; } - } - 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); + } + return null; }; /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo * @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 + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo */ - 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; + 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; }; /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto + * 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.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + 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; }; /** - * 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 + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object */ - 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; + 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; - }; + 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()); - }; + /** + * 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 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; - }; + /** + * 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 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) + /** + * 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; - 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 Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this 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 Annotation; + })(); - return MethodDescriptorProto; + return GeneratedCodeInfo; })(); - protobuf.FileOptions = (function() { + protobuf.Timestamp = (function() { /** - * Properties of a FileOptions. + * Properties of a Timestamp. * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos */ /** - * Constructs a new FileOptions. + * Constructs a new Timestamp. * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions + * @classdesc Represents a Timestamp. + * @implements ITimestamp * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @param {google.protobuf.ITimestamp=} [properties] Properties to set */ - function FileOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.resourceDefinition"] = []; + function Timestamp(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15344,354 +22954,298 @@ } /** - * 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 + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp * @instance */ - FileOptions.prototype.goPackage = ""; + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp * @instance */ - FileOptions.prototype.ccGenericServices = false; + Timestamp.prototype.nanos = 0; /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.javaGenericServices = false; + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.pyGenericServices = false; + 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; + }; /** - * FileOptions phpGenericServices. - * @member {boolean} phpGenericServices - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.phpGenericServices = false; + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.deprecated = false; + 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; + }; /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.ccEnableArenas = true; + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.objcClassPrefix = ""; + 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; + }; /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.csharpNamespace = ""; + 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; + }; /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance + * 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 */ - FileOptions.prototype.swiftPrefix = ""; + 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; + }; /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp * @instance + * @returns {Object.} JSON object */ - FileOptions.prototype.phpClassPrefix = ""; + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; + return Timestamp; + })(); - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; + protobuf.DoubleValue = (function() { /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value */ - FileOptions.prototype.rubyPackage = ""; /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; + function DoubleValue(properties) { + if (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 .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue * @instance */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + DoubleValue.prototype.value = 0; /** - * Creates a new FileOptions instance using the specified properties. + * Creates a new DoubleValue instance using the specified properties. * @function create - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.DoubleValue * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); }; /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. * @function encode - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.DoubleValue * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileOptions.encode = function encode(message, writer) { + DoubleValue.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(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); return writer; }; /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.DoubleValue * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FileOptions message from the specified reader or buffer. + * Decodes a DoubleValue message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.DoubleValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions + * @returns {google.protobuf.DoubleValue} DoubleValue * @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) { + DoubleValue.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); 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())); + message.value = reader.double(); break; default: reader.skipType(tag & 7); @@ -15702,352 +23256,294 @@ }; /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue * @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 + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); + FloatValue.create = function create(properties) { + return new FloatValue(properties); }; /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - 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"; + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function 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.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { case 1: - case 2: - case 3: + message.value = reader.float(); + break; + default: + reader.skipType(tag & 7); 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; + return message; }; /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue * @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]); - } - } + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); return message; }; /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.FloatValue * @static - * @param {google.protobuf.FileOptions} message FileOptions + * @param {google.protobuf.FloatValue} message FloatValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileOptions.toObject = function toObject(message, options) { + FloatValue.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); - } + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; return object; }; /** - * Converts this FileOptions to JSON. + * Converts this FloatValue to JSON. * @function toJSON - * @memberof google.protobuf.FileOptions + * @memberof google.protobuf.FloatValue * @instance * @returns {Object.} JSON object */ - FileOptions.prototype.toJSON = function toJSON() { + FloatValue.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; + return FloatValue; })(); - protobuf.MessageOptions = (function() { + protobuf.Int64Value = (function() { /** - * Properties of a MessageOptions. + * Properties of an Int64Value. * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value */ /** - * Constructs a new MessageOptions. + * Constructs a new Int64Value. * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions + * @classdesc Represents an Int64Value. + * @implements IInt64Value * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @param {google.protobuf.IInt64Value=} [properties] Properties to set */ - function MessageOptions(properties) { - this.uninterpretedOption = []; + function Int64Value(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16055,143 +23551,276 @@ } /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value * @instance */ - MessageOptions.prototype.messageSetWireFormat = false; + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function 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.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.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.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value * @instance + * @returns {Object.} JSON object */ - MessageOptions.prototype.deprecated = false; + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value */ - MessageOptions.prototype.mapEntry = false; /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + function UInt64Value(properties) { + if (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 .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value * @instance */ - MessageOptions.prototype[".google.api.resource"] = null; + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * Creates a new MessageOptions instance using the specified properties. + * Creates a new UInt64Value instance using the specified properties. * @function create - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.UInt64Value * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); }; /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. * @function encode - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.UInt64Value * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageOptions.encode = function encode(message, writer) { + UInt64Value.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(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); return writer; }; /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.UInt64Value * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MessageOptions message from the specified reader or buffer. + * Decodes a UInt64Value message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.UInt64Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions + * @returns {google.protobuf.UInt64Value} UInt64Value * @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) { + UInt64Value.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); 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()); + message.value = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -16202,375 +23831,197 @@ }; /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.UInt64Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions + * @returns {google.protobuf.UInt64Value} UInt64Value * @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) { + UInt64Value.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MessageOptions message. + * Verifies a UInt64Value message. * @function verify - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.UInt64Value * @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) { + UInt64Value.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; - } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; return null; }; /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.UInt64Value * @static * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions + * @returns {google.protobuf.UInt64Value} UInt64Value */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) 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"]); - } + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); return message; }; /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.UInt64Value * @static - * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {google.protobuf.UInt64Value} message UInt64Value * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MessageOptions.toObject = function toObject(message, options) { + UInt64Value.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); + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; return object; }; /** - * Converts this MessageOptions to JSON. + * Converts this UInt64Value to JSON. * @function toJSON - * @memberof google.protobuf.MessageOptions + * @memberof google.protobuf.UInt64Value * @instance * @returns {Object.} JSON object */ - MessageOptions.prototype.toJSON = function toJSON() { + UInt64Value.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return MessageOptions; + return UInt64Value; })(); - protobuf.FieldOptions = (function() { + protobuf.Int32Value = (function() { /** - * Properties of a FieldOptions. + * Properties of an Int32Value. * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + * @interface IInt32Value + * @property {number|null} [value] Int32Value value */ /** - * Constructs a new FieldOptions. + * Constructs a new Int32Value. * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions + * @classdesc Represents an Int32Value. + * @implements IInt32Value * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @param {google.protobuf.IInt32Value=} [properties] Properties to set */ - function FieldOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; + function Int32Value(properties) { if (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 + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value * @instance */ - FieldOptions.prototype[".google.api.resourceReference"] = null; + Int32Value.prototype.value = 0; /** - * Creates a new FieldOptions instance using the specified properties. + * Creates a new Int32Value instance using the specified properties. * @function create - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.Int32Value * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); + Int32Value.create = function create(properties) { + return new Int32Value(properties); }; /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. * @function encode - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.Int32Value * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldOptions.encode = function encode(message, writer) { + Int32Value.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(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); return writer; }; /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.Int32Value * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FieldOptions message from the specified reader or buffer. + * Decodes an Int32Value message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.Int32Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions + * @returns {google.protobuf.Int32Value} Int32Value * @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) { + Int32Value.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); 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()); + message.value = reader.int32(); break; default: reader.skipType(tag & 7); @@ -16581,317 +24032,107 @@ }; /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * Decodes an Int32Value message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.Int32Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions + * @returns {google.protobuf.Int32Value} Int32Value * @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) { + Int32Value.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FieldOptions message. + * Verifies an Int32Value message. * @function verify - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.Int32Value * @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: - case 6: - break; - } - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } - return null; - }; - - /** - * 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; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; - break; - } - } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; return message; }; /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.Int32Value * @static - * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {google.protobuf.Int32Value} message Int32Value * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldOptions.toObject = function toObject(message, options) { + Int32Value.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); + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; return object; }; /** - * Converts this FieldOptions to JSON. + * Converts this Int32Value to JSON. * @function toJSON - * @memberof google.protobuf.FieldOptions + * @memberof google.protobuf.Int32Value * @instance * @returns {Object.} JSON object */ - FieldOptions.prototype.toJSON = function toJSON() { + Int32Value.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; + return Int32Value; })(); - protobuf.OneofOptions = (function() { + protobuf.UInt32Value = (function() { /** - * Properties of an OneofOptions. + * Properties of a UInt32Value. * @memberof google.protobuf - * @interface IOneofOptions - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value */ /** - * Constructs a new OneofOptions. + * Constructs a new UInt32Value. * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set */ - function OneofOptions(properties) { - this.uninterpretedOption = []; + function UInt32Value(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16899,78 +24140,75 @@ } /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value * @instance */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + UInt32Value.prototype.value = 0; /** - * Creates a new OneofOptions instance using the specified properties. + * Creates a new UInt32Value instance using the specified properties. * @function create - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.UInt32Value * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); }; /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. * @function encode - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.UInt32Value * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofOptions.encode = function encode(message, writer) { + UInt32Value.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); return writer; }; /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.UInt32Value * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OneofOptions message from the specified reader or buffer. + * Decodes a UInt32Value message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.UInt32Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions + * @returns {google.protobuf.UInt32Value} UInt32Value * @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) { + UInt32Value.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + case 1: + message.value = reader.uint32(); break; default: reader.skipType(tag & 7); @@ -16981,127 +24219,107 @@ }; /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.UInt32Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions + * @returns {google.protobuf.UInt32Value} UInt32Value * @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) { + UInt32Value.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OneofOptions message. + * Verifies a UInt32Value message. * @function verify - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.UInt32Value * @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) { + UInt32Value.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; return null; }; /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.UInt32Value * @static * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions + * @returns {google.protobuf.UInt32Value} UInt32Value */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; return message; }; /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.UInt32Value * @static - * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {google.protobuf.UInt32Value} message UInt32Value * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OneofOptions.toObject = function toObject(message, options) { + UInt32Value.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; return object; }; /** - * Converts this OneofOptions to JSON. + * Converts this UInt32Value to JSON. * @function toJSON - * @memberof google.protobuf.OneofOptions + * @memberof google.protobuf.UInt32Value * @instance * @returns {Object.} JSON object */ - OneofOptions.prototype.toJSON = function toJSON() { + UInt32Value.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return OneofOptions; + return UInt32Value; })(); - protobuf.EnumOptions = (function() { + protobuf.BoolValue = (function() { /** - * Properties of an EnumOptions. + * Properties of a BoolValue. * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value */ /** - * Constructs a new EnumOptions. + * Constructs a new BoolValue. * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions + * @classdesc Represents a BoolValue. + * @implements IBoolValue * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @param {google.protobuf.IBoolValue=} [properties] Properties to set */ - function EnumOptions(properties) { - this.uninterpretedOption = []; + function BoolValue(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17109,104 +24327,75 @@ } /** - * 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 + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue * @instance */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + BoolValue.prototype.value = false; /** - * Creates a new EnumOptions instance using the specified properties. + * Creates a new BoolValue instance using the specified properties. * @function create - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.BoolValue * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); + BoolValue.create = function create(properties) { + return new BoolValue(properties); }; /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.BoolValue * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumOptions.encode = function encode(message, writer) { + BoolValue.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(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); return writer; }; /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.BoolValue * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumOptions message from the specified reader or buffer. + * Decodes a BoolValue message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.BoolValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions + * @returns {google.protobuf.BoolValue} BoolValue * @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) { + BoolValue.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); 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())); + case 1: + message.value = reader.bool(); break; default: reader.skipType(tag & 7); @@ -17217,144 +24406,107 @@ }; /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * Decodes a BoolValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.BoolValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions + * @returns {google.protobuf.BoolValue} BoolValue * @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) { + BoolValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumOptions message. + * Verifies a BoolValue message. * @function verify - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.BoolValue * @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) { + BoolValue.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; return null; }; /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.BoolValue * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions + * @returns {google.protobuf.BoolValue} BoolValue */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); return message; }; /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.BoolValue * @static - * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {google.protobuf.BoolValue} message BoolValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumOptions.toObject = function toObject(message, options) { + BoolValue.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); - } + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; return object; }; /** - * Converts this EnumOptions to JSON. + * Converts this BoolValue to JSON. * @function toJSON - * @memberof google.protobuf.EnumOptions + * @memberof google.protobuf.BoolValue * @instance * @returns {Object.} JSON object */ - EnumOptions.prototype.toJSON = function toJSON() { + BoolValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return EnumOptions; + return BoolValue; })(); - protobuf.EnumValueOptions = (function() { + protobuf.StringValue = (function() { /** - * Properties of an EnumValueOptions. + * Properties of a StringValue. * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + * @interface IStringValue + * @property {string|null} [value] StringValue value */ /** - * Constructs a new EnumValueOptions. + * Constructs a new StringValue. * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions + * @classdesc Represents a StringValue. + * @implements IStringValue * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @param {google.protobuf.IStringValue=} [properties] Properties to set */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; + function StringValue(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17362,91 +24514,75 @@ } /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue * @instance */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + StringValue.prototype.value = ""; /** - * Creates a new EnumValueOptions instance using the specified properties. + * Creates a new StringValue instance using the specified properties. * @function create - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.StringValue * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); + StringValue.create = function create(properties) { + return new StringValue(properties); }; /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.StringValue * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueOptions.encode = function encode(message, writer) { + StringValue.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(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); return writer; }; /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.StringValue * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + StringValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumValueOptions message from the specified reader or buffer. + * Decodes a StringValue message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.StringValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @returns {google.protobuf.StringValue} StringValue * @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) { + StringValue.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); 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())); + message.value = reader.string(); break; default: reader.skipType(tag & 7); @@ -17457,137 +24593,107 @@ }; /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * Decodes a StringValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.StringValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @returns {google.protobuf.StringValue} StringValue * @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) { + StringValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumValueOptions message. + * Verifies a StringValue message. * @function verify - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.StringValue * @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) { + StringValue.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.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; return null; }; /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.StringValue * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @returns {google.protobuf.StringValue} StringValue */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); return message; }; /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * Creates a plain object from a StringValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.StringValue * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {google.protobuf.StringValue} message StringValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumValueOptions.toObject = function toObject(message, options) { + StringValue.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); - } + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; return object; }; /** - * Converts this EnumValueOptions to JSON. + * Converts this StringValue to JSON. * @function toJSON - * @memberof google.protobuf.EnumValueOptions + * @memberof google.protobuf.StringValue * @instance * @returns {Object.} JSON object */ - EnumValueOptions.prototype.toJSON = function toJSON() { + StringValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return EnumValueOptions; + return StringValue; })(); - protobuf.ServiceOptions = (function() { + protobuf.BytesValue = (function() { /** - * Properties of a ServiceOptions. + * Properties of a BytesValue. * @memberof google.protobuf - * @interface IServiceOptions - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value */ /** - * Constructs a new ServiceOptions. + * Constructs a new BytesValue. * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions + * @classdesc Represents a BytesValue. + * @implements IBytesValue * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @param {google.protobuf.IBytesValue=} [properties] Properties to set */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; + function BytesValue(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17595,117 +24701,75 @@ } /** - * 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 + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue * @instance */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + BytesValue.prototype.value = $util.newBuffer([]); /** - * Creates a new ServiceOptions instance using the specified properties. + * Creates a new BytesValue instance using the specified properties. * @function create - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.BytesValue * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); + BytesValue.create = function create(properties) { + return new BytesValue(properties); }; /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. * @function encode - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.BytesValue * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceOptions.encode = function encode(message, writer) { + BytesValue.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"]); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); return writer; }; /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.BytesValue * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ServiceOptions message from the specified reader or buffer. + * Decodes a BytesValue message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.BytesValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @returns {google.protobuf.BytesValue} BytesValue * @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) { + BytesValue.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); 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(); + case 1: + message.value = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -17716,156 +24780,117 @@ }; /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * Decodes a BytesValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.BytesValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @returns {google.protobuf.BytesValue} BytesValue * @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) { + BytesValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ServiceOptions message. + * Verifies a BytesValue message. * @function verify - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.BytesValue * @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) { + BytesValue.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"; + 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 a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.BytesValue * @static * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @returns {google.protobuf.BytesValue} BytesValue */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) 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"]); + var message = new $root.google.protobuf.BytesValue(); + 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 a ServiceOptions message. Also converts values to other types if specified. + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.BytesValue * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {google.protobuf.BytesValue} message BytesValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ServiceOptions.toObject = function toObject(message, options) { + BytesValue.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"]; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + 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 ServiceOptions to JSON. + * Converts this BytesValue to JSON. * @function toJSON - * @memberof google.protobuf.ServiceOptions + * @memberof google.protobuf.BytesValue * @instance * @returns {Object.} JSON object */ - ServiceOptions.prototype.toJSON = function toJSON() { + BytesValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ServiceOptions; + return BytesValue; })(); - protobuf.MethodOptions = (function() { + protobuf.Any = (function() { /** - * Properties of a MethodOptions. + * Properties of an Any. * @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 + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value */ /** - * Constructs a new MethodOptions. + * Constructs a new Any. * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions + * @classdesc Represents an Any. + * @implements IAny * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @param {google.protobuf.IAny=} [properties] Properties to set */ - function MethodOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.methodSignature"] = []; + function Any(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17873,133 +24898,88 @@ } /** - * 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 + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any * @instance */ - MethodOptions.prototype[".google.api.http"] = null; + Any.prototype.type_url = ""; /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any * @instance */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + Any.prototype.value = $util.newBuffer([]); /** - * Creates a new MethodOptions instance using the specified properties. + * Creates a new Any instance using the specified properties. * @function create - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); + Any.create = function create(properties) { + return new Any(properties); }; /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. * @function encode - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {google.protobuf.IAny} message Any message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodOptions.encode = function encode(message, writer) { + Any.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(); + 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 MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {google.protobuf.IAny} message Any message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + Any.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MethodOptions message from the specified reader or buffer. + * Decodes an Any message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.MethodOptions + * @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.MethodOptions} MethodOptions + * @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 */ - MethodOptions.decode = function decode(reader, length) { + Any.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + 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 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()); + case 1: + message.type_url = reader.string(); break; - case 1051: - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); + case 2: + message.value = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -18010,217 +24990,124 @@ }; /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * Decodes an Any message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.Any * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions + * @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 */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { + Any.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MethodOptions message. + * Verifies an Any message. * @function verify - * @memberof google.protobuf.MethodOptions + * @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 */ - MethodOptions.verify = function verify(message) { + Any.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - switch (message.idempotencyLevel) { - default: - return "idempotencyLevel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { - if (!Array.isArray(message[".google.api.methodSignature"])) - return ".google.api.methodSignature: array expected"; - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - if (!$util.isString(message[".google.api.methodSignature"][i])) - return ".google.api.methodSignature: string[] expected"; - } + if (message.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 a MethodOptions message from a plain object. Also converts values to their respective internal types. + * Creates an Any message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.Any * @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]); - } + * @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 a MethodOptions message. Also converts values to other types if specified. + * Creates a plain object from an Any message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.Any * @static - * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {google.protobuf.Any} message Any * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MethodOptions.toObject = function toObject(message, options) { + Any.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]; + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } } - 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); + 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 MethodOptions to JSON. + * Converts this Any to JSON. * @function toJSON - * @memberof google.protobuf.MethodOptions + * @memberof google.protobuf.Any * @instance * @returns {Object.} JSON object */ - MethodOptions.prototype.toJSON = function toJSON() { + Any.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; + return Any; })(); - protobuf.UninterpretedOption = (function() { + protobuf.Empty = (function() { /** - * Properties of an UninterpretedOption. + * Properties of an Empty. * @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 + * @interface IEmpty */ /** - * Constructs a new UninterpretedOption. + * Constructs a new Empty. * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption + * @classdesc Represents an Empty. + * @implements IEmpty * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @param {google.protobuf.IEmpty=} [properties] Properties to set */ - function UninterpretedOption(properties) { - this.name = []; + function Empty(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18228,157 +25115,63 @@ } /** - * 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. + * Creates a new Empty instance using the specified properties. * @function create - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); + Empty.create = function create(properties) { + return new Empty(properties); }; /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. * @function encode - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UninterpretedOption.encode = function encode(message, writer) { + Empty.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. + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + Empty.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UninterpretedOption message from the specified reader or buffer. + * Decodes an Empty message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.UninterpretedOption + * @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.UninterpretedOption} UninterpretedOption + * @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 */ - UninterpretedOption.decode = function decode(reader, length) { + Empty.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 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; @@ -18388,422 +25181,347 @@ }; /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * Decodes an Empty message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.Empty * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @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 */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + Empty.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UninterpretedOption message. + * Verifies an Empty 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"; + * @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 UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * Creates an Empty message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.Empty * @static * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @returns {google.protobuf.Empty} Empty */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) 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; + return new $root.google.protobuf.Empty(); }; /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * Creates a plain object from an Empty message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {google.protobuf.Empty} message Empty * @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; + Empty.toObject = function toObject() { + return {}; }; /** - * Converts this UninterpretedOption to JSON. + * Converts this Empty to JSON. * @function toJSON - * @memberof google.protobuf.UninterpretedOption + * @memberof google.protobuf.Empty * @instance * @returns {Object.} JSON object */ - UninterpretedOption.prototype.toJSON = function toJSON() { + Empty.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - UninterpretedOption.NamePart = (function() { + return Empty; + })(); - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ + return protobuf; + })(); - /** - * 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]]; - } + google.api = (function() { - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; + api.Http = (function() { - /** - * 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); - }; + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ - /** - * 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; - }; + /** + * 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]]; + } - /** - * 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(); - }; + /** + * 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); + }; - /** - * 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; - }; + /** + * 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; + }; - /** - * 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()); - }; + /** + * 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(); + }; - /** - * 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; - }; + /** + * 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; + }; - /** - * 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; - }; + /** + * 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()); + }; - /** - * 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; + /** + * 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.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; + } + 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; + }; - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a 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; + }; - return NamePart; - })(); + /** + * 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 UninterpretedOption; + return Http; })(); - protobuf.SourceCodeInfo = (function() { + api.HttpRule = (function() { /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location + * 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 SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @param {google.api.IHttpRule=} [properties] Properties to set */ - function SourceCodeInfo(properties) { - this.location = []; + function HttpRule(properties) { + this.additionalBindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18811,78 +25529,209 @@ } /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule * @instance */ - SourceCodeInfo.prototype.location = $util.emptyArray; + HttpRule.prototype.selector = ""; /** - * Creates a new SourceCodeInfo instance using the specified properties. + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * 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.protobuf.SourceCodeInfo + * @memberof google.api.HttpRule * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); + HttpRule.create = function create(properties) { + return new HttpRule(properties); }; /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encode - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.api.HttpRule * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SourceCodeInfo.encode = function encode(message, writer) { + HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.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 SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.api.HttpRule * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. + * Decodes a HttpRule message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.SourceCodeInfo + * @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.protobuf.SourceCodeInfo} SourceCodeInfo + * @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 */ - SourceCodeInfo.decode = function decode(reader, length) { + HttpRule.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + 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: - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + 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); @@ -18893,467 +25742,481 @@ }; /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * Decodes a HttpRule message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @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 */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + HttpRule.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SourceCodeInfo message. + * Verifies a HttpRule message. * @function verify - * @memberof google.protobuf.SourceCodeInfo + * @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 */ - SourceCodeInfo.verify = function verify(message) { + HttpRule.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]); + 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 "location." + 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 SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.SourceCodeInfo + * @memberof google.api.HttpRule * @static * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @returns {google.api.HttpRule} HttpRule */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + var message = new $root.google.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 SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo + * 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.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - 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; + 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; }; /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object + * 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 */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); }; - 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; - } + /** + * 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 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()); - }; + } + return message; + }; - /** - * 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; - }; + /** + * 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()); + }; - /** - * 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; - }; + /** + * 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 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]; - } + /** + * 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; + }; - /** - * 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); - }; + /** + * 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; + }; - return Location; - })(); + /** + * 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 SourceCodeInfo; + 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 + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST 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; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + return values; })(); - protobuf.GeneratedCodeInfo = (function() { + api.ResourceDescriptor = (function() { /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + * 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 + * @property {Array.|null} [style] ResourceDescriptor style */ /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @param {google.api.IResourceDescriptor=} [properties] Properties to set */ - function GeneratedCodeInfo(properties) { - this.annotation = []; + 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) @@ -19361,486 +26224,417 @@ } /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor * @instance */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + ResourceDescriptor.prototype.type = ""; /** - * Creates a new GeneratedCodeInfo instance using the specified properties. + * 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 = ""; + + /** + * 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 - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.api.ResourceDescriptor * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); }; /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encode - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.api.ResourceDescriptor * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GeneratedCodeInfo.encode = function encode(message, writer) { + ResourceDescriptor.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(); + 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); + 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; }; /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo + * @memberof google.api.ResourceDescriptor * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * Decodes a ResourceDescriptor message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.GeneratedCodeInfo + * @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.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @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 */ - GeneratedCodeInfo.decode = function decode(reader, length) { + ResourceDescriptor.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + 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()); 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]); + break; } } return message; }; /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * @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 */ - 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; + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); }; /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object + * 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 */ - 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]]; + 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"; } - - /** - * 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.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.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) { + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.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: - 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; + } + } + 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); + 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: - reader.skipType(tag & 7); + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; 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; - }; + } + return message; + }; - /** - * 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 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 = []; + object.style = []; + } + 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; + 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; + }; - /** - * 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 ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this 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); - }; + /** + * 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 Annotation; + /** + * 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 GeneratedCodeInfo; + return ResourceDescriptor; })(); - protobuf.Timestamp = (function() { + api.ResourceReference = (function() { /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType */ - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @param {google.api.IResourceReference=} [properties] Properties to set */ - function Timestamp(properties) { + function ResourceReference(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -19848,88 +26642,88 @@ } /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference * @instance */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ResourceReference.prototype.type = ""; /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference * @instance */ - Timestamp.prototype.nanos = 0; + ResourceReference.prototype.childType = ""; /** - * Creates a new Timestamp instance using the specified properties. + * Creates a new ResourceReference instance using the specified properties. * @function create - * @memberof google.protobuf.Timestamp + * @memberof google.api.ResourceReference * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); }; /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encode - * @memberof google.protobuf.Timestamp + * @memberof google.api.ResourceReference * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Timestamp.encode = function encode(message, writer) { + ResourceReference.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); + 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 Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Timestamp + * @memberof google.api.ResourceReference * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Timestamp message from the specified reader or buffer. + * Decodes a ResourceReference message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Timestamp + * @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.protobuf.Timestamp} Timestamp + * @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 */ - Timestamp.decode = function decode(reader, length) { + ResourceReference.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + 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.seconds = reader.int64(); + message.type = reader.string(); break; case 2: - message.nanos = reader.int32(); + message.childType = reader.string(); break; default: reader.skipType(tag & 7); @@ -19940,129 +26734,131 @@ }; /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Timestamp + * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp + * @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 */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { + ResourceReference.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Timestamp message. + * Verifies a ResourceReference message. * @function verify - * @memberof google.protobuf.Timestamp + * @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 */ - Timestamp.verify = function verify(message) { + ResourceReference.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; + if (message.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 Timestamp message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Timestamp + * @memberof google.api.ResourceReference * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp + * @returns {google.api.ResourceReference} ResourceReference */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) 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; + 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 Timestamp message. Also converts values to other types if specified. + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Timestamp + * @memberof google.api.ResourceReference * @static - * @param {google.protobuf.Timestamp} message Timestamp + * @param {google.api.ResourceReference} message ResourceReference * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Timestamp.toObject = function toObject(message, options) { + ResourceReference.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; + object.type = ""; + object.childType = ""; } - 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; + 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 Timestamp to JSON. + * Converts this ResourceReference to JSON. * @function toJSON - * @memberof google.protobuf.Timestamp + * @memberof google.api.ResourceReference * @instance * @returns {Object.} JSON object */ - Timestamp.prototype.toJSON = function toJSON() { + ResourceReference.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Timestamp; + return ResourceReference; })(); - protobuf.Empty = (function() { + return api; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty + * 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 Empty. - * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @param {google.rpc.IStatus=} [properties] Properties to set */ - function Empty(properties) { + function Status(properties) { + this.details = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20070,63 +26866,105 @@ } /** - * Creates a new Empty instance using the specified properties. + * 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.protobuf.Empty + * @memberof google.rpc.Status * @static - * @param {google.protobuf.IEmpty=} [properties] Properties to set - * @returns {google.protobuf.Empty} Empty instance + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance */ - Empty.create = function create(properties) { - return new Empty(properties); + Status.create = function create(properties) { + return new Status(properties); }; /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. * @function encode - * @memberof google.protobuf.Empty + * @memberof google.rpc.Status * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {google.rpc.IStatus} message Status message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Empty.encode = function encode(message, 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 Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Empty + * @memberof google.rpc.Status * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {google.rpc.IStatus} message Status message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Empty.encodeDelimited = function encodeDelimited(message, writer) { + Status.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Empty message from the specified reader or buffer. + * Decodes a Status message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Empty + * @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.protobuf.Empty} Empty + * @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 */ - Empty.decode = function decode(reader, length) { + 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.protobuf.Empty(); + 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; @@ -20136,77 +26974,125 @@ }; /** - * Decodes an Empty message from the specified reader or buffer, length delimited. + * Decodes a Status message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Empty + * @memberof google.rpc.Status * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Empty} Empty + * @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 */ - Empty.decodeDelimited = function decodeDelimited(reader) { + Status.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Empty message. + * Verifies a Status message. * @function verify - * @memberof google.protobuf.Empty + * @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 */ - Empty.verify = function verify(message) { + 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 an Empty message from a plain object. Also converts values to their respective internal types. + * Creates a Status message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Empty + * @memberof google.rpc.Status * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Empty} Empty + * @returns {google.rpc.Status} Status */ - Empty.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Empty) + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) return object; - return new $root.google.protobuf.Empty(); + 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 an Empty message. Also converts values to other types if specified. + * Creates a plain object from a Status message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Empty + * @memberof google.rpc.Status * @static - * @param {google.protobuf.Empty} message Empty + * @param {google.rpc.Status} message Status * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Empty.toObject = function toObject() { - return {}; + 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 Empty to JSON. + * Converts this Status to JSON. * @function toJSON - * @memberof google.protobuf.Empty + * @memberof google.rpc.Status * @instance * @returns {Object.} JSON object */ - Empty.prototype.toJSON = function toJSON() { + Status.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Empty; + return Status; })(); - return protobuf; + return rpc; })(); return google; diff --git a/packages/google-cloud-bigquery-storage/protos/protos.json b/packages/google-cloud-bigquery-storage/protos/protos.json index b3dca4ec481..7070197fe3b 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.json +++ b/packages/google-cloud-bigquery-storage/protos/protos.json @@ -13,7 +13,7 @@ "csharp_namespace": "Google.Cloud.BigQuery.Storage.V1", "go_package": "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1;storage", "java_multiple_files": true, - "java_outer_classname": "StreamProto", + "java_outer_classname": "TableProto", "java_package": "com.google.cloud.bigquery.storage.v1", "php_namespace": "Google\\Cloud\\BigQuery\\Storage\\V1", "(google.api.resource_definition).type": "bigquery.googleapis.com/Table", @@ -77,6 +77,23 @@ } } }, + "ProtoSchema": { + "fields": { + "protoDescriptor": { + "type": "google.protobuf.DescriptorProto", + "id": 1 + } + } + }, + "ProtoRows": { + "fields": { + "serializedRows": { + "rule": "repeated", + "type": "bytes", + "id": 1 + } + } + }, "BigQueryRead": { "options": { "(google.api.default_host)": "bigquerystorage.googleapis.com", @@ -138,6 +155,134 @@ } } }, + "BigQueryWrite": { + "options": { + "(google.api.default_host)": "bigquerystorage.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/bigquery.insertdata,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateWriteStream": { + "requestType": "CreateWriteStreamRequest", + "responseType": "WriteStream", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/datasets/*/tables/*}", + "(google.api.http).body": "write_stream", + "(google.api.method_signature)": "parent,write_stream" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/datasets/*/tables/*}", + "body": "write_stream" + } + }, + { + "(google.api.method_signature)": "parent,write_stream" + } + ] + }, + "AppendRows": { + "requestType": "AppendRowsRequest", + "requestStream": true, + "responseType": "AppendRowsResponse", + "responseStream": true, + "options": { + "(google.api.http).post": "/v1/{write_stream=projects/*/datasets/*/tables/*/streams/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "write_stream" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{write_stream=projects/*/datasets/*/tables/*/streams/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "write_stream" + } + ] + }, + "GetWriteStream": { + "requestType": "GetWriteStreamRequest", + "responseType": "WriteStream", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/datasets/*/tables/*/streams/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/datasets/*/tables/*/streams/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "FinalizeWriteStream": { + "requestType": "FinalizeWriteStreamRequest", + "responseType": "FinalizeWriteStreamResponse", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/datasets/*/tables/*/streams/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/datasets/*/tables/*/streams/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "BatchCommitWriteStreams": { + "requestType": "BatchCommitWriteStreamsRequest", + "responseType": "BatchCommitWriteStreamsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/datasets/*/tables/*}", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/datasets/*/tables/*}" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "FlushRows": { + "requestType": "FlushRowsRequest", + "responseType": "FlushRowsResponse", + "options": { + "(google.api.http).post": "/v1/{write_stream=projects/*/datasets/*/tables/*/streams/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "write_stream" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{write_stream=projects/*/datasets/*/tables/*/streams/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "write_stream" + } + ] + } + } + }, "CreateReadSessionRequest": { "fields": { "parent": { @@ -287,6 +432,222 @@ } } }, + "CreateWriteStreamRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquery.googleapis.com/Table" + } + }, + "writeStream": { + "type": "WriteStream", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AppendRowsRequest": { + "oneofs": { + "rows": { + "oneof": [ + "protoRows" + ] + } + }, + "fields": { + "writeStream": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerystorage.googleapis.com/WriteStream" + } + }, + "offset": { + "type": "google.protobuf.Int64Value", + "id": 2 + }, + "protoRows": { + "type": "ProtoData", + "id": 4 + }, + "traceId": { + "type": "string", + "id": 6 + } + }, + "nested": { + "ProtoData": { + "fields": { + "writerSchema": { + "type": "ProtoSchema", + "id": 1 + }, + "rows": { + "type": "ProtoRows", + "id": 2 + } + } + } + } + }, + "AppendRowsResponse": { + "oneofs": { + "response": { + "oneof": [ + "appendResult", + "error" + ] + } + }, + "fields": { + "appendResult": { + "type": "AppendResult", + "id": 1 + }, + "error": { + "type": "google.rpc.Status", + "id": 2 + }, + "updatedSchema": { + "type": "TableSchema", + "id": 3 + } + }, + "nested": { + "AppendResult": { + "fields": { + "offset": { + "type": "google.protobuf.Int64Value", + "id": 1 + } + } + } + } + }, + "GetWriteStreamRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerystorage.googleapis.com/WriteStream" + } + } + } + }, + "BatchCommitWriteStreamsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "writeStreams": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchCommitWriteStreamsResponse": { + "fields": { + "commitTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "streamErrors": { + "rule": "repeated", + "type": "StorageError", + "id": 2 + } + } + }, + "FinalizeWriteStreamRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerystorage.googleapis.com/WriteStream" + } + } + } + }, + "FinalizeWriteStreamResponse": { + "fields": { + "rowCount": { + "type": "int64", + "id": 1 + } + } + }, + "FlushRowsRequest": { + "fields": { + "writeStream": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquerystorage.googleapis.com/WriteStream" + } + }, + "offset": { + "type": "google.protobuf.Int64Value", + "id": 2 + } + } + }, + "FlushRowsResponse": { + "fields": { + "offset": { + "type": "int64", + "id": 1 + } + } + }, + "StorageError": { + "fields": { + "code": { + "type": "StorageErrorCode", + "id": 1 + }, + "entity": { + "type": "string", + "id": 2 + }, + "errorMessage": { + "type": "string", + "id": 3 + } + }, + "nested": { + "StorageErrorCode": { + "values": { + "STORAGE_ERROR_CODE_UNSPECIFIED": 0, + "TABLE_NOT_FOUND": 1, + "STREAM_ALREADY_COMMITTED": 2, + "STREAM_NOT_FOUND": 3, + "INVALID_STREAM_TYPE": 4, + "INVALID_STREAM_STATE": 5, + "STREAM_FINALIZED": 6, + "SCHEMA_MISMATCH_EXTRA_FIELDS": 7 + } + } + } + }, "DataFormat": { "values": { "DATA_FORMAT_UNSPECIFIED": 0, @@ -433,12 +794,165 @@ } } } - } - } - }, - "v1beta1": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta1;storage", + }, + "WriteStream": { + "options": { + "(google.api.resource).type": "bigquerystorage.googleapis.com/WriteStream", + "(google.api.resource).pattern": "projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "Type", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "commitTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "tableSchema": { + "type": "TableSchema", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "COMMITTED": 1, + "PENDING": 2, + "BUFFERED": 3 + } + } + } + }, + "TableSchema": { + "fields": { + "fields": { + "rule": "repeated", + "type": "TableFieldSchema", + "id": 1 + } + } + }, + "TableFieldSchema": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "type": { + "type": "Type", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "mode": { + "type": "Mode", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fields": { + "rule": "repeated", + "type": "TableFieldSchema", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxLength": { + "type": "int64", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "precision": { + "type": "int64", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scale": { + "type": "int64", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "STRING": 1, + "INT64": 2, + "DOUBLE": 3, + "STRUCT": 4, + "BYTES": 5, + "BOOL": 6, + "TIMESTAMP": 7, + "DATE": 8, + "TIME": 9, + "DATETIME": 10, + "GEOGRAPHY": 11, + "NUMERIC": 12, + "BIGNUMERIC": 13, + "INTERVAL": 14, + "JSON": 15 + } + }, + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "NULLABLE": 1, + "REQUIRED": 2, + "REPEATED": 3 + } + } + } + } + } + }, + "v1beta1": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta1;storage", "java_outer_classname": "TableReferenceProto", "java_package": "com.google.cloud.bigquery.storage.v1beta1" }, @@ -913,309 +1427,100 @@ } } }, - "api": { + "protobuf": { "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 + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "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": { - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "Http": { + "FileDescriptorSet": { "fields": { - "rules": { + "file": { "rule": "repeated", - "type": "HttpRule", + "type": "FileDescriptorProto", "id": 1 - }, - "fullyDecodeReservedExpansion": { - "type": "bool", - "id": 2 } } }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, + "FileDescriptorProto": { "fields": { - "selector": { + "name": { "type": "string", "id": 1 }, - "get": { + "package": { "type": "string", "id": 2 }, - "put": { + "dependency": { + "rule": "repeated", "type": "string", "id": 3 }, - "post": { - "type": "string", + "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 }, - "delete": { - "type": "string", + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", "id": 5 }, - "patch": { - "type": "string", + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", "id": 6 }, - "custom": { - "type": "CustomHttpPattern", + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", "id": 8 }, - "body": { - "type": "string", - "id": 7 + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 }, - "responseBody": { + "syntax": { "type": "string", "id": 12 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 } } }, - "CustomHttpPattern": { + "DescriptorProto": { "fields": { - "kind": { + "name": { "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, - "UNORDERED_LIST": 6 - } - }, - "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 - }, - "style": { - "rule": "repeated", - "type": "Style", - "id": 10 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - }, - "Style": { - "values": { - "STYLE_UNSPECIFIED": 0, - "DECLARATIVE_FRIENDLY": 1 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "protobuf": { - "options": { - "go_package": "google.golang.org/protobuf/types/descriptorpb", - "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", + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", "id": 2 }, "extension": { @@ -2029,10 +2334,332 @@ } } }, + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, "Empty": { "fields": {} } } + }, + "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, + "UNORDERED_LIST": 6 + } + }, + "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 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } } } } diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index a722be8fec6..10f28e88015 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -166,6 +166,12 @@ export class BigQueryReadClient { readStreamPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/sessions/{session}/streams/{stream}' ), + tablePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/datasets/{dataset}/tables/{table}' + ), + writeStreamPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}' + ), }; // Some of the methods on this service provide streaming responses. @@ -754,6 +760,126 @@ export class BigQueryReadClient { .stream; } + /** + * Return a fully-qualified table resource name string. + * + * @param {string} project + * @param {string} dataset + * @param {string} table + * @returns {string} Resource name string. + */ + tablePath(project: string, dataset: string, table: string) { + return this.pathTemplates.tablePathTemplate.render({ + project: project, + dataset: dataset, + table: table, + }); + } + + /** + * Parse the project from Table resource. + * + * @param {string} tableName + * A fully-qualified path representing Table resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTableName(tableName: string) { + return this.pathTemplates.tablePathTemplate.match(tableName).project; + } + + /** + * Parse the dataset from Table resource. + * + * @param {string} tableName + * A fully-qualified path representing Table resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromTableName(tableName: string) { + return this.pathTemplates.tablePathTemplate.match(tableName).dataset; + } + + /** + * Parse the table from Table resource. + * + * @param {string} tableName + * A fully-qualified path representing Table resource. + * @returns {string} A string representing the table. + */ + matchTableFromTableName(tableName: string) { + return this.pathTemplates.tablePathTemplate.match(tableName).table; + } + + /** + * Return a fully-qualified writeStream resource name string. + * + * @param {string} project + * @param {string} dataset + * @param {string} table + * @param {string} stream + * @returns {string} Resource name string. + */ + writeStreamPath( + project: string, + dataset: string, + table: string, + stream: string + ) { + return this.pathTemplates.writeStreamPathTemplate.render({ + project: project, + dataset: dataset, + table: table, + stream: stream, + }); + } + + /** + * Parse the project from WriteStream resource. + * + * @param {string} writeStreamName + * A fully-qualified path representing WriteStream resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWriteStreamName(writeStreamName: string) { + return this.pathTemplates.writeStreamPathTemplate.match(writeStreamName) + .project; + } + + /** + * Parse the dataset from WriteStream resource. + * + * @param {string} writeStreamName + * A fully-qualified path representing WriteStream resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromWriteStreamName(writeStreamName: string) { + return this.pathTemplates.writeStreamPathTemplate.match(writeStreamName) + .dataset; + } + + /** + * Parse the table from WriteStream resource. + * + * @param {string} writeStreamName + * A fully-qualified path representing WriteStream resource. + * @returns {string} A string representing the table. + */ + matchTableFromWriteStreamName(writeStreamName: string) { + return this.pathTemplates.writeStreamPathTemplate.match(writeStreamName) + .table; + } + + /** + * Parse the stream from WriteStream resource. + * + * @param {string} writeStreamName + * A fully-qualified path representing WriteStream resource. + * @returns {string} A string representing the stream. + */ + matchStreamFromWriteStreamName(writeStreamName: string) { + return this.pathTemplates.writeStreamPathTemplate.match(writeStreamName) + .stream; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client_config.json b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client_config.json index 42b2735b9fe..f129939b0ef 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client_config.json +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client_config.json @@ -34,8 +34,7 @@ "retry_params_name": "default" }, "SplitReadStream": { - "timeout_millis": 600000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default" } } diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_proto_list.json b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_proto_list.json index 13440ce253e..f0274ac3660 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_proto_list.json +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_proto_list.json @@ -1,6 +1,8 @@ [ "../../protos/google/cloud/bigquery/storage/v1/arrow.proto", "../../protos/google/cloud/bigquery/storage/v1/avro.proto", + "../../protos/google/cloud/bigquery/storage/v1/protobuf.proto", "../../protos/google/cloud/bigquery/storage/v1/storage.proto", - "../../protos/google/cloud/bigquery/storage/v1/stream.proto" + "../../protos/google/cloud/bigquery/storage/v1/stream.proto", + "../../protos/google/cloud/bigquery/storage/v1/table.proto" ] diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts new file mode 100644 index 00000000000..62973bfa20a --- /dev/null +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts @@ -0,0 +1,1183 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/big_query_write_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './big_query_write_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * BigQuery Write API. + * + * The Write API can be used to write data to BigQuery. + * + * For supplementary information about the Write API, see: + * https://cloud.google.com/bigquery/docs/write-api + * @class + * @memberof v1 + */ +export class BigQueryWriteClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + bigQueryWriteStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BigQueryWriteClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof BigQueryWriteClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + readSessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sessions/{session}' + ), + readStreamPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sessions/{session}/streams/{stream}' + ), + tablePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/datasets/{dataset}/tables/{table}' + ), + writeStreamPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}' + ), + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + appendRows: new this._gaxModule.StreamDescriptor( + gax.StreamType.BIDI_STREAMING + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.bigquery.storage.v1.BigQueryWrite', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.bigQueryWriteStub) { + return this.bigQueryWriteStub; + } + + // Put together the "service stub" for + // google.cloud.bigquery.storage.v1.BigQueryWrite. + this.bigQueryWriteStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.bigquery.storage.v1.BigQueryWrite' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.bigquery.storage.v1.BigQueryWrite, + this._opts, + this._providedCustomServicePath + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const bigQueryWriteStubMethods = [ + 'createWriteStream', + 'appendRows', + 'getWriteStream', + 'finalizeWriteStream', + 'batchCommitWriteStreams', + 'flushRows', + ]; + for (const methodName of bigQueryWriteStubMethods) { + const callPromise = this.bigQueryWriteStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.stream[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.bigQueryWriteStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'bigquerystorage.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'bigquerystorage.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/bigquery', + 'https://www.googleapis.com/auth/bigquery.insertdata', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + createWriteStream( + request?: protos.google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.storage.v1.IWriteStream, + ( + | protos.google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest + | undefined + ), + {} | undefined + ] + >; + createWriteStream( + request: protos.google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.storage.v1.IWriteStream, + | protos.google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createWriteStream( + request: protos.google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest, + callback: Callback< + protos.google.cloud.bigquery.storage.v1.IWriteStream, + | protos.google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a write stream to the given table. + * Additionally, every table has a special stream named '_default' + * to which data can be written. This stream doesn't need to be created using + * CreateWriteStream. It is a stream that can be used simultaneously by any + * number of clients. Data written to this stream is considered committed as + * soon as an acknowledgement is received. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Reference to the table to which the stream belongs, in the format + * of `projects/{project}/datasets/{dataset}/tables/{table}`. + * @param {google.cloud.bigquery.storage.v1.WriteStream} request.writeStream + * Required. Stream to be created. + * @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 [WriteStream]{@link google.cloud.bigquery.storage.v1.WriteStream}. + * 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.createWriteStream(request); + */ + createWriteStream( + request?: protos.google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.storage.v1.IWriteStream, + | protos.google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.storage.v1.IWriteStream, + | protos.google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.storage.v1.IWriteStream, + ( + | protos.google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createWriteStream(request, options, callback); + } + getWriteStream( + request?: protos.google.cloud.bigquery.storage.v1.IGetWriteStreamRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.storage.v1.IWriteStream, + ( + | protos.google.cloud.bigquery.storage.v1.IGetWriteStreamRequest + | undefined + ), + {} | undefined + ] + >; + getWriteStream( + request: protos.google.cloud.bigquery.storage.v1.IGetWriteStreamRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.storage.v1.IWriteStream, + | protos.google.cloud.bigquery.storage.v1.IGetWriteStreamRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getWriteStream( + request: protos.google.cloud.bigquery.storage.v1.IGetWriteStreamRequest, + callback: Callback< + protos.google.cloud.bigquery.storage.v1.IWriteStream, + | protos.google.cloud.bigquery.storage.v1.IGetWriteStreamRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets information about a write stream. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the stream to get, in the form of + * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. + * @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 [WriteStream]{@link google.cloud.bigquery.storage.v1.WriteStream}. + * 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.getWriteStream(request); + */ + getWriteStream( + request?: protos.google.cloud.bigquery.storage.v1.IGetWriteStreamRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.storage.v1.IWriteStream, + | protos.google.cloud.bigquery.storage.v1.IGetWriteStreamRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.storage.v1.IWriteStream, + | protos.google.cloud.bigquery.storage.v1.IGetWriteStreamRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.storage.v1.IWriteStream, + ( + | protos.google.cloud.bigquery.storage.v1.IGetWriteStreamRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getWriteStream(request, options, callback); + } + finalizeWriteStream( + request?: protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamResponse, + ( + | protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest + | undefined + ), + {} | undefined + ] + >; + finalizeWriteStream( + request: protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamResponse, + | protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest + | null + | undefined, + {} | null | undefined + > + ): void; + finalizeWriteStream( + request: protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest, + callback: Callback< + protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamResponse, + | protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Finalize a write stream so that no new data can be appended to the + * stream. Finalize is not supported on the '_default' stream. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the stream to finalize, in the form of + * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. + * @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 [FinalizeWriteStreamResponse]{@link google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse}. + * 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.finalizeWriteStream(request); + */ + finalizeWriteStream( + request?: protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamResponse, + | protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamResponse, + | protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamResponse, + ( + | protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.finalizeWriteStream(request, options, callback); + } + batchCommitWriteStreams( + request?: protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsResponse, + ( + | protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest + | undefined + ), + {} | undefined + ] + >; + batchCommitWriteStreams( + request: protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsResponse, + | protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchCommitWriteStreams( + request: protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest, + callback: Callback< + protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsResponse, + | protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Atomically commits a group of `PENDING` streams that belong to the same + * `parent` table. + * + * Streams must be finalized before commit and cannot be committed multiple + * times. Once a stream is committed, data in the stream becomes available + * for read operations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent table that all the streams should belong to, in the form of + * `projects/{project}/datasets/{dataset}/tables/{table}`. + * @param {string[]} request.writeStreams + * Required. The group of streams that will be committed atomically. + * @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 [BatchCommitWriteStreamsResponse]{@link google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse}. + * 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.batchCommitWriteStreams(request); + */ + batchCommitWriteStreams( + request?: protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsResponse, + | protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsResponse, + | protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsResponse, + ( + | protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.batchCommitWriteStreams( + request, + options, + callback + ); + } + flushRows( + request?: protos.google.cloud.bigquery.storage.v1.IFlushRowsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.storage.v1.IFlushRowsResponse, + protos.google.cloud.bigquery.storage.v1.IFlushRowsRequest | undefined, + {} | undefined + ] + >; + flushRows( + request: protos.google.cloud.bigquery.storage.v1.IFlushRowsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.storage.v1.IFlushRowsResponse, + | protos.google.cloud.bigquery.storage.v1.IFlushRowsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + flushRows( + request: protos.google.cloud.bigquery.storage.v1.IFlushRowsRequest, + callback: Callback< + protos.google.cloud.bigquery.storage.v1.IFlushRowsResponse, + | protos.google.cloud.bigquery.storage.v1.IFlushRowsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Flushes rows to a BUFFERED stream. + * + * If users are appending rows to BUFFERED stream, flush operation is + * required in order for the rows to become available for reading. A + * Flush operation flushes up to any previously flushed offset in a BUFFERED + * stream, to the offset specified in the request. + * + * Flush is not supported on the _default stream, since it is not BUFFERED. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.writeStream + * Required. The stream that is the target of the flush operation. + * @param {google.protobuf.Int64Value} request.offset + * Ending offset of the flush operation. Rows before this offset(including + * this offset) will be flushed. + * @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 [FlushRowsResponse]{@link google.cloud.bigquery.storage.v1.FlushRowsResponse}. + * 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.flushRows(request); + */ + flushRows( + request?: protos.google.cloud.bigquery.storage.v1.IFlushRowsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.bigquery.storage.v1.IFlushRowsResponse, + | protos.google.cloud.bigquery.storage.v1.IFlushRowsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.bigquery.storage.v1.IFlushRowsResponse, + | protos.google.cloud.bigquery.storage.v1.IFlushRowsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.bigquery.storage.v1.IFlushRowsResponse, + protos.google.cloud.bigquery.storage.v1.IFlushRowsRequest | 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({ + write_stream: request.writeStream || '', + }); + this.initialize(); + return this.innerApiCalls.flushRows(request, options, callback); + } + + /** + * Appends data to the given stream. + * + * If `offset` is specified, the `offset` is checked against the end of + * stream. The server returns `OUT_OF_RANGE` in `AppendRowsResponse` if an + * attempt is made to append to an offset beyond the current end of the stream + * or `ALREADY_EXISTS` if user provides an `offset` that has already been + * written to. User can retry with adjusted offset within the same RPC + * connection. If `offset` is not specified, append happens at the end of the + * stream. + * + * The response contains an optional offset at which the append + * happened. No offset information will be returned for appends to a + * default stream. + * + * Responses are received in the same order in which requests are sent. + * There will be one response for each successful inserted request. Responses + * may optionally embed error information if the originating AppendRequest was + * not successfully processed. + * + * The specifics of when successfully appended data is made visible to the + * table are governed by the type of stream: + * + * * For COMMITTED streams (which includes the default stream), data is + * visible immediately upon successful append. + * + * * For BUFFERED streams, data is made visible via a subsequent `FlushRows` + * rpc which advances a cursor to a newer offset in the stream. + * + * * For PENDING streams, data is not made visible until the stream itself is + * finalized (via the `FinalizeWriteStream` rpc), and the stream is explicitly + * committed via the `BatchCommitWriteStreams` rpc. + * + * @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 is both readable and writable. It accepts objects + * representing [AppendRowsRequest]{@link google.cloud.bigquery.storage.v1.AppendRowsRequest} for write() method, and + * will emit objects representing [AppendRowsResponse]{@link google.cloud.bigquery.storage.v1.AppendRowsResponse} on 'data' event asynchronously. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming) + * for more details and examples. + * @example + * const stream = client.appendRows(); + * stream.on('data', (response) => { ... }); + * stream.on('end', () => { ... }); + * stream.write(request); + * stream.end(); + */ + appendRows(options?: CallOptions): gax.CancellableStream { + this.initialize(); + return this.innerApiCalls.appendRows(options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * 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 readSession resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} session + * @returns {string} Resource name string. + */ + readSessionPath(project: string, location: string, session: string) { + return this.pathTemplates.readSessionPathTemplate.render({ + project: project, + location: location, + session: session, + }); + } + + /** + * Parse the project from ReadSession resource. + * + * @param {string} readSessionName + * A fully-qualified path representing ReadSession resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReadSessionName(readSessionName: string) { + return this.pathTemplates.readSessionPathTemplate.match(readSessionName) + .project; + } + + /** + * Parse the location from ReadSession resource. + * + * @param {string} readSessionName + * A fully-qualified path representing ReadSession resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReadSessionName(readSessionName: string) { + return this.pathTemplates.readSessionPathTemplate.match(readSessionName) + .location; + } + + /** + * Parse the session from ReadSession resource. + * + * @param {string} readSessionName + * A fully-qualified path representing ReadSession resource. + * @returns {string} A string representing the session. + */ + matchSessionFromReadSessionName(readSessionName: string) { + return this.pathTemplates.readSessionPathTemplate.match(readSessionName) + .session; + } + + /** + * Return a fully-qualified readStream resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} session + * @param {string} stream + * @returns {string} Resource name string. + */ + readStreamPath( + project: string, + location: string, + session: string, + stream: string + ) { + return this.pathTemplates.readStreamPathTemplate.render({ + project: project, + location: location, + session: session, + stream: stream, + }); + } + + /** + * Parse the project from ReadStream resource. + * + * @param {string} readStreamName + * A fully-qualified path representing ReadStream resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReadStreamName(readStreamName: string) { + return this.pathTemplates.readStreamPathTemplate.match(readStreamName) + .project; + } + + /** + * Parse the location from ReadStream resource. + * + * @param {string} readStreamName + * A fully-qualified path representing ReadStream resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReadStreamName(readStreamName: string) { + return this.pathTemplates.readStreamPathTemplate.match(readStreamName) + .location; + } + + /** + * Parse the session from ReadStream resource. + * + * @param {string} readStreamName + * A fully-qualified path representing ReadStream resource. + * @returns {string} A string representing the session. + */ + matchSessionFromReadStreamName(readStreamName: string) { + return this.pathTemplates.readStreamPathTemplate.match(readStreamName) + .session; + } + + /** + * Parse the stream from ReadStream resource. + * + * @param {string} readStreamName + * A fully-qualified path representing ReadStream resource. + * @returns {string} A string representing the stream. + */ + matchStreamFromReadStreamName(readStreamName: string) { + return this.pathTemplates.readStreamPathTemplate.match(readStreamName) + .stream; + } + + /** + * Return a fully-qualified table resource name string. + * + * @param {string} project + * @param {string} dataset + * @param {string} table + * @returns {string} Resource name string. + */ + tablePath(project: string, dataset: string, table: string) { + return this.pathTemplates.tablePathTemplate.render({ + project: project, + dataset: dataset, + table: table, + }); + } + + /** + * Parse the project from Table resource. + * + * @param {string} tableName + * A fully-qualified path representing Table resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTableName(tableName: string) { + return this.pathTemplates.tablePathTemplate.match(tableName).project; + } + + /** + * Parse the dataset from Table resource. + * + * @param {string} tableName + * A fully-qualified path representing Table resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromTableName(tableName: string) { + return this.pathTemplates.tablePathTemplate.match(tableName).dataset; + } + + /** + * Parse the table from Table resource. + * + * @param {string} tableName + * A fully-qualified path representing Table resource. + * @returns {string} A string representing the table. + */ + matchTableFromTableName(tableName: string) { + return this.pathTemplates.tablePathTemplate.match(tableName).table; + } + + /** + * Return a fully-qualified writeStream resource name string. + * + * @param {string} project + * @param {string} dataset + * @param {string} table + * @param {string} stream + * @returns {string} Resource name string. + */ + writeStreamPath( + project: string, + dataset: string, + table: string, + stream: string + ) { + return this.pathTemplates.writeStreamPathTemplate.render({ + project: project, + dataset: dataset, + table: table, + stream: stream, + }); + } + + /** + * Parse the project from WriteStream resource. + * + * @param {string} writeStreamName + * A fully-qualified path representing WriteStream resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWriteStreamName(writeStreamName: string) { + return this.pathTemplates.writeStreamPathTemplate.match(writeStreamName) + .project; + } + + /** + * Parse the dataset from WriteStream resource. + * + * @param {string} writeStreamName + * A fully-qualified path representing WriteStream resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromWriteStreamName(writeStreamName: string) { + return this.pathTemplates.writeStreamPathTemplate.match(writeStreamName) + .dataset; + } + + /** + * Parse the table from WriteStream resource. + * + * @param {string} writeStreamName + * A fully-qualified path representing WriteStream resource. + * @returns {string} A string representing the table. + */ + matchTableFromWriteStreamName(writeStreamName: string) { + return this.pathTemplates.writeStreamPathTemplate.match(writeStreamName) + .table; + } + + /** + * Parse the stream from WriteStream resource. + * + * @param {string} writeStreamName + * A fully-qualified path representing WriteStream resource. + * @returns {string} A string representing the stream. + */ + matchStreamFromWriteStreamName(writeStreamName: string) { + return this.pathTemplates.writeStreamPathTemplate.match(writeStreamName) + .stream; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.bigQueryWriteStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client_config.json b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client_config.json new file mode 100644 index 00000000000..67eb3165cb6 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client_config.json @@ -0,0 +1,59 @@ +{ + "interfaces": { + "google.cloud.bigquery.storage.v1.BigQueryWrite": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateWriteStream": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "AppendRows": { + "timeout_millis": 86400000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetWriteStream": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "FinalizeWriteStream": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "BatchCommitWriteStreams": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "FlushRows": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_proto_list.json b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_proto_list.json new file mode 100644 index 00000000000..f0274ac3660 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_proto_list.json @@ -0,0 +1,8 @@ +[ + "../../protos/google/cloud/bigquery/storage/v1/arrow.proto", + "../../protos/google/cloud/bigquery/storage/v1/avro.proto", + "../../protos/google/cloud/bigquery/storage/v1/protobuf.proto", + "../../protos/google/cloud/bigquery/storage/v1/storage.proto", + "../../protos/google/cloud/bigquery/storage/v1/stream.proto", + "../../protos/google/cloud/bigquery/storage/v1/table.proto" +] diff --git a/packages/google-cloud-bigquery-storage/src/v1/gapic_metadata.json b/packages/google-cloud-bigquery-storage/src/v1/gapic_metadata.json index 3c84159f688..f52c2dae123 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/gapic_metadata.json +++ b/packages/google-cloud-bigquery-storage/src/v1/gapic_metadata.json @@ -43,6 +43,75 @@ } } } + }, + "BigQueryWrite": { + "clients": { + "grpc": { + "libraryClient": "BigQueryWriteClient", + "rpcs": { + "CreateWriteStream": { + "methods": [ + "createWriteStream" + ] + }, + "GetWriteStream": { + "methods": [ + "getWriteStream" + ] + }, + "FinalizeWriteStream": { + "methods": [ + "finalizeWriteStream" + ] + }, + "BatchCommitWriteStreams": { + "methods": [ + "batchCommitWriteStreams" + ] + }, + "FlushRows": { + "methods": [ + "flushRows" + ] + }, + "AppendRows": { + "methods": [ + "appendRows" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "BigQueryWriteClient", + "rpcs": { + "CreateWriteStream": { + "methods": [ + "createWriteStream" + ] + }, + "GetWriteStream": { + "methods": [ + "getWriteStream" + ] + }, + "FinalizeWriteStream": { + "methods": [ + "finalizeWriteStream" + ] + }, + "BatchCommitWriteStreams": { + "methods": [ + "batchCommitWriteStreams" + ] + }, + "FlushRows": { + "methods": [ + "flushRows" + ] + } + } + } + } } } } diff --git a/packages/google-cloud-bigquery-storage/src/v1/index.ts b/packages/google-cloud-bigquery-storage/src/v1/index.ts index db2de17014f..e1965026c9e 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/index.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/index.ts @@ -17,3 +17,4 @@ // ** All changes to this file may be overwritten. ** export {BigQueryReadClient} from './big_query_read_client'; +export {BigQueryWriteClient} from './big_query_write_client'; diff --git a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js index 627efaa9f20..0e917c476bd 100644 --- a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js @@ -21,6 +21,7 @@ const storage = require('@google-cloud/bigquery-storage'); function main() { const bigQueryReadClient = new storage.BigQueryReadClient(); + const bigQueryStorageClient = new storage.BigQueryStorageClient(); } main(); diff --git a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts index 3b55b605b29..c2e01b6a3a2 100644 --- a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts @@ -16,17 +16,26 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import {BigQueryReadClient} from '@google-cloud/bigquery-storage'; +import { + BigQueryReadClient, + BigQueryStorageClient, +} from '@google-cloud/bigquery-storage'; // check that the client class type name can be used function doStuffWithBigQueryReadClient(client: BigQueryReadClient) { client.close(); } +function doStuffWithBigQueryStorageClient(client: BigQueryStorageClient) { + client.close(); +} function main() { // check that the client instance can be created const bigQueryReadClient = new BigQueryReadClient(); doStuffWithBigQueryReadClient(bigQueryReadClient); + // check that the client instance can be created + const bigQueryStorageClient = new BigQueryStorageClient(); + doStuffWithBigQueryStorageClient(bigQueryStorageClient); } main(); diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts index e7feeb4724d..eeb7c0e2cf2 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts @@ -648,5 +648,145 @@ describe('v1.BigQueryReadClient', () => { ); }); }); + + describe('table', () => { + const fakePath = '/rendered/path/table'; + const expectedParameters = { + project: 'projectValue', + dataset: 'datasetValue', + table: 'tableValue', + }; + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tablePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tablePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tablePath', () => { + const result = client.tablePath( + 'projectValue', + 'datasetValue', + 'tableValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tablePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTableName', () => { + const result = client.matchProjectFromTableName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tablePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromTableName', () => { + const result = client.matchDatasetFromTableName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.tablePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTableFromTableName', () => { + const result = client.matchTableFromTableName(fakePath); + assert.strictEqual(result, 'tableValue'); + assert( + (client.pathTemplates.tablePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('writeStream', () => { + const fakePath = '/rendered/path/writeStream'; + const expectedParameters = { + project: 'projectValue', + dataset: 'datasetValue', + table: 'tableValue', + stream: 'streamValue', + }; + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.writeStreamPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.writeStreamPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('writeStreamPath', () => { + const result = client.writeStreamPath( + 'projectValue', + 'datasetValue', + 'tableValue', + 'streamValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.writeStreamPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromWriteStreamName', () => { + const result = client.matchProjectFromWriteStreamName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.writeStreamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromWriteStreamName', () => { + const result = client.matchDatasetFromWriteStreamName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.writeStreamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTableFromWriteStreamName', () => { + const result = client.matchTableFromWriteStreamName(fakePath); + assert.strictEqual(result, 'tableValue'); + assert( + (client.pathTemplates.writeStreamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchStreamFromWriteStreamName', () => { + const result = client.matchStreamFromWriteStreamName(fakePath); + assert.strictEqual(result, 'streamValue'); + assert( + (client.pathTemplates.writeStreamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_write_v1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_write_v1.ts new file mode 100644 index 00000000000..e4ba9ae6bdc --- /dev/null +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_write_v1.ts @@ -0,0 +1,1115 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as bigquerywriteModule 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 stubBidiStreamingCall( + response?: ResponseType, + error?: Error +) { + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + return sinon.stub().returns(mockStream); +} + +describe('v1.BigQueryWriteClient', () => { + it('has servicePath', () => { + const servicePath = bigquerywriteModule.v1.BigQueryWriteClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = bigquerywriteModule.v1.BigQueryWriteClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = bigquerywriteModule.v1.BigQueryWriteClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.bigQueryWriteStub, undefined); + await client.initialize(); + assert(client.bigQueryWriteStub); + }); + + it('has close method', () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + 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 bigquerywriteModule.v1.BigQueryWriteClient({ + 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('createWriteStream', () => { + it('invokes createWriteStream without error', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.CreateWriteStreamRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.WriteStream() + ); + client.innerApiCalls.createWriteStream = stubSimpleCall(expectedResponse); + const [response] = await client.createWriteStream(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createWriteStream as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createWriteStream without error using callback', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.CreateWriteStreamRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.WriteStream() + ); + client.innerApiCalls.createWriteStream = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createWriteStream( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.storage.v1.IWriteStream | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createWriteStream as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createWriteStream with error', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.CreateWriteStreamRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createWriteStream = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createWriteStream(request), expectedError); + assert( + (client.innerApiCalls.createWriteStream as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getWriteStream', () => { + it('invokes getWriteStream without error', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.GetWriteStreamRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.WriteStream() + ); + client.innerApiCalls.getWriteStream = stubSimpleCall(expectedResponse); + const [response] = await client.getWriteStream(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getWriteStream as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getWriteStream without error using callback', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.GetWriteStreamRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.WriteStream() + ); + client.innerApiCalls.getWriteStream = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getWriteStream( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.storage.v1.IWriteStream | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getWriteStream as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getWriteStream with error', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.GetWriteStreamRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getWriteStream = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getWriteStream(request), expectedError); + assert( + (client.innerApiCalls.getWriteStream as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('finalizeWriteStream', () => { + it('invokes finalizeWriteStream without error', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse() + ); + client.innerApiCalls.finalizeWriteStream = + stubSimpleCall(expectedResponse); + const [response] = await client.finalizeWriteStream(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.finalizeWriteStream as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes finalizeWriteStream without error using callback', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse() + ); + client.innerApiCalls.finalizeWriteStream = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.finalizeWriteStream( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.finalizeWriteStream as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes finalizeWriteStream with error', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.finalizeWriteStream = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.finalizeWriteStream(request), expectedError); + assert( + (client.innerApiCalls.finalizeWriteStream as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('batchCommitWriteStreams', () => { + it('invokes batchCommitWriteStreams without error', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse() + ); + client.innerApiCalls.batchCommitWriteStreams = + stubSimpleCall(expectedResponse); + const [response] = await client.batchCommitWriteStreams(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchCommitWriteStreams as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes batchCommitWriteStreams without error using callback', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse() + ); + client.innerApiCalls.batchCommitWriteStreams = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchCommitWriteStreams( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchCommitWriteStreams as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes batchCommitWriteStreams with error', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCommitWriteStreams = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.batchCommitWriteStreams(request), + expectedError + ); + assert( + (client.innerApiCalls.batchCommitWriteStreams as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('flushRows', () => { + it('invokes flushRows without error', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.FlushRowsRequest() + ); + request.writeStream = ''; + const expectedHeaderRequestParams = 'write_stream='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.FlushRowsResponse() + ); + client.innerApiCalls.flushRows = stubSimpleCall(expectedResponse); + const [response] = await client.flushRows(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.flushRows as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes flushRows without error using callback', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.FlushRowsRequest() + ); + request.writeStream = ''; + const expectedHeaderRequestParams = 'write_stream='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.FlushRowsResponse() + ); + client.innerApiCalls.flushRows = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.flushRows( + request, + ( + err?: Error | null, + result?: protos.google.cloud.bigquery.storage.v1.IFlushRowsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.flushRows as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes flushRows with error', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.FlushRowsRequest() + ); + request.writeStream = ''; + const expectedHeaderRequestParams = 'write_stream='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.flushRows = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.flushRows(request), expectedError); + assert( + (client.innerApiCalls.flushRows as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('appendRows', () => { + it('invokes appendRows without error', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.AppendRowsRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.AppendRowsResponse() + ); + client.innerApiCalls.appendRows = stubBidiStreamingCall(expectedResponse); + const stream = client.appendRows(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.storage.v1.AppendRowsResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.appendRows as SinonStub) + .getCall(0) + .calledWithExactly(undefined) + ); + assert.deepStrictEqual( + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], + request + ); + }); + + it('invokes appendRows with error', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.AppendRowsRequest() + ); + request.writeStream = ''; + const expectedHeaderRequestParams = 'write_stream='; + const expectedError = new Error('expected'); + client.innerApiCalls.appendRows = stubBidiStreamingCall( + undefined, + expectedError + ); + const stream = client.appendRows(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.storage.v1.AppendRowsResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(promise, expectedError); + assert( + (client.innerApiCalls.appendRows as SinonStub) + .getCall(0) + .calledWithExactly(undefined) + ); + assert.deepStrictEqual( + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], + request + ); + }); + }); + + describe('Path templates', () => { + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + 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('readSession', () => { + const fakePath = '/rendered/path/readSession'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + }; + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.readSessionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.readSessionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('readSessionPath', () => { + const result = client.readSessionPath( + 'projectValue', + 'locationValue', + 'sessionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.readSessionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReadSessionName', () => { + const result = client.matchProjectFromReadSessionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.readSessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReadSessionName', () => { + const result = client.matchLocationFromReadSessionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.readSessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromReadSessionName', () => { + const result = client.matchSessionFromReadSessionName(fakePath); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.readSessionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('readStream', () => { + const fakePath = '/rendered/path/readStream'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + stream: 'streamValue', + }; + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.readStreamPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.readStreamPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('readStreamPath', () => { + const result = client.readStreamPath( + 'projectValue', + 'locationValue', + 'sessionValue', + 'streamValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.readStreamPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReadStreamName', () => { + const result = client.matchProjectFromReadStreamName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.readStreamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReadStreamName', () => { + const result = client.matchLocationFromReadStreamName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.readStreamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromReadStreamName', () => { + const result = client.matchSessionFromReadStreamName(fakePath); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.readStreamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchStreamFromReadStreamName', () => { + const result = client.matchStreamFromReadStreamName(fakePath); + assert.strictEqual(result, 'streamValue'); + assert( + (client.pathTemplates.readStreamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('table', () => { + const fakePath = '/rendered/path/table'; + const expectedParameters = { + project: 'projectValue', + dataset: 'datasetValue', + table: 'tableValue', + }; + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tablePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tablePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tablePath', () => { + const result = client.tablePath( + 'projectValue', + 'datasetValue', + 'tableValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tablePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTableName', () => { + const result = client.matchProjectFromTableName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tablePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromTableName', () => { + const result = client.matchDatasetFromTableName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.tablePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTableFromTableName', () => { + const result = client.matchTableFromTableName(fakePath); + assert.strictEqual(result, 'tableValue'); + assert( + (client.pathTemplates.tablePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('writeStream', () => { + const fakePath = '/rendered/path/writeStream'; + const expectedParameters = { + project: 'projectValue', + dataset: 'datasetValue', + table: 'tableValue', + stream: 'streamValue', + }; + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.writeStreamPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.writeStreamPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('writeStreamPath', () => { + const result = client.writeStreamPath( + 'projectValue', + 'datasetValue', + 'tableValue', + 'streamValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.writeStreamPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromWriteStreamName', () => { + const result = client.matchProjectFromWriteStreamName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.writeStreamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromWriteStreamName', () => { + const result = client.matchDatasetFromWriteStreamName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.writeStreamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTableFromWriteStreamName', () => { + const result = client.matchTableFromWriteStreamName(fakePath); + assert.strictEqual(result, 'tableValue'); + assert( + (client.pathTemplates.writeStreamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchStreamFromWriteStreamName', () => { + const result = client.matchStreamFromWriteStreamName(fakePath); + assert.strictEqual(result, 'streamValue'); + assert( + (client.pathTemplates.writeStreamPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); From 6f7301754ece2791e15095f93c2f08d6bff73086 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 27 Sep 2021 15:36:16 +0000 Subject: [PATCH 134/182] chore: release 2.7.0 (#214) :robot: I have created a release \*beep\* \*boop\* --- ## [2.7.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.6.2...v2.7.0) (2021-09-27) ### Features * add BigQuery Storage Write API v1 ([#209](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/209)) ([e0401d9](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/e0401d96480cd192a2fad8075884d2a8abd417ca)) --- 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-storage/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-storage/package.json | 2 +- .../google-cloud-bigquery-storage/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md index 77c6ab23ab6..8d10cad8bf0 100644 --- a/packages/google-cloud-bigquery-storage/CHANGELOG.md +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.7.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.6.2...v2.7.0) (2021-09-27) + + +### Features + +* add BigQuery Storage Write API v1 ([#209](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/209)) ([e0401d9](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/e0401d96480cd192a2fad8075884d2a8abd417ca)) + ### [2.6.2](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.6.1...v2.6.2) (2021-09-07) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index a5bd884b166..ea671823398 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "2.6.2", + "version": "2.7.0", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index d443ea9f54e..1b5f1de978b 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^2.6.2", + "@google-cloud/bigquery-storage": "^2.7.0", "avsc": "^5.4.18", "snappy": "^7.0.0" }, From f551f3b7420d5e7d56b867e61c464a9186d06385 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:44:58 +0000 Subject: [PATCH 135/182] build(node): update deps used during postprocessing (#1243) (#219) --- .../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-storage/protos/protos.d.ts b/packages/google-cloud-bigquery-storage/protos/protos.d.ts index 7ec3286e4e5..ba247175654 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-storage/protos/protos.d.ts @@ -10601,7 +10601,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-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index 5e9a6239f21..e74a907a0bf 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/protos/protos.js @@ -19766,6 +19766,7 @@ case 4: case 5: case 6: + case 7: break; } } @@ -19870,6 +19871,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) { @@ -26178,6 +26183,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); @@ -26188,6 +26194,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; })(); diff --git a/packages/google-cloud-bigquery-storage/protos/protos.json b/packages/google-cloud-bigquery-storage/protos/protos.json index 7070197fe3b..4feebdb2d72 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.json +++ b/packages/google-cloud-bigquery-storage/protos/protos.json @@ -1988,6 +1988,18 @@ ] ], "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], [ 8, 8 @@ -2550,7 +2562,8 @@ "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, "IMMUTABLE": 5, - "UNORDERED_LIST": 6 + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 } }, "resourceReference": { From 7bd16768bf549e39dd15a10ef76df474dd4f77a9 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Thu, 21 Oct 2021 11:30:26 -0400 Subject: [PATCH 136/182] chore(cloud-rad): delete api-extractor config (#220) --- .../api-extractor.json | 369 ------------------ 1 file changed, 369 deletions(-) delete mode 100644 packages/google-cloud-bigquery-storage/api-extractor.json diff --git a/packages/google-cloud-bigquery-storage/api-extractor.json b/packages/google-cloud-bigquery-storage/api-extractor.json deleted file mode 100644 index de228294b23..00000000000 --- a/packages/google-cloud-bigquery-storage/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 d7bdc6e6ac8bb0c5f7c8360ad709b9649acd6682 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 22 Oct 2021 11:00:28 -0700 Subject: [PATCH 137/182] docs(samples): add auto-generated samples for Node with api short name in region tag (#216) PiperOrigin-RevId: 399287285 Source-Link: https://github.com/googleapis/googleapis/commit/15759865d1c54e3d46429010f7e472fe6c3d3715 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b27fff623a5d8d586b703b5e4919856abe7c2eb3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjI3ZmZmNjIzYTVkOGQ1ODZiNzAzYjVlNDkxOTg1NmFiZTdjMmViMyJ9 --- .../v1/big_query_read.create_read_session.js | 68 +++++++++++++++ .../generated/v1/big_query_read.read_rows.js | 66 ++++++++++++++ .../v1/big_query_read.split_read_stream.js | 62 +++++++++++++ .../v1/big_query_write.append_rows.js | 85 ++++++++++++++++++ ..._query_write.batch_commit_write_streams.js | 58 +++++++++++++ .../v1/big_query_write.create_write_stream.js | 58 +++++++++++++ .../big_query_write.finalize_write_stream.js | 53 ++++++++++++ .../v1/big_query_write.flush_rows.js | 57 ++++++++++++ .../v1/big_query_write.get_write_stream.js | 53 ++++++++++++ ...orage.batch_create_read_session_streams.js | 61 +++++++++++++ .../big_query_storage.create_read_session.js | 86 +++++++++++++++++++ .../big_query_storage.finalize_stream.js | 53 ++++++++++++ .../v1beta1/big_query_storage.read_rows.js | 63 ++++++++++++++ .../big_query_storage.split_read_stream.js | 63 ++++++++++++++ .../src/index.ts | 12 ++- .../src/v1/big_query_read_client_config.json | 3 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 8 +- 18 files changed, 903 insertions(+), 8 deletions(-) create mode 100644 packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js create mode 100644 packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.read_rows.js create mode 100644 packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.split_read_stream.js create mode 100644 packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.append_rows.js create mode 100644 packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.batch_commit_write_streams.js create mode 100644 packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.create_write_stream.js create mode 100644 packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.finalize_write_stream.js create mode 100644 packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.flush_rows.js create mode 100644 packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.get_write_stream.js create mode 100644 packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.batch_create_read_session_streams.js create mode 100644 packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.create_read_session.js create mode 100644 packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.finalize_stream.js create mode 100644 packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.read_rows.js create mode 100644 packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.split_read_stream.js diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js new file mode 100644 index 00000000000..2469979b8cd --- /dev/null +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js @@ -0,0 +1,68 @@ +// 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, readSession) { + // [START bigquerystorage_v1_generated_BigQueryRead_CreateReadSession_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The request project that owns the session, in the form of + * `projects/{project_id}`. + */ + // const parent = 'abc123' + /** + * Required. Session to be created. + */ + // const readSession = '' + /** + * Max initial number of streams. If unset or zero, the server will + * provide a value of streams so as to produce reasonable throughput. Must be + * non-negative. The number of streams may be lower than the requested number, + * depending on the amount parallelism that is reasonable for the table. Error + * will be returned if the max count is greater than the current system + * max limit of 1,000. + * Streams must be read starting from offset 0. + */ + // const maxStreamCount = 1234 + + // Imports the Storage library + const {BigQueryReadClient} = require('@google-cloud/bigquery-storage').v1; + + // Instantiates a client + const storageClient = new BigQueryReadClient(); + + async function createReadSession() { + // Construct request + const request = { + parent, + readSession, + }; + + // Run request + const response = await storageClient.createReadSession(request); + console.log(response); + } + + createReadSession(); + // [END bigquerystorage_v1_generated_BigQueryRead_CreateReadSession_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.read_rows.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.read_rows.js new file mode 100644 index 00000000000..8b9879e020c --- /dev/null +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.read_rows.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(readStream) { + // [START bigquerystorage_v1_generated_BigQueryRead_ReadRows_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Stream to read rows from. + */ + // const readStream = 'abc123' + /** + * The offset requested must be less than the last row read from Read. + * Requesting a larger offset is undefined. If not specified, start reading + * from offset zero. + */ + // const offset = 1234 + + // Imports the Storage library + const {BigQueryReadClient} = require('@google-cloud/bigquery-storage').v1; + + // Instantiates a client + const storageClient = new BigQueryReadClient(); + + async function readRows() { + // Construct request + const request = { + readStream, + }; + + // Run request + const stream = await storageClient.readRows(request); + stream.on('data', response => { + console.log(response); + }); + stream.on('error', err => { + throw err; + }); + stream.on('end', () => { + /* API call completed */ + }); + } + + readRows(); + // [END bigquerystorage_v1_generated_BigQueryRead_ReadRows_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.split_read_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.split_read_stream.js new file mode 100644 index 00000000000..1a13b9bca0f --- /dev/null +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.split_read_stream.js @@ -0,0 +1,62 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START bigquerystorage_v1_generated_BigQueryRead_SplitReadStream_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the stream to split. + */ + // const name = 'abc123' + /** + * A value in the range (0.0, 1.0) that specifies the fractional point at + * which the original stream should be split. The actual split point is + * evaluated on pre-filtered rows, so if a filter is provided, then there is + * no guarantee that the division of the rows between the new child streams + * will be proportional to this fractional value. Additionally, because the + * server-side unit for assigning data is collections of rows, this fraction + * will always map to a data storage boundary on the server side. + */ + // const fraction = 1234 + + // Imports the Storage library + const {BigQueryReadClient} = require('@google-cloud/bigquery-storage').v1; + + // Instantiates a client + const storageClient = new BigQueryReadClient(); + + async function splitReadStream() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await storageClient.splitReadStream(request); + console.log(response); + } + + splitReadStream(); + // [END bigquerystorage_v1_generated_BigQueryRead_SplitReadStream_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.append_rows.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.append_rows.js new file mode 100644 index 00000000000..4e61d52dd25 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.append_rows.js @@ -0,0 +1,85 @@ +// 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(writeStream) { + // [START bigquerystorage_v1_generated_BigQueryWrite_AppendRows_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The write_stream identifies the target of the append operation, and only + * needs to be specified as part of the first request on the gRPC connection. + * If provided for subsequent requests, it must match the value of the first + * request. + * For explicitly created write streams, the format is: + * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` + * For the special default stream, the format is: + * `projects/{project}/datasets/{dataset}/tables/{table}/_default`. + */ + // const writeStream = 'abc123' + /** + * If present, the write is only performed if the next append offset is same + * as the provided value. If not present, the write is performed at the + * current end of stream. Specifying a value for this field is not allowed + * when calling AppendRows for the '_default' stream. + */ + // const offset = '' + /** + * Rows in proto format. + */ + // const protoRows = '' + /** + * Id set by client to annotate its identity. Only initial request setting is + * respected. + */ + // const traceId = 'abc123' + + // Imports the Storage library + const {BigQueryWriteClient} = require('@google-cloud/bigquery-storage').v1; + + // Instantiates a client + const storageClient = new BigQueryWriteClient(); + + async function appendRows() { + // Construct request + const request = { + writeStream, + }; + + // Run request + const stream = await storageClient.appendRows(); + stream.on('data', response => { + console.log(response); + }); + stream.on('error', err => { + throw err; + }); + stream.on('end', () => { + /* API call completed */ + }); + stream.write(request); + stream.end(); + } + + appendRows(); + // [END bigquerystorage_v1_generated_BigQueryWrite_AppendRows_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.batch_commit_write_streams.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.batch_commit_write_streams.js new file mode 100644 index 00000000000..5fddaaf9dd1 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.batch_commit_write_streams.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(parent, writeStreams) { + // [START bigquerystorage_v1_generated_BigQueryWrite_BatchCommitWriteStreams_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent table that all the streams should belong to, in the form of + * `projects/{project}/datasets/{dataset}/tables/{table}`. + */ + // const parent = 'abc123' + /** + * Required. The group of streams that will be committed atomically. + */ + // const writeStreams = 'abc123' + + // Imports the Storage library + const {BigQueryWriteClient} = require('@google-cloud/bigquery-storage').v1; + + // Instantiates a client + const storageClient = new BigQueryWriteClient(); + + async function batchCommitWriteStreams() { + // Construct request + const request = { + parent, + writeStreams, + }; + + // Run request + const response = await storageClient.batchCommitWriteStreams(request); + console.log(response); + } + + batchCommitWriteStreams(); + // [END bigquerystorage_v1_generated_BigQueryWrite_BatchCommitWriteStreams_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.create_write_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.create_write_stream.js new file mode 100644 index 00000000000..6feec1b5738 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.create_write_stream.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(parent, writeStream) { + // [START bigquerystorage_v1_generated_BigQueryWrite_CreateWriteStream_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Reference to the table to which the stream belongs, in the format + * of `projects/{project}/datasets/{dataset}/tables/{table}`. + */ + // const parent = 'abc123' + /** + * Required. Stream to be created. + */ + // const writeStream = '' + + // Imports the Storage library + const {BigQueryWriteClient} = require('@google-cloud/bigquery-storage').v1; + + // Instantiates a client + const storageClient = new BigQueryWriteClient(); + + async function createWriteStream() { + // Construct request + const request = { + parent, + writeStream, + }; + + // Run request + const response = await storageClient.createWriteStream(request); + console.log(response); + } + + createWriteStream(); + // [END bigquerystorage_v1_generated_BigQueryWrite_CreateWriteStream_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.finalize_write_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.finalize_write_stream.js new file mode 100644 index 00000000000..c47a75441e5 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.finalize_write_stream.js @@ -0,0 +1,53 @@ +// 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 bigquerystorage_v1_generated_BigQueryWrite_FinalizeWriteStream_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the stream to finalize, in the form of + * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. + */ + // const name = 'abc123' + + // Imports the Storage library + const {BigQueryWriteClient} = require('@google-cloud/bigquery-storage').v1; + + // Instantiates a client + const storageClient = new BigQueryWriteClient(); + + async function finalizeWriteStream() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await storageClient.finalizeWriteStream(request); + console.log(response); + } + + finalizeWriteStream(); + // [END bigquerystorage_v1_generated_BigQueryWrite_FinalizeWriteStream_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.flush_rows.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.flush_rows.js new file mode 100644 index 00000000000..c5febb0f90e --- /dev/null +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.flush_rows.js @@ -0,0 +1,57 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(writeStream) { + // [START bigquerystorage_v1_generated_BigQueryWrite_FlushRows_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The stream that is the target of the flush operation. + */ + // const writeStream = 'abc123' + /** + * Ending offset of the flush operation. Rows before this offset(including + * this offset) will be flushed. + */ + // const offset = '' + + // Imports the Storage library + const {BigQueryWriteClient} = require('@google-cloud/bigquery-storage').v1; + + // Instantiates a client + const storageClient = new BigQueryWriteClient(); + + async function flushRows() { + // Construct request + const request = { + writeStream, + }; + + // Run request + const response = await storageClient.flushRows(request); + console.log(response); + } + + flushRows(); + // [END bigquerystorage_v1_generated_BigQueryWrite_FlushRows_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.get_write_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.get_write_stream.js new file mode 100644 index 00000000000..fef061c6387 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.get_write_stream.js @@ -0,0 +1,53 @@ +// 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 bigquerystorage_v1_generated_BigQueryWrite_GetWriteStream_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the stream to get, in the form of + * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. + */ + // const name = 'abc123' + + // Imports the Storage library + const {BigQueryWriteClient} = require('@google-cloud/bigquery-storage').v1; + + // Instantiates a client + const storageClient = new BigQueryWriteClient(); + + async function getWriteStream() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await storageClient.getWriteStream(request); + console.log(response); + } + + getWriteStream(); + // [END bigquerystorage_v1_generated_BigQueryWrite_GetWriteStream_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.batch_create_read_session_streams.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.batch_create_read_session_streams.js new file mode 100644 index 00000000000..b7aec1c2b12 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.batch_create_read_session_streams.js @@ -0,0 +1,61 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(session, requestedStreams) { + // [START bigquerystorage_v1beta1_generated_BigQueryStorage_BatchCreateReadSessionStreams_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Must be a non-expired session obtained from a call to + * CreateReadSession. Only the name field needs to be set. + */ + // const session = '' + /** + * Required. Number of new streams requested. Must be positive. + * Number of added streams may be less than this, see CreateReadSessionRequest + * for more information. + */ + // const requestedStreams = 1234 + + // Imports the Storage library + const {BigQueryStorageClient} = + require('@google-cloud/bigquery-storage').v1beta1; + + // Instantiates a client + const storageClient = new BigQueryStorageClient(); + + async function batchCreateReadSessionStreams() { + // Construct request + const request = { + session, + requestedStreams, + }; + + // Run request + const response = await storageClient.batchCreateReadSessionStreams(request); + console.log(response); + } + + batchCreateReadSessionStreams(); + // [END bigquerystorage_v1beta1_generated_BigQueryStorage_BatchCreateReadSessionStreams_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.create_read_session.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.create_read_session.js new file mode 100644 index 00000000000..a133bd1defc --- /dev/null +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.create_read_session.js @@ -0,0 +1,86 @@ +// 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(tableReference, parent) { + // [START bigquerystorage_v1beta1_generated_BigQueryStorage_CreateReadSession_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Reference to the table to read. + */ + // const tableReference = '' + /** + * Required. String of the form `projects/{project_id}` indicating the + * project this ReadSession is associated with. This is the project that will + * be billed for usage. + */ + // const parent = 'abc123' + /** + * Any modifiers to the Table (e.g. snapshot timestamp). + */ + // const tableModifiers = '' + /** + * Initial number of streams. If unset or 0, we will + * provide a value of streams so as to produce reasonable throughput. Must be + * non-negative. The number of streams may be lower than the requested number, + * depending on the amount parallelism that is reasonable for the table and + * the maximum amount of parallelism allowed by the system. + * Streams must be read starting from offset 0. + */ + // const requestedStreams = 1234 + /** + * Read options for this session (e.g. column selection, filters). + */ + // const readOptions = '' + /** + * Data output format. Currently default to Avro. + */ + // const format = '' + /** + * The strategy to use for distributing data among multiple streams. Currently + * defaults to liquid sharding. + */ + // const shardingStrategy = '' + + // Imports the Storage library + const {BigQueryStorageClient} = + require('@google-cloud/bigquery-storage').v1beta1; + + // Instantiates a client + const storageClient = new BigQueryStorageClient(); + + async function createReadSession() { + // Construct request + const request = { + tableReference, + parent, + }; + + // Run request + const response = await storageClient.createReadSession(request); + console.log(response); + } + + createReadSession(); + // [END bigquerystorage_v1beta1_generated_BigQueryStorage_CreateReadSession_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.finalize_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.finalize_stream.js new file mode 100644 index 00000000000..ce23e01ed4a --- /dev/null +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.finalize_stream.js @@ -0,0 +1,53 @@ +// 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(stream) { + // [START bigquerystorage_v1beta1_generated_BigQueryStorage_FinalizeStream_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Stream to finalize. + */ + // const stream = '' + + // Imports the Storage library + const {BigQueryStorageClient} = + require('@google-cloud/bigquery-storage').v1beta1; + + // Instantiates a client + const storageClient = new BigQueryStorageClient(); + + async function finalizeStream() { + // Construct request + const request = { + stream, + }; + + // Run request + const response = await storageClient.finalizeStream(request); + console.log(response); + } + + finalizeStream(); + // [END bigquerystorage_v1beta1_generated_BigQueryStorage_FinalizeStream_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.read_rows.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.read_rows.js new file mode 100644 index 00000000000..029b2038077 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.read_rows.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(readPosition) { + // [START bigquerystorage_v1beta1_generated_BigQueryStorage_ReadRows_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Identifier of the position in the stream to start reading from. + * The offset requested must be less than the last row read from ReadRows. + * Requesting a larger offset is undefined. + */ + // const readPosition = '' + + // Imports the Storage library + const {BigQueryStorageClient} = + require('@google-cloud/bigquery-storage').v1beta1; + + // Instantiates a client + const storageClient = new BigQueryStorageClient(); + + async function readRows() { + // Construct request + const request = { + readPosition, + }; + + // Run request + const stream = await storageClient.readRows(request); + stream.on('data', response => { + console.log(response); + }); + stream.on('error', err => { + throw err; + }); + stream.on('end', () => { + /* API call completed */ + }); + } + + readRows(); + // [END bigquerystorage_v1beta1_generated_BigQueryStorage_ReadRows_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.split_read_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.split_read_stream.js new file mode 100644 index 00000000000..87b7bcc17e0 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.split_read_stream.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(originalStream) { + // [START bigquerystorage_v1beta1_generated_BigQueryStorage_SplitReadStream_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Stream to split. + */ + // const originalStream = '' + /** + * A value in the range (0.0, 1.0) that specifies the fractional point at + * which the original stream should be split. The actual split point is + * evaluated on pre-filtered rows, so if a filter is provided, then there is + * no guarantee that the division of the rows between the new child streams + * will be proportional to this fractional value. Additionally, because the + * server-side unit for assigning data is collections of rows, this fraction + * will always map to to a data storage boundary on the server side. + */ + // const fraction = 1234 + + // Imports the Storage library + const {BigQueryStorageClient} = + require('@google-cloud/bigquery-storage').v1beta1; + + // Instantiates a client + const storageClient = new BigQueryStorageClient(); + + async function splitReadStream() { + // Construct request + const request = { + originalStream, + }; + + // Run request + const response = await storageClient.splitReadStream(request); + console.log(response); + } + + splitReadStream(); + // [END bigquerystorage_v1beta1_generated_BigQueryStorage_SplitReadStream_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-bigquery-storage/src/index.ts b/packages/google-cloud-bigquery-storage/src/index.ts index 3c75be7738d..8d6b763438d 100644 --- a/packages/google-cloud-bigquery-storage/src/index.ts +++ b/packages/google-cloud-bigquery-storage/src/index.ts @@ -20,11 +20,19 @@ import * as v1 from './v1'; import * as v1beta1 from './v1beta1'; const BigQueryReadClient = v1.BigQueryReadClient; type BigQueryReadClient = v1.BigQueryReadClient; +const BigQueryWriteClient = v1.BigQueryWriteClient; +type BigQueryWriteClient = v1.BigQueryWriteClient; const BigQueryStorageClient = v1beta1.BigQueryStorageClient; type BigQueryStorageClient = v1beta1.BigQueryStorageClient; -export {v1, BigQueryReadClient, v1beta1, BigQueryStorageClient}; +export { + v1, + BigQueryReadClient, + v1beta1, + BigQueryStorageClient, + BigQueryWriteClient, +}; // For compatibility with JavaScript libraries we need to provide this default export: // tslint:disable-next-line no-default-export -export default {v1, BigQueryReadClient}; +export default {v1, BigQueryReadClient, BigQueryWriteClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client_config.json b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client_config.json index f129939b0ef..42b2735b9fe 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client_config.json +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client_config.json @@ -34,7 +34,8 @@ "retry_params_name": "default" }, "SplitReadStream": { - "retry_codes_name": "non_idempotent", + "timeout_millis": 600000, + "retry_codes_name": "idempotent", "retry_params_name": "default" } } diff --git a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js index 0e917c476bd..583e1053b26 100644 --- a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js @@ -21,7 +21,7 @@ const storage = require('@google-cloud/bigquery-storage'); function main() { const bigQueryReadClient = new storage.BigQueryReadClient(); - const bigQueryStorageClient = new storage.BigQueryStorageClient(); + const bigQueryWriteClient = new storage.BigQueryWriteClient(); } main(); diff --git a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts index c2e01b6a3a2..a5aa9bb198f 100644 --- a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts @@ -18,14 +18,14 @@ import { BigQueryReadClient, - BigQueryStorageClient, + BigQueryWriteClient, } from '@google-cloud/bigquery-storage'; // check that the client class type name can be used function doStuffWithBigQueryReadClient(client: BigQueryReadClient) { client.close(); } -function doStuffWithBigQueryStorageClient(client: BigQueryStorageClient) { +function doStuffWithBigQueryWriteClient(client: BigQueryWriteClient) { client.close(); } @@ -34,8 +34,8 @@ function main() { const bigQueryReadClient = new BigQueryReadClient(); doStuffWithBigQueryReadClient(bigQueryReadClient); // check that the client instance can be created - const bigQueryStorageClient = new BigQueryStorageClient(); - doStuffWithBigQueryStorageClient(bigQueryStorageClient); + const bigQueryWriteClient = new BigQueryWriteClient(); + doStuffWithBigQueryWriteClient(bigQueryWriteClient); } main(); From 7cade10335a4e7a288cea2d67d3f6cdd94767712 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 26 Oct 2021 23:20:36 +0200 Subject: [PATCH 138/182] chore(deps): update dependency @types/node to v16 (#221) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^14.0.0` -> `^16.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/14.17.32/16.11.6) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/compatibility-slim/14.17.32)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/confidence-slim/14.17.32)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-bigquery-storage). --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index ea671823398..1d074e7123d 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -31,7 +31,7 @@ }, "devDependencies": { "@types/mocha": "^8.0.0", - "@types/node": "^14.0.0", + "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.1.0", "gts": "^2.0.0", From 0be2e89fee77f4d826c2a22f64643c0069f3175c Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Wed, 27 Oct 2021 06:32:18 -0700 Subject: [PATCH 139/182] chore: fix the wrong post processor image (#223) --- packages/google-cloud-bigquery-storage/.github/.OwlBot.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/.github/.OwlBot.yaml b/packages/google-cloud-bigquery-storage/.github/.OwlBot.yaml index 52a82ebed51..2d27e09de99 100644 --- a/packages/google-cloud-bigquery-storage/.github/.OwlBot.yaml +++ b/packages/google-cloud-bigquery-storage/.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-preserve-regex: - /owl-bot-staging/v1alpha2 From 6646a64ce188b62d80f114997a643e774d3de9d5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 4 Nov 2021 20:50:12 +0100 Subject: [PATCH 140/182] chore(deps): update dependency sinon to v12 (#224) 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-storage). --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 1d074e7123d..a890bee3780 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -42,7 +42,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^11.0.0", + "sinon": "^12.0.0", "ts-loader": "^9.0.0", "typescript": "^3.8.3", "webpack": "^5.0.0", From 11c0c7d537225f12a30e2fb5476f91e8f8ffe315 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 15:14:09 -0800 Subject: [PATCH 141/182] docs(samples): add example tags to generated samples (#225) 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 +- .../v1/big_query_read.create_read_session.js | 6 +- .../generated/v1/big_query_read.read_rows.js | 4 +- .../v1/big_query_read.split_read_stream.js | 4 +- .../v1/big_query_write.append_rows.js | 8 +- ..._query_write.batch_commit_write_streams.js | 4 +- .../v1/big_query_write.create_write_stream.js | 6 +- .../big_query_write.finalize_write_stream.js | 4 +- .../v1/big_query_write.flush_rows.js | 6 +- .../v1/big_query_write.get_write_stream.js | 4 +- ...orage.batch_create_read_session_streams.js | 6 +- .../big_query_storage.create_read_session.js | 14 +- .../big_query_storage.finalize_stream.js | 6 +- .../v1beta1/big_query_storage.read_rows.js | 6 +- .../big_query_storage.split_read_stream.js | 6 +- .../src/v1/big_query_read_client.ts | 150 +++++----- .../src/v1/big_query_write_client.ts | 236 ++++++++-------- .../src/v1beta1/big_query_storage_client.ts | 258 +++++++++--------- 18 files changed, 361 insertions(+), 369 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/linkinator.config.json b/packages/google-cloud-bigquery-storage/linkinator.config.json index 29a223b6db6..0121dfa684f 100644 --- a/packages/google-cloud-bigquery-storage/linkinator.config.json +++ b/packages/google-cloud-bigquery-storage/linkinator.config.json @@ -6,5 +6,5 @@ "img.shields.io" ], "silent": true, - "concurrency": 10 + "concurrency": 5 } diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js index 2469979b8cd..6514bcca250 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js @@ -27,7 +27,7 @@ function main(parent, readSession) { /** * Required. Session to be created. */ - // const readSession = '' + // const readSession = {} /** * Max initial number of streams. If unset or zero, the server will * provide a value of streams so as to produce reasonable throughput. Must be @@ -45,7 +45,7 @@ function main(parent, readSession) { // Instantiates a client const storageClient = new BigQueryReadClient(); - async function createReadSession() { + async function callCreateReadSession() { // Construct request const request = { parent, @@ -57,7 +57,7 @@ function main(parent, readSession) { console.log(response); } - createReadSession(); + callCreateReadSession(); // [END bigquerystorage_v1_generated_BigQueryRead_CreateReadSession_async] } diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.read_rows.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.read_rows.js index 8b9879e020c..c853e64dd0f 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.read_rows.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.read_rows.js @@ -36,7 +36,7 @@ function main(readStream) { // Instantiates a client const storageClient = new BigQueryReadClient(); - async function readRows() { + async function callReadRows() { // Construct request const request = { readStream, @@ -55,7 +55,7 @@ function main(readStream) { }); } - readRows(); + callReadRows(); // [END bigquerystorage_v1_generated_BigQueryRead_ReadRows_async] } diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.split_read_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.split_read_stream.js index 1a13b9bca0f..12c8a99dbd9 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.split_read_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.split_read_stream.js @@ -40,7 +40,7 @@ function main(name) { // Instantiates a client const storageClient = new BigQueryReadClient(); - async function splitReadStream() { + async function callSplitReadStream() { // Construct request const request = { name, @@ -51,7 +51,7 @@ function main(name) { console.log(response); } - splitReadStream(); + callSplitReadStream(); // [END bigquerystorage_v1_generated_BigQueryRead_SplitReadStream_async] } diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.append_rows.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.append_rows.js index 4e61d52dd25..f48ff733f78 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.append_rows.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.append_rows.js @@ -36,11 +36,11 @@ function main(writeStream) { * current end of stream. Specifying a value for this field is not allowed * when calling AppendRows for the '_default' stream. */ - // const offset = '' + // const offset = {} /** * Rows in proto format. */ - // const protoRows = '' + // const protoRows = {} /** * Id set by client to annotate its identity. Only initial request setting is * respected. @@ -53,7 +53,7 @@ function main(writeStream) { // Instantiates a client const storageClient = new BigQueryWriteClient(); - async function appendRows() { + async function callAppendRows() { // Construct request const request = { writeStream, @@ -74,7 +74,7 @@ function main(writeStream) { stream.end(); } - appendRows(); + callAppendRows(); // [END bigquerystorage_v1_generated_BigQueryWrite_AppendRows_async] } diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.batch_commit_write_streams.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.batch_commit_write_streams.js index 5fddaaf9dd1..9c290564f7d 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.batch_commit_write_streams.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.batch_commit_write_streams.js @@ -35,7 +35,7 @@ function main(parent, writeStreams) { // Instantiates a client const storageClient = new BigQueryWriteClient(); - async function batchCommitWriteStreams() { + async function callBatchCommitWriteStreams() { // Construct request const request = { parent, @@ -47,7 +47,7 @@ function main(parent, writeStreams) { console.log(response); } - batchCommitWriteStreams(); + callBatchCommitWriteStreams(); // [END bigquerystorage_v1_generated_BigQueryWrite_BatchCommitWriteStreams_async] } diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.create_write_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.create_write_stream.js index 6feec1b5738..5e035e2afef 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.create_write_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.create_write_stream.js @@ -27,7 +27,7 @@ function main(parent, writeStream) { /** * Required. Stream to be created. */ - // const writeStream = '' + // const writeStream = {} // Imports the Storage library const {BigQueryWriteClient} = require('@google-cloud/bigquery-storage').v1; @@ -35,7 +35,7 @@ function main(parent, writeStream) { // Instantiates a client const storageClient = new BigQueryWriteClient(); - async function createWriteStream() { + async function callCreateWriteStream() { // Construct request const request = { parent, @@ -47,7 +47,7 @@ function main(parent, writeStream) { console.log(response); } - createWriteStream(); + callCreateWriteStream(); // [END bigquerystorage_v1_generated_BigQueryWrite_CreateWriteStream_async] } diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.finalize_write_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.finalize_write_stream.js index c47a75441e5..bca7849f860 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.finalize_write_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.finalize_write_stream.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const storageClient = new BigQueryWriteClient(); - async function finalizeWriteStream() { + async function callFinalizeWriteStream() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - finalizeWriteStream(); + callFinalizeWriteStream(); // [END bigquerystorage_v1_generated_BigQueryWrite_FinalizeWriteStream_async] } diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.flush_rows.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.flush_rows.js index c5febb0f90e..e2280592c71 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.flush_rows.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.flush_rows.js @@ -27,7 +27,7 @@ function main(writeStream) { * Ending offset of the flush operation. Rows before this offset(including * this offset) will be flushed. */ - // const offset = '' + // const offset = {} // Imports the Storage library const {BigQueryWriteClient} = require('@google-cloud/bigquery-storage').v1; @@ -35,7 +35,7 @@ function main(writeStream) { // Instantiates a client const storageClient = new BigQueryWriteClient(); - async function flushRows() { + async function callFlushRows() { // Construct request const request = { writeStream, @@ -46,7 +46,7 @@ function main(writeStream) { console.log(response); } - flushRows(); + callFlushRows(); // [END bigquerystorage_v1_generated_BigQueryWrite_FlushRows_async] } diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.get_write_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.get_write_stream.js index fef061c6387..4309dd091ea 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.get_write_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.get_write_stream.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const storageClient = new BigQueryWriteClient(); - async function getWriteStream() { + async function callGetWriteStream() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - getWriteStream(); + callGetWriteStream(); // [END bigquerystorage_v1_generated_BigQueryWrite_GetWriteStream_async] } diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.batch_create_read_session_streams.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.batch_create_read_session_streams.js index b7aec1c2b12..8a669bec643 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.batch_create_read_session_streams.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.batch_create_read_session_streams.js @@ -23,7 +23,7 @@ function main(session, requestedStreams) { * Required. Must be a non-expired session obtained from a call to * CreateReadSession. Only the name field needs to be set. */ - // const session = '' + // const session = {} /** * Required. Number of new streams requested. Must be positive. * Number of added streams may be less than this, see CreateReadSessionRequest @@ -38,7 +38,7 @@ function main(session, requestedStreams) { // Instantiates a client const storageClient = new BigQueryStorageClient(); - async function batchCreateReadSessionStreams() { + async function callBatchCreateReadSessionStreams() { // Construct request const request = { session, @@ -50,7 +50,7 @@ function main(session, requestedStreams) { console.log(response); } - batchCreateReadSessionStreams(); + callBatchCreateReadSessionStreams(); // [END bigquerystorage_v1beta1_generated_BigQueryStorage_BatchCreateReadSessionStreams_async] } diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.create_read_session.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.create_read_session.js index a133bd1defc..11589c89dbb 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.create_read_session.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.create_read_session.js @@ -22,7 +22,7 @@ function main(tableReference, parent) { /** * Required. Reference to the table to read. */ - // const tableReference = '' + // const tableReference = {} /** * Required. String of the form `projects/{project_id}` indicating the * project this ReadSession is associated with. This is the project that will @@ -32,7 +32,7 @@ function main(tableReference, parent) { /** * Any modifiers to the Table (e.g. snapshot timestamp). */ - // const tableModifiers = '' + // const tableModifiers = {} /** * Initial number of streams. If unset or 0, we will * provide a value of streams so as to produce reasonable throughput. Must be @@ -45,16 +45,16 @@ function main(tableReference, parent) { /** * Read options for this session (e.g. column selection, filters). */ - // const readOptions = '' + // const readOptions = {} /** * Data output format. Currently default to Avro. */ - // const format = '' + // const format = {} /** * The strategy to use for distributing data among multiple streams. Currently * defaults to liquid sharding. */ - // const shardingStrategy = '' + // const shardingStrategy = {} // Imports the Storage library const {BigQueryStorageClient} = @@ -63,7 +63,7 @@ function main(tableReference, parent) { // Instantiates a client const storageClient = new BigQueryStorageClient(); - async function createReadSession() { + async function callCreateReadSession() { // Construct request const request = { tableReference, @@ -75,7 +75,7 @@ function main(tableReference, parent) { console.log(response); } - createReadSession(); + callCreateReadSession(); // [END bigquerystorage_v1beta1_generated_BigQueryStorage_CreateReadSession_async] } diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.finalize_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.finalize_stream.js index ce23e01ed4a..fc71cd3eb7f 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.finalize_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.finalize_stream.js @@ -22,7 +22,7 @@ function main(stream) { /** * Required. Stream to finalize. */ - // const stream = '' + // const stream = {} // Imports the Storage library const {BigQueryStorageClient} = @@ -31,7 +31,7 @@ function main(stream) { // Instantiates a client const storageClient = new BigQueryStorageClient(); - async function finalizeStream() { + async function callFinalizeStream() { // Construct request const request = { stream, @@ -42,7 +42,7 @@ function main(stream) { console.log(response); } - finalizeStream(); + callFinalizeStream(); // [END bigquerystorage_v1beta1_generated_BigQueryStorage_FinalizeStream_async] } diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.read_rows.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.read_rows.js index 029b2038077..c80e30bed1e 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.read_rows.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.read_rows.js @@ -24,7 +24,7 @@ function main(readPosition) { * The offset requested must be less than the last row read from ReadRows. * Requesting a larger offset is undefined. */ - // const readPosition = '' + // const readPosition = {} // Imports the Storage library const {BigQueryStorageClient} = @@ -33,7 +33,7 @@ function main(readPosition) { // Instantiates a client const storageClient = new BigQueryStorageClient(); - async function readRows() { + async function callReadRows() { // Construct request const request = { readPosition, @@ -52,7 +52,7 @@ function main(readPosition) { }); } - readRows(); + callReadRows(); // [END bigquerystorage_v1beta1_generated_BigQueryStorage_ReadRows_async] } diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.split_read_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.split_read_stream.js index 87b7bcc17e0..f86ebf52e46 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.split_read_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.split_read_stream.js @@ -22,7 +22,7 @@ function main(originalStream) { /** * Required. Stream to split. */ - // const originalStream = '' + // const originalStream = {} /** * A value in the range (0.0, 1.0) that specifies the fractional point at * which the original stream should be split. The actual split point is @@ -41,7 +41,7 @@ function main(originalStream) { // Instantiates a client const storageClient = new BigQueryStorageClient(); - async function splitReadStream() { + async function callSplitReadStream() { // Construct request const request = { originalStream, @@ -52,7 +52,7 @@ function main(originalStream) { console.log(response); } - splitReadStream(); + callSplitReadStream(); // [END bigquerystorage_v1beta1_generated_BigQueryStorage_SplitReadStream_async] } diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index 10f28e88015..6c822fe16e2 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -321,40 +321,6 @@ export class BigQueryReadClient { // ------------------- // -- Service calls -- // ------------------- - createReadSession( - request?: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.bigquery.storage.v1.IReadSession, - ( - | protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest - | undefined - ), - {} | undefined - ] - >; - createReadSession( - request: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.bigquery.storage.v1.IReadSession, - | protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest - | null - | undefined, - {} | null | undefined - > - ): void; - createReadSession( - request: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, - callback: Callback< - protos.google.cloud.bigquery.storage.v1.IReadSession, - | protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Creates a new read session. A read session divides the contents of a * BigQuery table into one or more streams, which can then be used to read @@ -399,9 +365,43 @@ export class BigQueryReadClient { * 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.createReadSession(request); + * @example include:samples/generated/v1/big_query_read.create_read_session.js + * region_tag:bigquerystorage_v1_generated_BigQueryRead_CreateReadSession_async */ + createReadSession( + request?: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.storage.v1.IReadSession, + ( + | protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest + | undefined + ), + {} | undefined + ] + >; + createReadSession( + request: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.storage.v1.IReadSession, + | protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createReadSession( + request: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, + callback: Callback< + protos.google.cloud.bigquery.storage.v1.IReadSession, + | protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest + | null + | undefined, + {} | null | undefined + > + ): void; createReadSession( request?: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, optionsOrCallback?: @@ -448,40 +448,6 @@ export class BigQueryReadClient { this.initialize(); return this.innerApiCalls.createReadSession(request, options, callback); } - splitReadStream( - request?: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, - ( - | protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest - | undefined - ), - {} | undefined - ] - >; - splitReadStream( - request: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, - | protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest - | null - | undefined, - {} | null | undefined - > - ): void; - splitReadStream( - request: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, - callback: Callback< - protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, - | protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Splits a given `ReadStream` into two `ReadStream` objects. These * `ReadStream` objects are referred to as the primary and the residual @@ -515,9 +481,43 @@ export class BigQueryReadClient { * 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.splitReadStream(request); + * @example include:samples/generated/v1/big_query_read.split_read_stream.js + * region_tag:bigquerystorage_v1_generated_BigQueryRead_SplitReadStream_async */ + splitReadStream( + request?: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, + ( + | protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest + | undefined + ), + {} | undefined + ] + >; + splitReadStream( + request: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, + | protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest + | null + | undefined, + {} | null | undefined + > + ): void; + splitReadStream( + request: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, + callback: Callback< + protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, + | protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest + | null + | undefined, + {} | null | undefined + > + ): void; splitReadStream( request?: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, optionsOrCallback?: @@ -589,10 +589,8 @@ export class BigQueryReadClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) * for more details and examples. - * @example - * const stream = client.readRows(request); - * stream.on('data', (response) => { ... }); - * stream.on('end', () => { ... }); + * @example include:samples/generated/v1/big_query_read.read_rows.js + * region_tag:bigquerystorage_v1_generated_BigQueryRead_ReadRows_async */ readRows( request?: protos.google.cloud.bigquery.storage.v1.IReadRowsRequest, diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts index 62973bfa20a..c87b53c253d 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts @@ -327,6 +327,31 @@ export class BigQueryWriteClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Creates a write stream to the given table. + * Additionally, every table has a special stream named '_default' + * to which data can be written. This stream doesn't need to be created using + * CreateWriteStream. It is a stream that can be used simultaneously by any + * number of clients. Data written to this stream is considered committed as + * soon as an acknowledgement is received. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Reference to the table to which the stream belongs, in the format + * of `projects/{project}/datasets/{dataset}/tables/{table}`. + * @param {google.cloud.bigquery.storage.v1.WriteStream} request.writeStream + * Required. Stream to be created. + * @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 [WriteStream]{@link google.cloud.bigquery.storage.v1.WriteStream}. + * 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/big_query_write.create_write_stream.js + * region_tag:bigquerystorage_v1_generated_BigQueryWrite_CreateWriteStream_async + */ createWriteStream( request?: protos.google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest, options?: CallOptions @@ -361,31 +386,6 @@ export class BigQueryWriteClient { {} | null | undefined > ): void; - /** - * Creates a write stream to the given table. - * Additionally, every table has a special stream named '_default' - * to which data can be written. This stream doesn't need to be created using - * CreateWriteStream. It is a stream that can be used simultaneously by any - * number of clients. Data written to this stream is considered committed as - * soon as an acknowledgement is received. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Reference to the table to which the stream belongs, in the format - * of `projects/{project}/datasets/{dataset}/tables/{table}`. - * @param {google.cloud.bigquery.storage.v1.WriteStream} request.writeStream - * Required. Stream to be created. - * @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 [WriteStream]{@link google.cloud.bigquery.storage.v1.WriteStream}. - * 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.createWriteStream(request); - */ createWriteStream( request?: protos.google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest, optionsOrCallback?: @@ -432,6 +432,24 @@ export class BigQueryWriteClient { this.initialize(); return this.innerApiCalls.createWriteStream(request, options, callback); } + /** + * Gets information about a write stream. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the stream to get, in the form of + * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. + * @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 [WriteStream]{@link google.cloud.bigquery.storage.v1.WriteStream}. + * 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/big_query_write.get_write_stream.js + * region_tag:bigquerystorage_v1_generated_BigQueryWrite_GetWriteStream_async + */ getWriteStream( request?: protos.google.cloud.bigquery.storage.v1.IGetWriteStreamRequest, options?: CallOptions @@ -466,24 +484,6 @@ export class BigQueryWriteClient { {} | null | undefined > ): void; - /** - * Gets information about a write stream. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the stream to get, in the form of - * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. - * @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 [WriteStream]{@link google.cloud.bigquery.storage.v1.WriteStream}. - * 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.getWriteStream(request); - */ getWriteStream( request?: protos.google.cloud.bigquery.storage.v1.IGetWriteStreamRequest, optionsOrCallback?: @@ -530,6 +530,25 @@ export class BigQueryWriteClient { this.initialize(); return this.innerApiCalls.getWriteStream(request, options, callback); } + /** + * Finalize a write stream so that no new data can be appended to the + * stream. Finalize is not supported on the '_default' stream. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the stream to finalize, in the form of + * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. + * @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 [FinalizeWriteStreamResponse]{@link google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse}. + * 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/big_query_write.finalize_write_stream.js + * region_tag:bigquerystorage_v1_generated_BigQueryWrite_FinalizeWriteStream_async + */ finalizeWriteStream( request?: protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest, options?: CallOptions @@ -564,25 +583,6 @@ export class BigQueryWriteClient { {} | null | undefined > ): void; - /** - * Finalize a write stream so that no new data can be appended to the - * stream. Finalize is not supported on the '_default' stream. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the stream to finalize, in the form of - * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. - * @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 [FinalizeWriteStreamResponse]{@link google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse}. - * 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.finalizeWriteStream(request); - */ finalizeWriteStream( request?: protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest, optionsOrCallback?: @@ -629,6 +629,31 @@ export class BigQueryWriteClient { this.initialize(); return this.innerApiCalls.finalizeWriteStream(request, options, callback); } + /** + * Atomically commits a group of `PENDING` streams that belong to the same + * `parent` table. + * + * Streams must be finalized before commit and cannot be committed multiple + * times. Once a stream is committed, data in the stream becomes available + * for read operations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent table that all the streams should belong to, in the form of + * `projects/{project}/datasets/{dataset}/tables/{table}`. + * @param {string[]} request.writeStreams + * Required. The group of streams that will be committed atomically. + * @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 [BatchCommitWriteStreamsResponse]{@link google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse}. + * 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/big_query_write.batch_commit_write_streams.js + * region_tag:bigquerystorage_v1_generated_BigQueryWrite_BatchCommitWriteStreams_async + */ batchCommitWriteStreams( request?: protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest, options?: CallOptions @@ -663,31 +688,6 @@ export class BigQueryWriteClient { {} | null | undefined > ): void; - /** - * Atomically commits a group of `PENDING` streams that belong to the same - * `parent` table. - * - * Streams must be finalized before commit and cannot be committed multiple - * times. Once a stream is committed, data in the stream becomes available - * for read operations. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent table that all the streams should belong to, in the form of - * `projects/{project}/datasets/{dataset}/tables/{table}`. - * @param {string[]} request.writeStreams - * Required. The group of streams that will be committed atomically. - * @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 [BatchCommitWriteStreamsResponse]{@link google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse}. - * 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.batchCommitWriteStreams(request); - */ batchCommitWriteStreams( request?: protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest, optionsOrCallback?: @@ -738,6 +738,33 @@ export class BigQueryWriteClient { callback ); } + /** + * Flushes rows to a BUFFERED stream. + * + * If users are appending rows to BUFFERED stream, flush operation is + * required in order for the rows to become available for reading. A + * Flush operation flushes up to any previously flushed offset in a BUFFERED + * stream, to the offset specified in the request. + * + * Flush is not supported on the _default stream, since it is not BUFFERED. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.writeStream + * Required. The stream that is the target of the flush operation. + * @param {google.protobuf.Int64Value} request.offset + * Ending offset of the flush operation. Rows before this offset(including + * this offset) will be flushed. + * @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 [FlushRowsResponse]{@link google.cloud.bigquery.storage.v1.FlushRowsResponse}. + * 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/big_query_write.flush_rows.js + * region_tag:bigquerystorage_v1_generated_BigQueryWrite_FlushRows_async + */ flushRows( request?: protos.google.cloud.bigquery.storage.v1.IFlushRowsRequest, options?: CallOptions @@ -769,33 +796,6 @@ export class BigQueryWriteClient { {} | null | undefined > ): void; - /** - * Flushes rows to a BUFFERED stream. - * - * If users are appending rows to BUFFERED stream, flush operation is - * required in order for the rows to become available for reading. A - * Flush operation flushes up to any previously flushed offset in a BUFFERED - * stream, to the offset specified in the request. - * - * Flush is not supported on the _default stream, since it is not BUFFERED. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.writeStream - * Required. The stream that is the target of the flush operation. - * @param {google.protobuf.Int64Value} request.offset - * Ending offset of the flush operation. Rows before this offset(including - * this offset) will be flushed. - * @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 [FlushRowsResponse]{@link google.cloud.bigquery.storage.v1.FlushRowsResponse}. - * 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.flushRows(request); - */ flushRows( request?: protos.google.cloud.bigquery.storage.v1.IFlushRowsRequest, optionsOrCallback?: @@ -882,12 +882,8 @@ export class BigQueryWriteClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming) * for more details and examples. - * @example - * const stream = client.appendRows(); - * stream.on('data', (response) => { ... }); - * stream.on('end', () => { ... }); - * stream.write(request); - * stream.end(); + * @example include:samples/generated/v1/big_query_write.append_rows.js + * region_tag:bigquerystorage_v1_generated_BigQueryWrite_AppendRows_async */ appendRows(options?: CallOptions): gax.CancellableStream { this.initialize(); diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index 0ddad79167e..400ba6c1265 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -318,40 +318,6 @@ export class BigQueryStorageClient { // ------------------- // -- Service calls -- // ------------------- - createReadSession( - request?: protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.bigquery.storage.v1beta1.IReadSession, - ( - | protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest - | undefined - ), - {} | undefined - ] - >; - createReadSession( - request: protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.bigquery.storage.v1beta1.IReadSession, - | protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest - | null - | undefined, - {} | null | undefined - > - ): void; - createReadSession( - request: protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, - callback: Callback< - protos.google.cloud.bigquery.storage.v1beta1.IReadSession, - | protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Creates a new read session. A read session divides the contents of a * BigQuery table into one or more streams, which can then be used to read @@ -398,9 +364,43 @@ export class BigQueryStorageClient { * 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.createReadSession(request); + * @example include:samples/generated/v1beta1/big_query_storage.create_read_session.js + * region_tag:bigquerystorage_v1beta1_generated_BigQueryStorage_CreateReadSession_async */ + createReadSession( + request?: protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.storage.v1beta1.IReadSession, + ( + | protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest + | undefined + ), + {} | undefined + ] + >; + createReadSession( + request: protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.storage.v1beta1.IReadSession, + | protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createReadSession( + request: protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, + callback: Callback< + protos.google.cloud.bigquery.storage.v1beta1.IReadSession, + | protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest + | null + | undefined, + {} | null | undefined + > + ): void; createReadSession( request?: protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, optionsOrCallback?: @@ -448,6 +448,30 @@ export class BigQueryStorageClient { this.initialize(); return this.innerApiCalls.createReadSession(request, options, callback); } + /** + * Creates additional streams for a ReadSession. This API can be used to + * dynamically adjust the parallelism of a batch processing task upwards by + * adding additional workers. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.bigquery.storage.v1beta1.ReadSession} request.session + * Required. Must be a non-expired session obtained from a call to + * CreateReadSession. Only the name field needs to be set. + * @param {number} request.requestedStreams + * Required. Number of new streams requested. Must be positive. + * Number of added streams may be less than this, see CreateReadSessionRequest + * for more information. + * @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 [BatchCreateReadSessionStreamsResponse]{@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/big_query_storage.batch_create_read_session_streams.js + * region_tag:bigquerystorage_v1beta1_generated_BigQueryStorage_BatchCreateReadSessionStreams_async + */ batchCreateReadSessionStreams( request?: protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, options?: CallOptions @@ -482,30 +506,6 @@ export class BigQueryStorageClient { {} | null | undefined > ): void; - /** - * Creates additional streams for a ReadSession. This API can be used to - * dynamically adjust the parallelism of a batch processing task upwards by - * adding additional workers. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.bigquery.storage.v1beta1.ReadSession} request.session - * Required. Must be a non-expired session obtained from a call to - * CreateReadSession. Only the name field needs to be set. - * @param {number} request.requestedStreams - * Required. Number of new streams requested. Must be positive. - * Number of added streams may be less than this, see CreateReadSessionRequest - * for more information. - * @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 [BatchCreateReadSessionStreamsResponse]{@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse}. - * 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.batchCreateReadSessionStreams(request); - */ batchCreateReadSessionStreams( request?: protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, optionsOrCallback?: @@ -556,6 +556,36 @@ export class BigQueryStorageClient { callback ); } + /** + * Triggers the graceful termination of a single stream in a ReadSession. This + * API can be used to dynamically adjust the parallelism of a batch processing + * task downwards without losing data. + * + * This API does not delete the stream -- it remains visible in the + * ReadSession, and any data processed by the stream is not released to other + * streams. However, no additional data will be assigned to the stream once + * this call completes. Callers must continue reading data on the stream until + * the end of the stream is reached so that data which has already been + * assigned to the stream will be processed. + * + * This method will return an error if there are no other live streams + * in the Session, or if SplitReadStream() has been called on the given + * Stream. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.bigquery.storage.v1beta1.Stream} request.stream + * Required. Stream to finalize. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/big_query_storage.finalize_stream.js + * region_tag:bigquerystorage_v1beta1_generated_BigQueryStorage_FinalizeStream_async + */ finalizeStream( request?: protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, options?: CallOptions @@ -590,36 +620,6 @@ export class BigQueryStorageClient { {} | null | undefined > ): void; - /** - * Triggers the graceful termination of a single stream in a ReadSession. This - * API can be used to dynamically adjust the parallelism of a batch processing - * task downwards without losing data. - * - * This API does not delete the stream -- it remains visible in the - * ReadSession, and any data processed by the stream is not released to other - * streams. However, no additional data will be assigned to the stream once - * this call completes. Callers must continue reading data on the stream until - * the end of the stream is reached so that data which has already been - * assigned to the stream will be processed. - * - * This method will return an error if there are no other live streams - * in the Session, or if SplitReadStream() has been called on the given - * Stream. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.bigquery.storage.v1beta1.Stream} request.stream - * Required. Stream to finalize. - * @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.finalizeStream(request); - */ finalizeStream( request?: protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, optionsOrCallback?: @@ -666,40 +666,6 @@ export class BigQueryStorageClient { this.initialize(); return this.innerApiCalls.finalizeStream(request, options, callback); } - splitReadStream( - request?: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, - ( - | protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest - | undefined - ), - {} | undefined - ] - >; - splitReadStream( - request: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, - | protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest - | null - | undefined, - {} | null | undefined - > - ): void; - splitReadStream( - request: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, - callback: Callback< - protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, - | protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Splits a given read stream into two Streams. These streams are referred to * as the primary and the residual of the split. The original stream can still @@ -734,9 +700,43 @@ export class BigQueryStorageClient { * 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.splitReadStream(request); + * @example include:samples/generated/v1beta1/big_query_storage.split_read_stream.js + * region_tag:bigquerystorage_v1beta1_generated_BigQueryStorage_SplitReadStream_async */ + splitReadStream( + request?: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, + ( + | protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest + | undefined + ), + {} | undefined + ] + >; + splitReadStream( + request: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, + | protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest + | null + | undefined, + {} | null | undefined + > + ): void; + splitReadStream( + request: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, + callback: Callback< + protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, + | protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest + | null + | undefined, + {} | null | undefined + > + ): void; splitReadStream( request?: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, optionsOrCallback?: @@ -808,10 +808,8 @@ export class BigQueryStorageClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) * for more details and examples. - * @example - * const stream = client.readRows(request); - * stream.on('data', (response) => { ... }); - * stream.on('end', () => { ... }); + * @example include:samples/generated/v1beta1/big_query_storage.read_rows.js + * region_tag:bigquerystorage_v1beta1_generated_BigQueryStorage_ReadRows_async */ readRows( request?: protos.google.cloud.bigquery.storage.v1beta1.IReadRowsRequest, From d364dab2fd3a4547cfa2757968e4c9719ef790d0 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 9 Dec 2021 22:52:22 +0000 Subject: [PATCH 142/182] build: add generated samples to .eslintignore (#229) --- packages/google-cloud-bigquery-storage/.eslintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-bigquery-storage/.eslintignore b/packages/google-cloud-bigquery-storage/.eslintignore index 9340ad9b86d..ea5b04aebe6 100644 --- a/packages/google-cloud-bigquery-storage/.eslintignore +++ b/packages/google-cloud-bigquery-storage/.eslintignore @@ -4,3 +4,4 @@ test/fixtures build/ docs/ protos/ +samples/generated/ From 499ece14d1ed666bc18bbef2d6f7f0d567558f78 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 29 Dec 2021 19:56:15 +0000 Subject: [PATCH 143/182] docs(node): support "stable"/"preview" release level (#1312) (#234) --- packages/google-cloud-bigquery-storage/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-bigquery-storage/README.md b/packages/google-cloud-bigquery-storage/README.md index f7f2caa856b..939e52d27fc 100644 --- a/packages/google-cloud-bigquery-storage/README.md +++ b/packages/google-cloud-bigquery-storage/README.md @@ -229,6 +229,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 df33dc9af7f9662e8681db1ed9a843bb6b5c00d8 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:40:10 +0000 Subject: [PATCH 144/182] feat: add write_mode support for BigQuery Storage Write API v1 (#228) Committer: @anahan PiperOrigin-RevId: 414771198 Source-Link: https://github.com/googleapis/googleapis/commit/8a2398e34424ba7368a5195882386b16cd1b076c Source-Link: https://github.com/googleapis/googleapis-gen/commit/9df7ea386b59d5cc397a392498d3c1a5e5a673cb Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOWRmN2VhMzg2YjU5ZDVjYzM5N2EzOTI0OThkM2MxYTVlNWE2NzNjYiJ9 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> Co-authored-by: Benjamin E. Coe --- .../cloud/bigquery/storage/v1/stream.proto | 13 +++++ .../protos/protos.d.ts | 12 +++++ .../protos/protos.js | 49 +++++++++++++++++++ .../protos/protos.json | 13 +++++ 4 files changed, 87 insertions(+) diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto index dc62e8c00ca..0b0bc1ad05b 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto @@ -171,6 +171,16 @@ message WriteStream { BUFFERED = 3; } + // Mode enum of the stream. + enum WriteMode { + // Unknown type. + WRITE_MODE_UNSPECIFIED = 0; + + // Insert new records into the table. + // It is the default value if customers do not specify it. + INSERT = 1; + } + // Output only. Name of the stream, in the form // `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -193,4 +203,7 @@ message WriteStream { // compatible with this schema to send in initial `AppendRowsRequest`. // The table schema could go out of date during the life time of the stream. TableSchema table_schema = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. Mode of the stream. + WriteMode write_mode = 7 [(google.api.field_behavior) = IMMUTABLE]; } diff --git a/packages/google-cloud-bigquery-storage/protos/protos.d.ts b/packages/google-cloud-bigquery-storage/protos/protos.d.ts index ba247175654..a113f0d4da9 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-storage/protos/protos.d.ts @@ -3447,6 +3447,9 @@ export namespace google { /** WriteStream tableSchema */ tableSchema?: (google.cloud.bigquery.storage.v1.ITableSchema|null); + + /** WriteStream writeMode */ + writeMode?: (google.cloud.bigquery.storage.v1.WriteStream.WriteMode|keyof typeof google.cloud.bigquery.storage.v1.WriteStream.WriteMode|null); } /** Represents a WriteStream. */ @@ -3473,6 +3476,9 @@ export namespace google { /** WriteStream tableSchema. */ public tableSchema?: (google.cloud.bigquery.storage.v1.ITableSchema|null); + /** WriteStream writeMode. */ + public writeMode: (google.cloud.bigquery.storage.v1.WriteStream.WriteMode|keyof typeof google.cloud.bigquery.storage.v1.WriteStream.WriteMode); + /** * Creates a new WriteStream instance using the specified properties. * @param [properties] Properties to set @@ -3553,6 +3559,12 @@ export namespace google { PENDING = 2, BUFFERED = 3 } + + /** WriteMode enum. */ + enum WriteMode { + WRITE_MODE_UNSPECIFIED = 0, + INSERT = 1 + } } /** Properties of a TableSchema. */ diff --git a/packages/google-cloud-bigquery-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index e74a907a0bf..83ac3676d44 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/protos/protos.js @@ -7913,6 +7913,7 @@ * @property {google.protobuf.ITimestamp|null} [createTime] WriteStream createTime * @property {google.protobuf.ITimestamp|null} [commitTime] WriteStream commitTime * @property {google.cloud.bigquery.storage.v1.ITableSchema|null} [tableSchema] WriteStream tableSchema + * @property {google.cloud.bigquery.storage.v1.WriteStream.WriteMode|null} [writeMode] WriteStream writeMode */ /** @@ -7970,6 +7971,14 @@ */ WriteStream.prototype.tableSchema = null; + /** + * WriteStream writeMode. + * @member {google.cloud.bigquery.storage.v1.WriteStream.WriteMode} writeMode + * @memberof google.cloud.bigquery.storage.v1.WriteStream + * @instance + */ + WriteStream.prototype.writeMode = 0; + /** * Creates a new WriteStream instance using the specified properties. * @function create @@ -8004,6 +8013,8 @@ $root.google.protobuf.Timestamp.encode(message.commitTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.tableSchema != null && Object.hasOwnProperty.call(message, "tableSchema")) $root.google.cloud.bigquery.storage.v1.TableSchema.encode(message.tableSchema, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.writeMode != null && Object.hasOwnProperty.call(message, "writeMode")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.writeMode); return writer; }; @@ -8053,6 +8064,9 @@ case 5: message.tableSchema = $root.google.cloud.bigquery.storage.v1.TableSchema.decode(reader, reader.uint32()); break; + case 7: + message.writeMode = reader.int32(); + break; default: reader.skipType(tag & 7); break; @@ -8116,6 +8130,14 @@ if (error) return "tableSchema." + error; } + if (message.writeMode != null && message.hasOwnProperty("writeMode")) + switch (message.writeMode) { + default: + return "writeMode: enum value expected"; + case 0: + case 1: + break; + } return null; }; @@ -8166,6 +8188,16 @@ throw TypeError(".google.cloud.bigquery.storage.v1.WriteStream.tableSchema: object expected"); message.tableSchema = $root.google.cloud.bigquery.storage.v1.TableSchema.fromObject(object.tableSchema); } + switch (object.writeMode) { + case "WRITE_MODE_UNSPECIFIED": + case 0: + message.writeMode = 0; + break; + case "INSERT": + case 1: + message.writeMode = 1; + break; + } return message; }; @@ -8188,6 +8220,7 @@ object.createTime = null; object.commitTime = null; object.tableSchema = null; + object.writeMode = options.enums === String ? "WRITE_MODE_UNSPECIFIED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -8199,6 +8232,8 @@ object.commitTime = $root.google.protobuf.Timestamp.toObject(message.commitTime, options); if (message.tableSchema != null && message.hasOwnProperty("tableSchema")) object.tableSchema = $root.google.cloud.bigquery.storage.v1.TableSchema.toObject(message.tableSchema, options); + if (message.writeMode != null && message.hasOwnProperty("writeMode")) + object.writeMode = options.enums === String ? $root.google.cloud.bigquery.storage.v1.WriteStream.WriteMode[message.writeMode] : message.writeMode; return object; }; @@ -8231,6 +8266,20 @@ return values; })(); + /** + * WriteMode enum. + * @name google.cloud.bigquery.storage.v1.WriteStream.WriteMode + * @enum {number} + * @property {number} WRITE_MODE_UNSPECIFIED=0 WRITE_MODE_UNSPECIFIED value + * @property {number} INSERT=1 INSERT value + */ + WriteStream.WriteMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WRITE_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INSERT"] = 1; + return values; + })(); + return WriteStream; })(); diff --git a/packages/google-cloud-bigquery-storage/protos/protos.json b/packages/google-cloud-bigquery-storage/protos/protos.json index 4feebdb2d72..651ae7e0329 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.json +++ b/packages/google-cloud-bigquery-storage/protos/protos.json @@ -835,6 +835,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "writeMode": { + "type": "WriteMode", + "id": 7, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } } }, "nested": { @@ -845,6 +852,12 @@ "PENDING": 2, "BUFFERED": 3 } + }, + "WriteMode": { + "values": { + "WRITE_MODE_UNSPECIFIED": 0, + "INSERT": 1 + } } } }, From 2768a4e2a970191246f042d5241d9d2ca18c1923 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 145/182] chore: release 2.8.0 (#235) :robot: I have created a release \*beep\* \*boop\* --- ## [2.8.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.7.0...v2.8.0) (2021-12-30) ### Features * add write_mode support for BigQuery Storage Write API v1 ([#228](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/228)) ([18f3123](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/18f3123275716d49460f77cbbc1a4547412087d2)) --- 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-storage/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-storage/package.json | 2 +- .../google-cloud-bigquery-storage/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md index 8d10cad8bf0..7f8d97f132f 100644 --- a/packages/google-cloud-bigquery-storage/CHANGELOG.md +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.8.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.7.0...v2.8.0) (2021-12-30) + + +### Features + +* add write_mode support for BigQuery Storage Write API v1 ([#228](https://www.github.com/googleapis/nodejs-bigquery-storage/issues/228)) ([18f3123](https://www.github.com/googleapis/nodejs-bigquery-storage/commit/18f3123275716d49460f77cbbc1a4547412087d2)) + ## [2.7.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.6.2...v2.7.0) (2021-09-27) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index a890bee3780..6c37a661de2 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "2.7.0", + "version": "2.8.0", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index 1b5f1de978b..b8283e712b1 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^2.7.0", + "@google-cloud/bigquery-storage": "^2.8.0", "avsc": "^5.4.18", "snappy": "^7.0.0" }, From 171dfdc5500722ef7caf68be1934e71de6aae7e4 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:30 +0000 Subject: [PATCH 146/182] docs(badges): tweak badge to use new preview/stable language (#1314) (#236) --- packages/google-cloud-bigquery-storage/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/README.md b/packages/google-cloud-bigquery-storage/README.md index 939e52d27fc..103d0dd88a7 100644 --- a/packages/google-cloud-bigquery-storage/README.md +++ b/packages/google-cloud-bigquery-storage/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-storage.svg)](https://www.npmjs.org/package/@google-cloud/bigquery-storage) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-bigquery-storage/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-bigquery-storage) From 36711ef68c4e389ddcdc09ac21aa30bbea506216 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 30 Dec 2021 18:48:17 -0500 Subject: [PATCH 147/182] chore: add api_shortname and library_type to repo metadata (#233) Update .repo-metadata.json as required by go/library-data-integrity --- .../google-cloud-bigquery-storage/.repo-metadata.json | 6 ++++-- packages/google-cloud-bigquery-storage/README.md | 9 ++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/.repo-metadata.json b/packages/google-cloud-bigquery-storage/.repo-metadata.json index 4283f1fbab0..6d5e38471a7 100644 --- a/packages/google-cloud-bigquery-storage/.repo-metadata.json +++ b/packages/google-cloud-bigquery-storage/.repo-metadata.json @@ -1,6 +1,6 @@ { "distribution_name": "@google-cloud/bigquery-storage", - "release_level": "ga", + "release_level": "stable", "product_documentation": "https://cloud.google.com/bigquery/docs/reference/storage", "repo": "googleapis/nodejs-bigquery-storage", "default_version": "v1", @@ -11,5 +11,7 @@ "name": "bigquerystorage", "name_pretty": "Google BigQuery Storage", "api_id": "bigquerystorage.googleapis.com", - "codeowner_team": "@googleapis/api-bigquery" + "codeowner_team": "@googleapis/api-bigquery", + "api_shortname": "bigquerystorage", + "library_type": "GAPIC_AUTO" } diff --git a/packages/google-cloud-bigquery-storage/README.md b/packages/google-cloud-bigquery-storage/README.md index 103d0dd88a7..8b0a9a7982b 100644 --- a/packages/google-cloud-bigquery-storage/README.md +++ b/packages/google-cloud-bigquery-storage/README.md @@ -4,7 +4,7 @@ # [Google BigQuery Storage: Node.js Client](https://github.com/googleapis/nodejs-bigquery-storage) -[![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-storage.svg)](https://www.npmjs.org/package/@google-cloud/bigquery-storage) @@ -218,10 +218,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. @@ -229,7 +229,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 f158accdf23380b429b7d0a378927f5105f6105c 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:08:25 +0000 Subject: [PATCH 148/182] test(nodejs): remove 15 add 16 (#1322) (#238) --- packages/google-cloud-bigquery-storage/protos/protos.d.ts | 2 +- packages/google-cloud-bigquery-storage/protos/protos.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/protos/protos.d.ts b/packages/google-cloud-bigquery-storage/protos/protos.d.ts index a113f0d4da9..12ded42b9a9 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-storage/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-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index 83ac3676d44..930ac6091f0 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/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 413f47ab60ed66d6448f4cff2a61c6ef7c4e8bd4 Mon Sep 17 00:00:00 2001 From: Steffany Brown <30247553+steffnay@users.noreply.github.com> Date: Mon, 17 Jan 2022 14:50:42 -0800 Subject: [PATCH 149/182] docs(samples): add append rows sample (#232) * docs(samples): add append rows sample * update dependencies * add newline * add offset and short sample version * update pending sample and test * add query and assertions to tests * update timestamp_col value --- packages/google-cloud-bigquery-storage/samples/package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index b8283e712b1..c43c8948751 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -14,12 +14,15 @@ }, "dependencies": { "@google-cloud/bigquery-storage": "^2.8.0", + "google-protobuf": "^3.19.1", "avsc": "^5.4.18", "snappy": "^7.0.0" }, "devDependencies": { + "@google-cloud/bigquery": "^5.9.3", "c8": "^7.0.0", "chai": "^4.2.0", - "mocha": "^8.0.0" + "mocha": "^8.0.0", + "uuid": "^8.0.0" } } From ebfd7041ed201b7d41fffdb974e64b460007edbc Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 19 Jan 2022 17:58:31 +0000 Subject: [PATCH 150/182] build(node): switch back to keystore for publication (#1328) (#243) --- .../google-cloud-bigquery-storage/README.md | 4 ++ .../samples/README.md | 72 +++++++++++++++++++ 2 files changed, 76 insertions(+) diff --git a/packages/google-cloud-bigquery-storage/README.md b/packages/google-cloud-bigquery-storage/README.md index 8b0a9a7982b..ed71e35db22 100644 --- a/packages/google-cloud-bigquery-storage/README.md +++ b/packages/google-cloud-bigquery-storage/README.md @@ -185,7 +185,11 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-bigquery-st | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | +| Append_rows_pending | [source code](https://github.com/googleapis/nodejs-bigquery-storage/blob/main/samples/append_rows_pending.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigquery-storage&page=editor&open_in_editor=samples/append_rows_pending.js,samples/README.md) | +| Append_rows_proto2 | [source code](https://github.com/googleapis/nodejs-bigquery-storage/blob/main/samples/append_rows_proto2.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigquery-storage&page=editor&open_in_editor=samples/append_rows_proto2.js,samples/README.md) | +| Customer_record_pb | [source code](https://github.com/googleapis/nodejs-bigquery-storage/blob/main/samples/customer_record_pb.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigquery-storage&page=editor&open_in_editor=samples/customer_record_pb.js,samples/README.md) | | BigQuery Storage Quickstart | [source code](https://github.com/googleapis/nodejs-bigquery-storage/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-storage&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Sample_data_pb2 | [source code](https://github.com/googleapis/nodejs-bigquery-storage/blob/main/samples/sample_data_pb2.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigquery-storage&page=editor&open_in_editor=samples/sample_data_pb2.js,samples/README.md) | diff --git a/packages/google-cloud-bigquery-storage/samples/README.md b/packages/google-cloud-bigquery-storage/samples/README.md index 953b83c0931..26adb60c4e1 100644 --- a/packages/google-cloud-bigquery-storage/samples/README.md +++ b/packages/google-cloud-bigquery-storage/samples/README.md @@ -12,7 +12,11 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Append_rows_pending](#append_rows_pending) + * [Append_rows_proto2](#append_rows_proto2) + * [Customer_record_pb](#customer_record_pb) * [BigQuery Storage Quickstart](#bigquery-storage-quickstart) + * [Sample_data_pb2](#sample_data_pb2) ## Before you begin @@ -29,6 +33,57 @@ Before running the samples, make sure you've followed the steps outlined in +### Append_rows_pending + +View the [source code](https://github.com/googleapis/nodejs-bigquery-storage/blob/main/samples/append_rows_pending.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigquery-storage&page=editor&open_in_editor=samples/append_rows_pending.js,samples/README.md) + +__Usage:__ + + +`node samples/append_rows_pending.js` + + +----- + + + + +### Append_rows_proto2 + +View the [source code](https://github.com/googleapis/nodejs-bigquery-storage/blob/main/samples/append_rows_proto2.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigquery-storage&page=editor&open_in_editor=samples/append_rows_proto2.js,samples/README.md) + +__Usage:__ + + +`node samples/append_rows_proto2.js` + + +----- + + + + +### Customer_record_pb + +View the [source code](https://github.com/googleapis/nodejs-bigquery-storage/blob/main/samples/customer_record_pb.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigquery-storage&page=editor&open_in_editor=samples/customer_record_pb.js,samples/README.md) + +__Usage:__ + + +`node samples/customer_record_pb.js` + + +----- + + + + ### BigQuery Storage Quickstart Read data from a table via read stream. @@ -43,6 +98,23 @@ __Usage:__ `node quickstart.js` +----- + + + + +### Sample_data_pb2 + +View the [source code](https://github.com/googleapis/nodejs-bigquery-storage/blob/main/samples/sample_data_pb2.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigquery-storage&page=editor&open_in_editor=samples/sample_data_pb2.js,samples/README.md) + +__Usage:__ + + +`node samples/sample_data_pb2.js` + + From 96fdd535eb581ee76d551bd6538386867181f8c2 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 19 Jan 2022 20:38:51 +0100 Subject: [PATCH 151/182] chore(deps): update dependency gts to v3 (#239) 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-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 6c37a661de2..02692b0ed74 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -34,7 +34,7 @@ "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.1.0", - "gts": "^2.0.0", + "gts": "^3.0.0", "jsdoc": "^3.6.3", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", From 276d104b35f1ad4b73191329b3b60e1122590846 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 19 Jan 2022 11:49:05 -0800 Subject: [PATCH 152/182] chore(deps): upgrade gapic-generator-java to 2.4.1 (#242) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): upgrade gapic-generator-java to 2.4.1 PiperOrigin-RevId: 422607515 Source-Link: https://github.com/googleapis/googleapis/commit/ba2ffd6fe6642e28b4fed2ffae217b4c5f084034 Source-Link: https://github.com/googleapis/googleapis-gen/commit/73ba4add239a619da567ffbd4e5730fdd6de04d3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzNiYTRhZGQyMzlhNjE5ZGE1NjdmZmJkNGU1NzMwZmRkNmRlMDRkMyJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Steffany Brown <30247553+steffnay@users.noreply.github.com> --- packages/google-cloud-bigquery-storage/.jsdoc.js | 4 ++-- .../v1/big_query_read.create_read_session.js | 1 + .../generated/v1/big_query_read.read_rows.js | 13 ++++--------- .../v1/big_query_read.split_read_stream.js | 1 + .../generated/v1/big_query_write.append_rows.js | 15 +++++---------- ...big_query_write.batch_commit_write_streams.js | 1 + .../v1/big_query_write.create_write_stream.js | 1 + .../v1/big_query_write.finalize_write_stream.js | 1 + .../generated/v1/big_query_write.flush_rows.js | 1 + .../v1/big_query_write.get_write_stream.js | 1 + ..._storage.batch_create_read_session_streams.js | 4 ++-- .../big_query_storage.create_read_session.js | 4 ++-- .../v1beta1/big_query_storage.finalize_stream.js | 4 ++-- .../v1beta1/big_query_storage.read_rows.js | 16 +++++----------- .../big_query_storage.split_read_stream.js | 4 ++-- .../src/v1/big_query_read_client.ts | 2 +- .../src/v1/big_query_write_client.ts | 2 +- .../src/v1/index.ts | 2 +- .../src/v1beta1/big_query_storage_client.ts | 2 +- .../src/v1beta1/index.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_big_query_read_v1.ts | 2 +- .../test/gapic_big_query_storage_v1beta1.ts | 2 +- .../test/gapic_big_query_write_v1.ts | 2 +- 26 files changed, 42 insertions(+), 51 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/.jsdoc.js b/packages/google-cloud-bigquery-storage/.jsdoc.js index 9451ad92fe9..21870f2a75f 100644 --- a/packages/google-cloud-bigquery-storage/.jsdoc.js +++ b/packages/google-cloud-bigquery-storage/.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-storage', diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js index 6514bcca250..a14c16b7ba0 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, readSession) { diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.read_rows.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.read_rows.js index c853e64dd0f..a51ad69dd47 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.read_rows.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.read_rows.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(readStream) { @@ -44,15 +45,9 @@ function main(readStream) { // Run request const stream = await storageClient.readRows(request); - stream.on('data', response => { - console.log(response); - }); - stream.on('error', err => { - throw err; - }); - stream.on('end', () => { - /* API call completed */ - }); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); } callReadRows(); diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.split_read_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.split_read_stream.js index 12c8a99dbd9..478f78e1e90 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.split_read_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.split_read_stream.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.append_rows.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.append_rows.js index f48ff733f78..51db4c07a0e 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.append_rows.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.append_rows.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(writeStream) { @@ -61,17 +62,11 @@ function main(writeStream) { // Run request const stream = await storageClient.appendRows(); - stream.on('data', response => { - console.log(response); - }); - stream.on('error', err => { - throw err; - }); - stream.on('end', () => { - /* API call completed */ - }); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); stream.write(request); - stream.end(); + stream.end(); } callAppendRows(); diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.batch_commit_write_streams.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.batch_commit_write_streams.js index 9c290564f7d..a9f7ea031e7 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.batch_commit_write_streams.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.batch_commit_write_streams.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, writeStreams) { diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.create_write_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.create_write_stream.js index 5e035e2afef..4537cb615f3 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.create_write_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.create_write_stream.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, writeStream) { diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.finalize_write_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.finalize_write_stream.js index bca7849f860..bb660301138 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.finalize_write_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.finalize_write_stream.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.flush_rows.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.flush_rows.js index e2280592c71..94f1f5253a9 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.flush_rows.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.flush_rows.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(writeStream) { diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.get_write_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.get_write_stream.js index 4309dd091ea..4f2caa2a80c 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.get_write_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.get_write_stream.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.batch_create_read_session_streams.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.batch_create_read_session_streams.js index 8a669bec643..ed64422d3a1 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.batch_create_read_session_streams.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.batch_create_read_session_streams.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(session, requestedStreams) { @@ -32,8 +33,7 @@ function main(session, requestedStreams) { // const requestedStreams = 1234 // Imports the Storage library - const {BigQueryStorageClient} = - require('@google-cloud/bigquery-storage').v1beta1; + const {BigQueryStorageClient} = require('@google-cloud/bigquery-storage').v1beta1; // Instantiates a client const storageClient = new BigQueryStorageClient(); diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.create_read_session.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.create_read_session.js index 11589c89dbb..9cf38ca4274 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.create_read_session.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.create_read_session.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(tableReference, parent) { @@ -57,8 +58,7 @@ function main(tableReference, parent) { // const shardingStrategy = {} // Imports the Storage library - const {BigQueryStorageClient} = - require('@google-cloud/bigquery-storage').v1beta1; + const {BigQueryStorageClient} = require('@google-cloud/bigquery-storage').v1beta1; // Instantiates a client const storageClient = new BigQueryStorageClient(); diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.finalize_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.finalize_stream.js index fc71cd3eb7f..33ca0da184a 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.finalize_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.finalize_stream.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(stream) { @@ -25,8 +26,7 @@ function main(stream) { // const stream = {} // Imports the Storage library - const {BigQueryStorageClient} = - require('@google-cloud/bigquery-storage').v1beta1; + const {BigQueryStorageClient} = require('@google-cloud/bigquery-storage').v1beta1; // Instantiates a client const storageClient = new BigQueryStorageClient(); diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.read_rows.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.read_rows.js index c80e30bed1e..5436f8f83fb 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.read_rows.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.read_rows.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(readPosition) { @@ -27,8 +28,7 @@ function main(readPosition) { // const readPosition = {} // Imports the Storage library - const {BigQueryStorageClient} = - require('@google-cloud/bigquery-storage').v1beta1; + const {BigQueryStorageClient} = require('@google-cloud/bigquery-storage').v1beta1; // Instantiates a client const storageClient = new BigQueryStorageClient(); @@ -41,15 +41,9 @@ function main(readPosition) { // Run request const stream = await storageClient.readRows(request); - stream.on('data', response => { - console.log(response); - }); - stream.on('error', err => { - throw err; - }); - stream.on('end', () => { - /* API call completed */ - }); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); } callReadRows(); diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.split_read_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.split_read_stream.js index f86ebf52e46..a517cdf5562 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.split_read_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.split_read_stream.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(originalStream) { @@ -35,8 +36,7 @@ function main(originalStream) { // const fraction = 1234 // Imports the Storage library - const {BigQueryStorageClient} = - require('@google-cloud/bigquery-storage').v1beta1; + const {BigQueryStorageClient} = require('@google-cloud/bigquery-storage').v1beta1; // Instantiates a client const storageClient = new BigQueryStorageClient(); diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index 6c822fe16e2..f133143b2fe 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_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-storage/src/v1/big_query_write_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts index c87b53c253d..b775bf6fe29 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_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-storage/src/v1/index.ts b/packages/google-cloud-bigquery-storage/src/v1/index.ts index e1965026c9e..f3bacd94214 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/index.ts +++ b/packages/google-cloud-bigquery-storage/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-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index 400ba6c1265..72b13b1ef43 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_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-storage/src/v1beta1/index.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/index.ts index 2c9b3f3f526..dc3afed8ea7 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/index.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js index 583e1053b26..d59c13c62cd 100644 --- a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-bigquery-storage/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-storage/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts index a5aa9bb198f..6fd6e3ca7ee 100644 --- a/packages/google-cloud-bigquery-storage/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-bigquery-storage/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-storage/system-test/install.ts b/packages/google-cloud-bigquery-storage/system-test/install.ts index d2d61c0396f..6dd1eaadafa 100644 --- a/packages/google-cloud-bigquery-storage/system-test/install.ts +++ b/packages/google-cloud-bigquery-storage/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-storage/test/gapic_big_query_read_v1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts index eeb7c0e2cf2..a5c551d3198 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts index b4821b15682..3365f629aee 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_write_v1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_write_v1.ts index e4ba9ae6bdc..608b649713f 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_write_v1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_write_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 71ae323313157176e2b6c5795e5de44ac83032f0 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:08:31 +0000 Subject: [PATCH 153/182] docs(nodejs): version support policy edits (#1346) (#248) --- .../google-cloud-bigquery-storage/README.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/README.md b/packages/google-cloud-bigquery-storage/README.md index ed71e35db22..40dfb1f6162 100644 --- a/packages/google-cloud-bigquery-storage/README.md +++ b/packages/google-cloud-bigquery-storage/README.md @@ -201,21 +201,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-storage@legacy-8` installs client libraries +for versions compatible with Node.js 8. ## Versioning From c12b4e6726adddefb4faffb7ed0afca4007e0ace Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 5 Feb 2022 18:38:56 +0100 Subject: [PATCH 154/182] chore(deps): update dependency sinon to v13 (#246) 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-storage). --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 02692b0ed74..2790c6440f6 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -42,7 +42,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^12.0.0", + "sinon": "^13.0.0", "ts-loader": "^9.0.0", "typescript": "^3.8.3", "webpack": "^5.0.0", From db6134c6fb604e27983f68009f0d36d725ef447c 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 14:13:51 -0700 Subject: [PATCH 155/182] feat: Deprecate format specific `row_count` field in Read API (#249) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix!: remove bigquery.readonly auth scope PiperOrigin-RevId: 429331987 Source-Link: https://github.com/googleapis/googleapis/commit/4b2bd2637d6df992933b7437cf64f1c7d7b6ed9b Source-Link: https://github.com/googleapis/googleapis-gen/commit/fa17f03b5ae96316cd02f2997f2fd1196e034e5e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZmExN2YwM2I1YWU5NjMxNmNkMDJmMjk5N2YyZmQxMTk2ZTAzNGU1ZSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs(samples): include metadata file, add exclusions for samples to handwritten libraries 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 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add trace_id for Read API PiperOrigin-RevId: 429809867 Source-Link: https://github.com/googleapis/googleapis/commit/60526031e76ff3ed1ec512896f9b8d1e55d6eb45 Source-Link: https://github.com/googleapis/googleapis-gen/commit/840dd14c91a0ec66d9bd1a028d01b5fd029ca02e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODQwZGQxNGM5MWEwZWM2NmQ5YmQxYTAyOGQwMWI1ZmQwMjljYTAyZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: improve documentation for write client feat: update default timeout/retry information feat: update parent annotation for BatchCommitWriteStreamsRequest feat: expose additional StorageError enum values PiperOrigin-RevId: 431973595 Source-Link: https://github.com/googleapis/googleapis/commit/25d691b074e0b932e1c3f8a690ced8ddec8ae50e Source-Link: https://github.com/googleapis/googleapis-gen/commit/0ca21879ae3136a2d71fa824b49dfaf8a0ae0f2e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGNhMjE4NzlhZTMxMzZhMmQ3MWZhODI0YjQ5ZGZhZjhhMGFlMGYyZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: update v2.14.1 gapic-generator-typescript Committer: @summer-ji-eng PiperOrigin-RevId: 433031262 Source-Link: https://github.com/googleapis/googleapis/commit/2a55d13d9dc6cbf99990d1ab490e0ea07b5e7649 Source-Link: https://github.com/googleapis/googleapis-gen/commit/2fce3893ae9da47763e0872c4a3a87d9ff78771f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmZjZTM4OTNhZTlkYTQ3NzYzZTA4NzJjNGEzYTg3ZDlmZjc4NzcxZiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 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 * feat: Deprecate format specific `row_count` field in Read API PiperOrigin-RevId: 438434001 Source-Link: https://github.com/googleapis/googleapis/commit/727f08ba466745c17f71cd2084540878392de31d Source-Link: https://github.com/googleapis/googleapis-gen/commit/2d62ab0d3d650b7aba4ec5e5a96dd8cdbae89fb7 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmQ2MmFiMGQzZDY1MGI3YWJhNGVjNWU1YTk2ZGQ4Y2RiYWU4OWZiNyJ9 * 🦉 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 Co-authored-by: Steffany Brown <30247553+steffnay@users.noreply.github.com> Co-authored-by: Benjamin E. Coe Co-authored-by: Jeffrey Rennie --- .../linkinator.config.json | 10 +- .../cloud/bigquery/storage/v1/arrow.proto | 7 +- .../cloud/bigquery/storage/v1/avro.proto | 7 +- .../cloud/bigquery/storage/v1/protobuf.proto | 2 +- .../cloud/bigquery/storage/v1/storage.proto | 27 +- .../cloud/bigquery/storage/v1/stream.proto | 10 +- .../cloud/bigquery/storage/v1/table.proto | 2 +- .../bigquery/storage/v1beta1/storage.proto | 1 - .../protos/protos.d.ts | 10 +- .../protos/protos.js | 36 ++ .../protos/protos.json | 28 +- .../v1/big_query_read.create_read_session.js | 9 +- .../generated/v1/big_query_read.read_rows.js | 9 +- .../v1/big_query_read.split_read_stream.js | 9 +- .../v1/big_query_write.append_rows.js | 13 +- ..._query_write.batch_commit_write_streams.js | 9 +- .../v1/big_query_write.create_write_stream.js | 9 +- .../big_query_write.finalize_write_stream.js | 9 +- .../v1/big_query_write.flush_rows.js | 9 +- .../v1/big_query_write.get_write_stream.js | 9 +- ...data.google.cloud.bigquery.storage.v1.json | 415 ++++++++++++++++++ ...orage.batch_create_read_session_streams.js | 9 +- .../big_query_storage.create_read_session.js | 9 +- .../big_query_storage.finalize_stream.js | 9 +- .../v1beta1/big_query_storage.read_rows.js | 9 +- .../big_query_storage.split_read_stream.js | 9 +- ...google.cloud.bigquery.storage.v1beta1.json | 247 +++++++++++ .../src/v1/big_query_read_client.ts | 27 +- .../src/v1/big_query_write_client.ts | 33 +- .../src/v1beta1/big_query_storage_client.ts | 27 +- .../test/gapic_big_query_read_v1.ts | 79 +++- .../test/gapic_big_query_storage_v1beta1.ts | 119 ++++- .../test/gapic_big_query_write_v1.ts | 103 ++++- 33 files changed, 1239 insertions(+), 81 deletions(-) create mode 100644 packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json create mode 100644 packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json diff --git a/packages/google-cloud-bigquery-storage/linkinator.config.json b/packages/google-cloud-bigquery-storage/linkinator.config.json index 0121dfa684f..befd23c8633 100644 --- a/packages/google-cloud-bigquery-storage/linkinator.config.json +++ b/packages/google-cloud-bigquery-storage/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-storage/protos/google/cloud/bigquery/storage/v1/arrow.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/arrow.proto index 514b77e617c..6d3f6080bf6 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/arrow.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/arrow.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. @@ -39,8 +39,9 @@ message ArrowRecordBatch { // IPC-serialized Arrow RecordBatch. bytes serialized_record_batch = 1; - // The count of rows in `serialized_record_batch`. - int64 row_count = 2; + // [Deprecated] The count of rows in `serialized_record_batch`. + // Please use the format-independent ReadRowsResponse.row_count instead. + int64 row_count = 2 [deprecated = true]; } // Contains options specific to Arrow Serialization. diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/avro.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/avro.proto index dee4a6ed229..15de2db5468 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/avro.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/avro.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. @@ -35,6 +35,7 @@ message AvroRows { // Binary serialized rows in a block. bytes serialized_binary_rows = 1; - // The count of rows in the returning block. - int64 row_count = 2; + // [Deprecated] The count of rows in the returning block. + // Please use the format-independent ReadRowsResponse.row_count instead. + int64 row_count = 2 [deprecated = true]; } diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/protobuf.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/protobuf.proto index f987467dd9f..b3754acf7b3 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/protobuf.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/protobuf.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. diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto index ab5a46cf180..67c6c8a0295 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.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. @@ -47,7 +47,6 @@ service BigQueryRead { option (google.api.default_host) = "bigquerystorage.googleapis.com"; option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/bigquery," - "https://www.googleapis.com/auth/bigquery.readonly," "https://www.googleapis.com/auth/cloud-platform"; // Creates a new read session. A read session divides the contents of a @@ -168,6 +167,13 @@ service BigQueryWrite { // * For PENDING streams, data is not made visible until the stream itself is // finalized (via the `FinalizeWriteStream` rpc), and the stream is explicitly // committed via the `BatchCommitWriteStreams` rpc. + // + // Note: For users coding against the gRPC api directly, it may be + // necessary to supply the x-goog-request-params system parameter + // with `write_stream=`. + // + // More information about system parameters: + // https://cloud.google.com/apis/docs/system-parameters rpc AppendRows(stream AppendRowsRequest) returns (stream AppendRowsResponse) { option (google.api.http) = { post: "/v1/{write_stream=projects/*/datasets/*/tables/*/streams/*}" @@ -409,10 +415,12 @@ message AppendRowsRequest { // request. // // For explicitly created write streams, the format is: - // `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` + // + // * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` // // For the special default stream, the format is: - // `projects/{project}/datasets/{dataset}/tables/{table}/_default`. + // + // * `projects/{project}/datasets/{dataset}/tables/{table}/streams/_default`. string write_stream = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -499,7 +507,10 @@ message BatchCommitWriteStreamsRequest { // Required. Parent table that all the streams should belong to, in the form of // `projects/{project}/datasets/{dataset}/tables/{table}`. string parent = 1 [ - (google.api.field_behavior) = REQUIRED + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigquery.googleapis.com/Table" + } ]; // Required. The group of streams that will be committed atomically. @@ -594,6 +605,12 @@ message StorageError { // There is a schema mismatch and it is caused by user schema has extra // field than bigquery schema. SCHEMA_MISMATCH_EXTRA_FIELDS = 7; + + // Offset already exists. + OFFSET_ALREADY_EXISTS = 8; + + // Offset out of range. + OFFSET_OUT_OF_RANGE = 9; } // BigQuery Storage specific error code. diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto index 0b0bc1ad05b..bd1fa2ce98a 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.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. @@ -132,6 +132,14 @@ message ReadSession { // all streams are completely consumed. This estimate is based on // metadata from the table which might be incomplete or stale. int64 estimated_total_bytes_scanned = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. ID set by client to annotate a session identity. This does not need + // to be strictly unique, but instead the same ID should be used to group + // logically connected sessions (e.g. All using the same ID for all sessions + // needed to complete a Spark SQL query is reasonable). + // + // Maximum length is 256 bytes. + string trace_id = 13 [(google.api.field_behavior) = OPTIONAL]; } // Information about a single stream that gets data out of the storage system. diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/table.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/table.proto index a8c6f844df5..545f6292712 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/table.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/table.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. diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/storage.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/storage.proto index 81e77c73af5..0d311418a49 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/storage.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/storage.proto @@ -37,7 +37,6 @@ service BigQueryStorage { option (google.api.default_host) = "bigquerystorage.googleapis.com"; option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/bigquery," - "https://www.googleapis.com/auth/bigquery.readonly," "https://www.googleapis.com/auth/cloud-platform"; // Creates a new read session. A read session divides the contents of a diff --git a/packages/google-cloud-bigquery-storage/protos/protos.d.ts b/packages/google-cloud-bigquery-storage/protos/protos.d.ts index 12ded42b9a9..a82f40762cd 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-storage/protos/protos.d.ts @@ -2984,7 +2984,9 @@ export namespace google { INVALID_STREAM_TYPE = 4, INVALID_STREAM_STATE = 5, STREAM_FINALIZED = 6, - SCHEMA_MISMATCH_EXTRA_FIELDS = 7 + SCHEMA_MISMATCH_EXTRA_FIELDS = 7, + OFFSET_ALREADY_EXISTS = 8, + OFFSET_OUT_OF_RANGE = 9 } } @@ -3027,6 +3029,9 @@ export namespace google { /** ReadSession estimatedTotalBytesScanned */ estimatedTotalBytesScanned?: (number|Long|string|null); + + /** ReadSession traceId */ + traceId?: (string|null); } /** Represents a ReadSession. */ @@ -3068,6 +3073,9 @@ export namespace google { /** ReadSession estimatedTotalBytesScanned. */ public estimatedTotalBytesScanned: (number|Long|string); + /** ReadSession traceId. */ + public traceId: string; + /** ReadSession schema. */ public schema?: ("avroSchema"|"arrowSchema"); diff --git a/packages/google-cloud-bigquery-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index 930ac6091f0..1d0989c2671 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/protos/protos.js @@ -6611,6 +6611,8 @@ case 5: case 6: case 7: + case 8: + case 9: break; } if (message.entity != null && message.hasOwnProperty("entity")) @@ -6667,6 +6669,14 @@ case 7: message.code = 7; break; + case "OFFSET_ALREADY_EXISTS": + case 8: + message.code = 8; + break; + case "OFFSET_OUT_OF_RANGE": + case 9: + message.code = 9; + break; } if (object.entity != null) message.entity = String(object.entity); @@ -6725,6 +6735,8 @@ * @property {number} INVALID_STREAM_STATE=5 INVALID_STREAM_STATE value * @property {number} STREAM_FINALIZED=6 STREAM_FINALIZED value * @property {number} SCHEMA_MISMATCH_EXTRA_FIELDS=7 SCHEMA_MISMATCH_EXTRA_FIELDS value + * @property {number} OFFSET_ALREADY_EXISTS=8 OFFSET_ALREADY_EXISTS value + * @property {number} OFFSET_OUT_OF_RANGE=9 OFFSET_OUT_OF_RANGE value */ StorageError.StorageErrorCode = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -6736,6 +6748,8 @@ values[valuesById[5] = "INVALID_STREAM_STATE"] = 5; values[valuesById[6] = "STREAM_FINALIZED"] = 6; values[valuesById[7] = "SCHEMA_MISMATCH_EXTRA_FIELDS"] = 7; + values[valuesById[8] = "OFFSET_ALREADY_EXISTS"] = 8; + values[valuesById[9] = "OFFSET_OUT_OF_RANGE"] = 9; return values; })(); @@ -6774,6 +6788,7 @@ * @property {google.cloud.bigquery.storage.v1.ReadSession.ITableReadOptions|null} [readOptions] ReadSession readOptions * @property {Array.|null} [streams] ReadSession streams * @property {number|Long|null} [estimatedTotalBytesScanned] ReadSession estimatedTotalBytesScanned + * @property {string|null} [traceId] ReadSession traceId */ /** @@ -6872,6 +6887,14 @@ */ ReadSession.prototype.estimatedTotalBytesScanned = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * ReadSession traceId. + * @member {string} traceId + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @instance + */ + ReadSession.prototype.traceId = ""; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -6931,6 +6954,8 @@ $root.google.cloud.bigquery.storage.v1.ReadStream.encode(message.streams[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); if (message.estimatedTotalBytesScanned != null && Object.hasOwnProperty.call(message, "estimatedTotalBytesScanned")) writer.uint32(/* id 12, wireType 0 =*/96).int64(message.estimatedTotalBytesScanned); + if (message.traceId != null && Object.hasOwnProperty.call(message, "traceId")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.traceId); return writer; }; @@ -6997,6 +7022,9 @@ case 12: message.estimatedTotalBytesScanned = reader.int64(); break; + case 13: + message.traceId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -7093,6 +7121,9 @@ if (message.estimatedTotalBytesScanned != null && message.hasOwnProperty("estimatedTotalBytesScanned")) if (!$util.isInteger(message.estimatedTotalBytesScanned) && !(message.estimatedTotalBytesScanned && $util.isInteger(message.estimatedTotalBytesScanned.low) && $util.isInteger(message.estimatedTotalBytesScanned.high))) return "estimatedTotalBytesScanned: integer|Long expected"; + if (message.traceId != null && message.hasOwnProperty("traceId")) + if (!$util.isString(message.traceId)) + return "traceId: string expected"; return null; }; @@ -7170,6 +7201,8 @@ message.estimatedTotalBytesScanned = object.estimatedTotalBytesScanned; else if (typeof object.estimatedTotalBytesScanned === "object") message.estimatedTotalBytesScanned = new $util.LongBits(object.estimatedTotalBytesScanned.low >>> 0, object.estimatedTotalBytesScanned.high >>> 0).toNumber(); + if (object.traceId != null) + message.traceId = String(object.traceId); return message; }; @@ -7200,6 +7233,7 @@ object.estimatedTotalBytesScanned = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.estimatedTotalBytesScanned = options.longs === String ? "0" : 0; + object.traceId = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -7233,6 +7267,8 @@ object.estimatedTotalBytesScanned = options.longs === String ? String(message.estimatedTotalBytesScanned) : message.estimatedTotalBytesScanned; else object.estimatedTotalBytesScanned = options.longs === String ? $util.Long.prototype.toString.call(message.estimatedTotalBytesScanned) : options.longs === Number ? new $util.LongBits(message.estimatedTotalBytesScanned.low >>> 0, message.estimatedTotalBytesScanned.high >>> 0).toNumber() : message.estimatedTotalBytesScanned; + if (message.traceId != null && message.hasOwnProperty("traceId")) + object.traceId = message.traceId; return object; }; diff --git a/packages/google-cloud-bigquery-storage/protos/protos.json b/packages/google-cloud-bigquery-storage/protos/protos.json index 651ae7e0329..a892cd68782 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.json +++ b/packages/google-cloud-bigquery-storage/protos/protos.json @@ -36,7 +36,10 @@ }, "rowCount": { "type": "int64", - "id": 2 + "id": 2, + "options": { + "deprecated": true + } } } }, @@ -73,7 +76,10 @@ }, "rowCount": { "type": "int64", - "id": 2 + "id": 2, + "options": { + "deprecated": true + } } } }, @@ -97,7 +103,7 @@ "BigQueryRead": { "options": { "(google.api.default_host)": "bigquerystorage.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/bigquery.readonly,https://www.googleapis.com/auth/cloud-platform" + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/cloud-platform" }, "methods": { "CreateReadSession": { @@ -548,7 +554,8 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "bigquery.googleapis.com/Table" } }, "writeStreams": { @@ -643,7 +650,9 @@ "INVALID_STREAM_TYPE": 4, "INVALID_STREAM_STATE": 5, "STREAM_FINALIZED": 6, - "SCHEMA_MISMATCH_EXTRA_FIELDS": 7 + "SCHEMA_MISMATCH_EXTRA_FIELDS": 7, + "OFFSET_ALREADY_EXISTS": 8, + "OFFSET_OUT_OF_RANGE": 9 } } } @@ -740,6 +749,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "traceId": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -1026,7 +1042,7 @@ "BigQueryStorage": { "options": { "(google.api.default_host)": "bigquerystorage.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/bigquery.readonly,https://www.googleapis.com/auth/cloud-platform" + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/cloud-platform" }, "methods": { "CreateReadSession": { diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js index a14c16b7ba0..f4d2f95025e 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.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-storage/samples/generated/v1/big_query_read.read_rows.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.read_rows.js index a51ad69dd47..f5f781a46b8 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.read_rows.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.read_rows.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-storage/samples/generated/v1/big_query_read.split_read_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.split_read_stream.js index 478f78e1e90..6e146955b95 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.split_read_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.split_read_stream.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-storage/samples/generated/v1/big_query_write.append_rows.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.append_rows.js index 51db4c07a0e..9cefbb22166 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.append_rows.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.append_rows.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'; @@ -26,9 +31,9 @@ function main(writeStream) { * If provided for subsequent requests, it must match the value of the first * request. * For explicitly created write streams, the format is: - * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}` * For the special default stream, the format is: - * `projects/{project}/datasets/{dataset}/tables/{table}/_default`. + * * `projects/{project}/datasets/{dataset}/tables/{table}/streams/_default`. */ // const writeStream = 'abc123' /** diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.batch_commit_write_streams.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.batch_commit_write_streams.js index a9f7ea031e7..9c258a30082 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.batch_commit_write_streams.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.batch_commit_write_streams.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-storage/samples/generated/v1/big_query_write.create_write_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.create_write_stream.js index 4537cb615f3..839a8bf6628 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.create_write_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.create_write_stream.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-storage/samples/generated/v1/big_query_write.finalize_write_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.finalize_write_stream.js index bb660301138..3ff3da7adc8 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.finalize_write_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.finalize_write_stream.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-storage/samples/generated/v1/big_query_write.flush_rows.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.flush_rows.js index 94f1f5253a9..751fdebf6e0 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.flush_rows.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.flush_rows.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-storage/samples/generated/v1/big_query_write.get_write_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.get_write_stream.js index 4f2caa2a80c..1650750820f 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.get_write_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.get_write_stream.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-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json b/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json new file mode 100644 index 00000000000..a847f73832d --- /dev/null +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json @@ -0,0 +1,415 @@ +{ + "clientLibrary": { + "name": "nodejs-storage", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.bigquery.storage.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "bigquerystorage_v1_generated_BigQueryRead_CreateReadSession_async", + "title": "BigQueryRead createReadSession Sample", + "origin": "API_DEFINITION", + "description": " Creates a new read session. A read session divides the contents of a BigQuery table into one or more streams, which can then be used to read data from the table. The read session also specifies properties of the data to be read, such as a list of columns or a push-down filter describing the rows to be returned. A particular row can be read by at most one stream. When the caller has reached the end of each stream in the session, then all the data in the table has been read. Data is assigned to each stream such that roughly the same number of rows can be read from each stream. Because the server-side unit for assigning data is collections of rows, the API does not guarantee that each stream will return the same number or rows. Additionally, the limits are enforced based on the number of pre-filtered rows, so some filters can lead to lopsided assignments. Read sessions automatically expire 6 hours after they are created and do not require manual clean-up by the caller.", + "canonical": true, + "file": "big_query_read.create_read_session.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateReadSession", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead.CreateReadSession", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "read_session", + "type": ".google.cloud.bigquery.storage.v1.ReadSession" + }, + { + "name": "max_stream_count", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1.ReadSession", + "client": { + "shortName": "BigQueryReadClient", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryReadClient" + }, + "method": { + "shortName": "CreateReadSession", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead.CreateReadSession", + "service": { + "shortName": "BigQueryRead", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead" + } + } + } + }, + { + "regionTag": "bigquerystorage_v1_generated_BigQueryRead_ReadRows_async", + "title": "BigQueryRead readRows Sample", + "origin": "API_DEFINITION", + "description": " Reads rows from the stream in the format prescribed by the ReadSession. Each response contains one or more table rows, up to a maximum of 100 MiB per response; read requests which attempt to read individual rows larger than 100 MiB will fail. Each request also returns a set of stream statistics reflecting the current state of the stream.", + "canonical": true, + "file": "big_query_read.read_rows.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ReadRows", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead.ReadRows", + "async": true, + "parameters": [ + { + "name": "read_stream", + "type": "TYPE_STRING" + }, + { + "name": "offset", + "type": "TYPE_INT64" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1.ReadRowsResponse", + "client": { + "shortName": "BigQueryReadClient", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryReadClient" + }, + "method": { + "shortName": "ReadRows", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead.ReadRows", + "service": { + "shortName": "BigQueryRead", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead" + } + } + } + }, + { + "regionTag": "bigquerystorage_v1_generated_BigQueryRead_SplitReadStream_async", + "title": "BigQueryRead splitReadStream Sample", + "origin": "API_DEFINITION", + "description": " Splits a given `ReadStream` into two `ReadStream` objects. These `ReadStream` objects are referred to as the primary and the residual streams of the split. The original `ReadStream` can still be read from in the same manner as before. Both of the returned `ReadStream` objects can also be read from, and the rows returned by both child streams will be the same as the rows read from the original stream. Moreover, the two child streams will be allocated back-to-back in the original `ReadStream`. Concretely, it is guaranteed that for streams original, primary, and residual, that original[0-j] = primary[0-j] and original[j-n] = residual[0-m] once the streams have been read to completion.", + "canonical": true, + "file": "big_query_read.split_read_stream.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SplitReadStream", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead.SplitReadStream", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "fraction", + "type": "TYPE_DOUBLE" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1.SplitReadStreamResponse", + "client": { + "shortName": "BigQueryReadClient", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryReadClient" + }, + "method": { + "shortName": "SplitReadStream", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead.SplitReadStream", + "service": { + "shortName": "BigQueryRead", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead" + } + } + } + }, + { + "regionTag": "bigquerystorage_v1_generated_BigQueryWrite_CreateWriteStream_async", + "title": "BigQueryRead createWriteStream Sample", + "origin": "API_DEFINITION", + "description": " Creates a write stream to the given table. Additionally, every table has a special stream named '_default' to which data can be written. This stream doesn't need to be created using CreateWriteStream. It is a stream that can be used simultaneously by any number of clients. Data written to this stream is considered committed as soon as an acknowledgement is received.", + "canonical": true, + "file": "big_query_write.create_write_stream.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateWriteStream", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.CreateWriteStream", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "write_stream", + "type": ".google.cloud.bigquery.storage.v1.WriteStream" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1.WriteStream", + "client": { + "shortName": "BigQueryWriteClient", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWriteClient" + }, + "method": { + "shortName": "CreateWriteStream", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.CreateWriteStream", + "service": { + "shortName": "BigQueryWrite", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite" + } + } + } + }, + { + "regionTag": "bigquerystorage_v1_generated_BigQueryWrite_AppendRows_async", + "title": "BigQueryRead appendRows Sample", + "origin": "API_DEFINITION", + "description": " Appends data to the given stream. If `offset` is specified, the `offset` is checked against the end of stream. The server returns `OUT_OF_RANGE` in `AppendRowsResponse` if an attempt is made to append to an offset beyond the current end of the stream or `ALREADY_EXISTS` if user provides an `offset` that has already been written to. User can retry with adjusted offset within the same RPC connection. If `offset` is not specified, append happens at the end of the stream. The response contains an optional offset at which the append happened. No offset information will be returned for appends to a default stream. Responses are received in the same order in which requests are sent. There will be one response for each successful inserted request. Responses may optionally embed error information if the originating AppendRequest was not successfully processed. The specifics of when successfully appended data is made visible to the table are governed by the type of stream: * For COMMITTED streams (which includes the default stream), data is visible immediately upon successful append. * For BUFFERED streams, data is made visible via a subsequent `FlushRows` rpc which advances a cursor to a newer offset in the stream. * For PENDING streams, data is not made visible until the stream itself is finalized (via the `FinalizeWriteStream` rpc), and the stream is explicitly committed via the `BatchCommitWriteStreams` rpc. Note: For users coding against the gRPC api directly, it may be necessary to supply the x-goog-request-params system parameter with `write_stream=`. More information about system parameters: https://cloud.google.com/apis/docs/system-parameters", + "canonical": true, + "file": "big_query_write.append_rows.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AppendRows", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.AppendRows", + "async": true, + "parameters": [ + { + "name": "write_stream", + "type": "TYPE_STRING" + }, + { + "name": "offset", + "type": ".google.protobuf.Int64Value" + }, + { + "name": "proto_rows", + "type": ".google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData" + }, + { + "name": "trace_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1.AppendRowsResponse", + "client": { + "shortName": "BigQueryWriteClient", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWriteClient" + }, + "method": { + "shortName": "AppendRows", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.AppendRows", + "service": { + "shortName": "BigQueryWrite", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite" + } + } + } + }, + { + "regionTag": "bigquerystorage_v1_generated_BigQueryWrite_GetWriteStream_async", + "title": "BigQueryRead getWriteStream Sample", + "origin": "API_DEFINITION", + "description": " Gets information about a write stream.", + "canonical": true, + "file": "big_query_write.get_write_stream.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetWriteStream", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.GetWriteStream", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1.WriteStream", + "client": { + "shortName": "BigQueryWriteClient", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWriteClient" + }, + "method": { + "shortName": "GetWriteStream", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.GetWriteStream", + "service": { + "shortName": "BigQueryWrite", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite" + } + } + } + }, + { + "regionTag": "bigquerystorage_v1_generated_BigQueryWrite_FinalizeWriteStream_async", + "title": "BigQueryRead finalizeWriteStream Sample", + "origin": "API_DEFINITION", + "description": " Finalize a write stream so that no new data can be appended to the stream. Finalize is not supported on the '_default' stream.", + "canonical": true, + "file": "big_query_write.finalize_write_stream.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FinalizeWriteStream", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.FinalizeWriteStream", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse", + "client": { + "shortName": "BigQueryWriteClient", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWriteClient" + }, + "method": { + "shortName": "FinalizeWriteStream", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.FinalizeWriteStream", + "service": { + "shortName": "BigQueryWrite", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite" + } + } + } + }, + { + "regionTag": "bigquerystorage_v1_generated_BigQueryWrite_BatchCommitWriteStreams_async", + "title": "BigQueryRead batchCommitWriteStreams Sample", + "origin": "API_DEFINITION", + "description": " Atomically commits a group of `PENDING` streams that belong to the same `parent` table. Streams must be finalized before commit and cannot be committed multiple times. Once a stream is committed, data in the stream becomes available for read operations.", + "canonical": true, + "file": "big_query_write.batch_commit_write_streams.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchCommitWriteStreams", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.BatchCommitWriteStreams", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "write_streams", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse", + "client": { + "shortName": "BigQueryWriteClient", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWriteClient" + }, + "method": { + "shortName": "BatchCommitWriteStreams", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.BatchCommitWriteStreams", + "service": { + "shortName": "BigQueryWrite", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite" + } + } + } + }, + { + "regionTag": "bigquerystorage_v1_generated_BigQueryWrite_FlushRows_async", + "title": "BigQueryRead flushRows Sample", + "origin": "API_DEFINITION", + "description": " Flushes rows to a BUFFERED stream. If users are appending rows to BUFFERED stream, flush operation is required in order for the rows to become available for reading. A Flush operation flushes up to any previously flushed offset in a BUFFERED stream, to the offset specified in the request. Flush is not supported on the _default stream, since it is not BUFFERED.", + "canonical": true, + "file": "big_query_write.flush_rows.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FlushRows", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.FlushRows", + "async": true, + "parameters": [ + { + "name": "write_stream", + "type": "TYPE_STRING" + }, + { + "name": "offset", + "type": ".google.protobuf.Int64Value" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1.FlushRowsResponse", + "client": { + "shortName": "BigQueryWriteClient", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWriteClient" + }, + "method": { + "shortName": "FlushRows", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.FlushRows", + "service": { + "shortName": "BigQueryWrite", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite" + } + } + } + } + ] +} diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.batch_create_read_session_streams.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.batch_create_read_session_streams.js index ed64422d3a1..3d7b6d3e429 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.batch_create_read_session_streams.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.batch_create_read_session_streams.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-storage/samples/generated/v1beta1/big_query_storage.create_read_session.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.create_read_session.js index 9cf38ca4274..c71a464ce5d 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.create_read_session.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.create_read_session.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-storage/samples/generated/v1beta1/big_query_storage.finalize_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.finalize_stream.js index 33ca0da184a..51d63d0bb69 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.finalize_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.finalize_stream.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-storage/samples/generated/v1beta1/big_query_storage.read_rows.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.read_rows.js index 5436f8f83fb..65924b1746b 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.read_rows.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.read_rows.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-storage/samples/generated/v1beta1/big_query_storage.split_read_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.split_read_stream.js index a517cdf5562..24ae597d43a 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.split_read_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.split_read_stream.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-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json new file mode 100644 index 00000000000..a36b0694cf8 --- /dev/null +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json @@ -0,0 +1,247 @@ +{ + "clientLibrary": { + "name": "nodejs-storage", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.bigquery.storage.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "bigquerystorage_v1beta1_generated_BigQueryStorage_CreateReadSession_async", + "title": "BigQueryStorage createReadSession Sample", + "origin": "API_DEFINITION", + "description": " Creates a new read session. A read session divides the contents of a BigQuery table into one or more streams, which can then be used to read data from the table. The read session also specifies properties of the data to be read, such as a list of columns or a push-down filter describing the rows to be returned. A particular row can be read by at most one stream. When the caller has reached the end of each stream in the session, then all the data in the table has been read. Read sessions automatically expire 24 hours after they are created and do not require manual clean-up by the caller.", + "canonical": true, + "file": "big_query_storage.create_read_session.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateReadSession", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.CreateReadSession", + "async": true, + "parameters": [ + { + "name": "table_reference", + "type": ".google.cloud.bigquery.storage.v1beta1.TableReference" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "table_modifiers", + "type": ".google.cloud.bigquery.storage.v1beta1.TableModifiers" + }, + { + "name": "requested_streams", + "type": "TYPE_INT32" + }, + { + "name": "read_options", + "type": ".google.cloud.bigquery.storage.v1beta1.TableReadOptions" + }, + { + "name": "format", + "type": ".google.cloud.bigquery.storage.v1beta1.DataFormat" + }, + { + "name": "sharding_strategy", + "type": ".google.cloud.bigquery.storage.v1beta1.ShardingStrategy" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1beta1.ReadSession", + "client": { + "shortName": "BigQueryStorageClient", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorageClient" + }, + "method": { + "shortName": "CreateReadSession", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.CreateReadSession", + "service": { + "shortName": "BigQueryStorage", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage" + } + } + } + }, + { + "regionTag": "bigquerystorage_v1beta1_generated_BigQueryStorage_ReadRows_async", + "title": "BigQueryStorage readRows Sample", + "origin": "API_DEFINITION", + "description": " Reads rows from the table in the format prescribed by the read session. Each response contains one or more table rows, up to a maximum of 10 MiB per response; read requests which attempt to read individual rows larger than this will fail. Each request also returns a set of stream statistics reflecting the estimated total number of rows in the read stream. This number is computed based on the total table size and the number of active streams in the read session, and may change as other streams continue to read data.", + "canonical": true, + "file": "big_query_storage.read_rows.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ReadRows", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.ReadRows", + "async": true, + "parameters": [ + { + "name": "read_position", + "type": ".google.cloud.bigquery.storage.v1beta1.StreamPosition" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1beta1.ReadRowsResponse", + "client": { + "shortName": "BigQueryStorageClient", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorageClient" + }, + "method": { + "shortName": "ReadRows", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.ReadRows", + "service": { + "shortName": "BigQueryStorage", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage" + } + } + } + }, + { + "regionTag": "bigquerystorage_v1beta1_generated_BigQueryStorage_BatchCreateReadSessionStreams_async", + "title": "BigQueryStorage batchCreateReadSessionStreams Sample", + "origin": "API_DEFINITION", + "description": " Creates additional streams for a ReadSession. This API can be used to dynamically adjust the parallelism of a batch processing task upwards by adding additional workers.", + "canonical": true, + "file": "big_query_storage.batch_create_read_session_streams.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchCreateReadSessionStreams", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.BatchCreateReadSessionStreams", + "async": true, + "parameters": [ + { + "name": "session", + "type": ".google.cloud.bigquery.storage.v1beta1.ReadSession" + }, + { + "name": "requested_streams", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse", + "client": { + "shortName": "BigQueryStorageClient", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorageClient" + }, + "method": { + "shortName": "BatchCreateReadSessionStreams", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.BatchCreateReadSessionStreams", + "service": { + "shortName": "BigQueryStorage", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage" + } + } + } + }, + { + "regionTag": "bigquerystorage_v1beta1_generated_BigQueryStorage_FinalizeStream_async", + "title": "BigQueryStorage finalizeStream Sample", + "origin": "API_DEFINITION", + "description": " Triggers the graceful termination of a single stream in a ReadSession. This API can be used to dynamically adjust the parallelism of a batch processing task downwards without losing data. This API does not delete the stream -- it remains visible in the ReadSession, and any data processed by the stream is not released to other streams. However, no additional data will be assigned to the stream once this call completes. Callers must continue reading data on the stream until the end of the stream is reached so that data which has already been assigned to the stream will be processed. This method will return an error if there are no other live streams in the Session, or if SplitReadStream() has been called on the given Stream.", + "canonical": true, + "file": "big_query_storage.finalize_stream.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FinalizeStream", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.FinalizeStream", + "async": true, + "parameters": [ + { + "name": "stream", + "type": ".google.cloud.bigquery.storage.v1beta1.Stream" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "BigQueryStorageClient", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorageClient" + }, + "method": { + "shortName": "FinalizeStream", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.FinalizeStream", + "service": { + "shortName": "BigQueryStorage", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage" + } + } + } + }, + { + "regionTag": "bigquerystorage_v1beta1_generated_BigQueryStorage_SplitReadStream_async", + "title": "BigQueryStorage splitReadStream Sample", + "origin": "API_DEFINITION", + "description": " Splits a given read stream into two Streams. These streams are referred to as the primary and the residual of the split. The original stream can still be read from in the same manner as before. Both of the returned streams can also be read from, and the total rows return by both child streams will be the same as the rows read from the original stream. Moreover, the two child streams will be allocated back to back in the original Stream. Concretely, it is guaranteed that for streams Original, Primary, and Residual, that Original[0-j] = Primary[0-j] and Original[j-n] = Residual[0-m] once the streams have been read to completion. This method is guaranteed to be idempotent.", + "canonical": true, + "file": "big_query_storage.split_read_stream.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SplitReadStream", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.SplitReadStream", + "async": true, + "parameters": [ + { + "name": "original_stream", + "type": ".google.cloud.bigquery.storage.v1beta1.Stream" + }, + { + "name": "fraction", + "type": "TYPE_FLOAT" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse", + "client": { + "shortName": "BigQueryStorageClient", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorageClient" + }, + "method": { + "shortName": "SplitReadStream", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.SplitReadStream", + "service": { + "shortName": "BigQueryStorage", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage" + } + } + } + } + ] +} diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index f133143b2fe..a0246aef5d2 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -18,8 +18,15 @@ /* global window */ import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; - +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GoogleError, +} from 'google-gax'; + +import {PassThrough} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -241,6 +248,16 @@ export class BigQueryReadClient { stub => (...args: Array<{}>) => { if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough(); + setImmediate(() => { + stream.emit( + 'error', + new GoogleError('The client has already been closed.') + ); + }); + return stream; + } return Promise.reject('The client has already been closed.'); } const func = stub[methodName]; @@ -297,7 +314,6 @@ export class BigQueryReadClient { static get scopes() { return [ 'https://www.googleapis.com/auth/bigquery', - 'https://www.googleapis.com/auth/bigquery.readonly', 'https://www.googleapis.com/auth/cloud-platform', ]; } @@ -885,9 +901,8 @@ export class BigQueryReadClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.bigQueryReadStub!.then(stub => { + if (this.bigQueryReadStub && !this._terminated) { + return this.bigQueryReadStub.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts index b775bf6fe29..1cb67db7dac 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts @@ -18,8 +18,15 @@ /* global window */ import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GoogleError, +} from 'google-gax'; +import {PassThrough} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -247,6 +254,16 @@ export class BigQueryWriteClient { stub => (...args: Array<{}>) => { if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough(); + setImmediate(() => { + stream.emit( + 'error', + new GoogleError('The client has already been closed.') + ); + }); + return stream; + } return Promise.reject('The client has already been closed.'); } const func = stub[methodName]; @@ -873,6 +890,13 @@ export class BigQueryWriteClient { * finalized (via the `FinalizeWriteStream` rpc), and the stream is explicitly * committed via the `BatchCommitWriteStreams` rpc. * + * Note: For users coding against the gRPC api directly, it may be + * necessary to supply the x-goog-request-params system parameter + * with `write_stream=`. + * + * More information about system parameters: + * https://cloud.google.com/apis/docs/system-parameters + * * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -887,7 +911,7 @@ export class BigQueryWriteClient { */ appendRows(options?: CallOptions): gax.CancellableStream { this.initialize(); - return this.innerApiCalls.appendRows(options); + return this.innerApiCalls.appendRows(null, options); } // -------------------- @@ -1167,9 +1191,8 @@ export class BigQueryWriteClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.bigQueryWriteStub!.then(stub => { + if (this.bigQueryWriteStub && !this._terminated) { + return this.bigQueryWriteStub.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index 72b13b1ef43..342ef1a6e9c 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -18,8 +18,15 @@ /* global window */ import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; - +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GoogleError, +} from 'google-gax'; + +import {PassThrough} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -238,6 +245,16 @@ export class BigQueryStorageClient { stub => (...args: Array<{}>) => { if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough(); + setImmediate(() => { + stream.emit( + 'error', + new GoogleError('The client has already been closed.') + ); + }); + return stream; + } return Promise.reject('The client has already been closed.'); } const func = stub[methodName]; @@ -294,7 +311,6 @@ export class BigQueryStorageClient { static get scopes() { return [ 'https://www.googleapis.com/auth/bigquery', - 'https://www.googleapis.com/auth/bigquery.readonly', 'https://www.googleapis.com/auth/cloud-platform', ]; } @@ -962,9 +978,8 @@ export class BigQueryStorageClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.bigQueryStorageStub!.then(stub => { + if (this.bigQueryStorageStub && !this._terminated) { + return this.bigQueryStorageStub.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts index a5c551d3198..793ecd88c3e 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts @@ -111,12 +111,27 @@ describe('v1.BigQueryReadClient', () => { assert(client.bigQueryReadStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new bigqueryreadModule.v1.BigQueryReadClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.bigQueryReadStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.bigQueryReadStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -265,6 +280,22 @@ describe('v1.BigQueryReadClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createReadSession with closed client', async () => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.CreateReadSessionRequest() + ); + request.readSession = {}; + request.readSession.table = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createReadSession(request), expectedError); + }); }); describe('splitReadStream', () => { @@ -376,6 +407,21 @@ describe('v1.BigQueryReadClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes splitReadStream with closed client', async () => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.SplitReadStreamRequest() + ); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.splitReadStream(request), expectedError); + }); }); describe('readRows', () => { @@ -468,6 +514,35 @@ describe('v1.BigQueryReadClient', () => { .calledWith(request, expectedOptions) ); }); + + it('invokes readRows with closed client', async () => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.ReadRowsRequest() + ); + request.readStream = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + const stream = client.readRows(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.storage.v1.ReadRowsResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + }); }); describe('Path templates', () => { diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts index 3365f629aee..005e54894e1 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts @@ -113,12 +113,27 @@ describe('v1beta1.BigQueryStorageClient', () => { assert(client.bigQueryStorageStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.bigQueryStorageStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.bigQueryStorageStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -276,6 +291,24 @@ describe('v1beta1.BigQueryStorageClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createReadSession with closed client', async () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest() + ); + request.tableReference = {}; + request.tableReference.projectId = ''; + request.tableReference = {}; + request.tableReference.datasetId = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createReadSession(request), expectedError); + }); }); describe('batchCreateReadSessionStreams', () => { @@ -394,6 +427,25 @@ describe('v1beta1.BigQueryStorageClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes batchCreateReadSessionStreams with closed client', async () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest() + ); + request.session = {}; + request.session.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.batchCreateReadSessionStreams(request), + expectedError + ); + }); }); describe('finalizeStream', () => { @@ -508,6 +560,22 @@ describe('v1beta1.BigQueryStorageClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes finalizeStream with closed client', async () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest() + ); + request.stream = {}; + request.stream.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.finalizeStream(request), expectedError); + }); }); describe('splitReadStream', () => { @@ -622,6 +690,22 @@ describe('v1beta1.BigQueryStorageClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes splitReadStream with closed client', async () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest() + ); + request.originalStream = {}; + request.originalStream.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.splitReadStream(request), expectedError); + }); }); describe('readRows', () => { @@ -718,6 +802,37 @@ describe('v1beta1.BigQueryStorageClient', () => { .calledWith(request, expectedOptions) ); }); + + it('invokes readRows with closed client', async () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest() + ); + request.readPosition = {}; + request.readPosition.stream = {}; + request.readPosition.stream.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + const stream = client.readRows(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + }); }); describe('Path templates', () => { diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_write_v1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_write_v1.ts index 608b649713f..44fdb98de72 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_write_v1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_write_v1.ts @@ -104,12 +104,27 @@ describe('v1.BigQueryWriteClient', () => { assert(client.bigQueryWriteStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new bigquerywriteModule.v1.BigQueryWriteClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.bigQueryWriteStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.bigQueryWriteStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -255,6 +270,21 @@ describe('v1.BigQueryWriteClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes createWriteStream with closed client', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.CreateWriteStreamRequest() + ); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createWriteStream(request), expectedError); + }); }); describe('getWriteStream', () => { @@ -366,6 +396,21 @@ describe('v1.BigQueryWriteClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getWriteStream with closed client', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.GetWriteStreamRequest() + ); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getWriteStream(request), expectedError); + }); }); describe('finalizeWriteStream', () => { @@ -478,6 +523,21 @@ describe('v1.BigQueryWriteClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes finalizeWriteStream with closed client', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest() + ); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.finalizeWriteStream(request), expectedError); + }); }); describe('batchCommitWriteStreams', () => { @@ -593,6 +653,24 @@ describe('v1.BigQueryWriteClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes batchCommitWriteStreams with closed client', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest() + ); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.batchCommitWriteStreams(request), + expectedError + ); + }); }); describe('flushRows', () => { @@ -701,6 +779,21 @@ describe('v1.BigQueryWriteClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes flushRows with closed client', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.bigquery.storage.v1.FlushRowsRequest() + ); + request.writeStream = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.flushRows(request), expectedError); + }); }); describe('appendRows', () => { @@ -738,7 +831,7 @@ describe('v1.BigQueryWriteClient', () => { assert( (client.innerApiCalls.appendRows as SinonStub) .getCall(0) - .calledWithExactly(undefined) + .calledWith(null) ); assert.deepStrictEqual( ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) @@ -756,8 +849,6 @@ describe('v1.BigQueryWriteClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.AppendRowsRequest() ); - request.writeStream = ''; - const expectedHeaderRequestParams = 'write_stream='; const expectedError = new Error('expected'); client.innerApiCalls.appendRows = stubBidiStreamingCall( undefined, @@ -783,7 +874,7 @@ describe('v1.BigQueryWriteClient', () => { assert( (client.innerApiCalls.appendRows as SinonStub) .getCall(0) - .calledWithExactly(undefined) + .calledWith(null) ); assert.deepStrictEqual( ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) From 7aeef6118c9955f2024461621237dc3ceeb61fb3 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:34:21 +0000 Subject: [PATCH 156/182] build(node): update client library version in samples metadata (#1356) (#262) * 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 --- ...data.google.cloud.bigquery.storage.v1.json | 792 +++++++++--------- ...google.cloud.bigquery.storage.v1beta1.json | 472 +++++------ 2 files changed, 632 insertions(+), 632 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json b/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json index a847f73832d..93aaa2255ba 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json @@ -1,415 +1,415 @@ { - "clientLibrary": { - "name": "nodejs-storage", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.bigquery.storage.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "bigquerystorage_v1_generated_BigQueryRead_CreateReadSession_async", - "title": "BigQueryRead createReadSession Sample", - "origin": "API_DEFINITION", - "description": " Creates a new read session. A read session divides the contents of a BigQuery table into one or more streams, which can then be used to read data from the table. The read session also specifies properties of the data to be read, such as a list of columns or a push-down filter describing the rows to be returned. A particular row can be read by at most one stream. When the caller has reached the end of each stream in the session, then all the data in the table has been read. Data is assigned to each stream such that roughly the same number of rows can be read from each stream. Because the server-side unit for assigning data is collections of rows, the API does not guarantee that each stream will return the same number or rows. Additionally, the limits are enforced based on the number of pre-filtered rows, so some filters can lead to lopsided assignments. Read sessions automatically expire 6 hours after they are created and do not require manual clean-up by the caller.", - "canonical": true, - "file": "big_query_read.create_read_session.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateReadSession", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead.CreateReadSession", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "read_session", - "type": ".google.cloud.bigquery.storage.v1.ReadSession" - }, - { - "name": "max_stream_count", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.bigquery.storage.v1.ReadSession", - "client": { - "shortName": "BigQueryReadClient", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryReadClient" - }, - "method": { - "shortName": "CreateReadSession", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead.CreateReadSession", - "service": { - "shortName": "BigQueryRead", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead" - } - } - } + "clientLibrary": { + "name": "nodejs-storage", + "version": "2.8.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.bigquery.storage.v1", + "version": "v1" + } + ] }, - { - "regionTag": "bigquerystorage_v1_generated_BigQueryRead_ReadRows_async", - "title": "BigQueryRead readRows Sample", - "origin": "API_DEFINITION", - "description": " Reads rows from the stream in the format prescribed by the ReadSession. Each response contains one or more table rows, up to a maximum of 100 MiB per response; read requests which attempt to read individual rows larger than 100 MiB will fail. Each request also returns a set of stream statistics reflecting the current state of the stream.", - "canonical": true, - "file": "big_query_read.read_rows.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ReadRows", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead.ReadRows", - "async": true, - "parameters": [ - { - "name": "read_stream", - "type": "TYPE_STRING" - }, - { - "name": "offset", - "type": "TYPE_INT64" - } - ], - "resultType": ".google.cloud.bigquery.storage.v1.ReadRowsResponse", - "client": { - "shortName": "BigQueryReadClient", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryReadClient" + "regionTag": "bigquerystorage_v1_generated_BigQueryRead_CreateReadSession_async", + "title": "BigQueryRead createReadSession Sample", + "origin": "API_DEFINITION", + "description": " Creates a new read session. A read session divides the contents of a BigQuery table into one or more streams, which can then be used to read data from the table. The read session also specifies properties of the data to be read, such as a list of columns or a push-down filter describing the rows to be returned. A particular row can be read by at most one stream. When the caller has reached the end of each stream in the session, then all the data in the table has been read. Data is assigned to each stream such that roughly the same number of rows can be read from each stream. Because the server-side unit for assigning data is collections of rows, the API does not guarantee that each stream will return the same number or rows. Additionally, the limits are enforced based on the number of pre-filtered rows, so some filters can lead to lopsided assignments. Read sessions automatically expire 6 hours after they are created and do not require manual clean-up by the caller.", + "canonical": true, + "file": "big_query_read.create_read_session.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateReadSession", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead.CreateReadSession", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "read_session", + "type": ".google.cloud.bigquery.storage.v1.ReadSession" + }, + { + "name": "max_stream_count", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1.ReadSession", + "client": { + "shortName": "BigQueryReadClient", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryReadClient" + }, + "method": { + "shortName": "CreateReadSession", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead.CreateReadSession", + "service": { + "shortName": "BigQueryRead", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead" + } + } + } }, - "method": { - "shortName": "ReadRows", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead.ReadRows", - "service": { - "shortName": "BigQueryRead", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead" - } - } - } - }, - { - "regionTag": "bigquerystorage_v1_generated_BigQueryRead_SplitReadStream_async", - "title": "BigQueryRead splitReadStream Sample", - "origin": "API_DEFINITION", - "description": " Splits a given `ReadStream` into two `ReadStream` objects. These `ReadStream` objects are referred to as the primary and the residual streams of the split. The original `ReadStream` can still be read from in the same manner as before. Both of the returned `ReadStream` objects can also be read from, and the rows returned by both child streams will be the same as the rows read from the original stream. Moreover, the two child streams will be allocated back-to-back in the original `ReadStream`. Concretely, it is guaranteed that for streams original, primary, and residual, that original[0-j] = primary[0-j] and original[j-n] = residual[0-m] once the streams have been read to completion.", - "canonical": true, - "file": "big_query_read.split_read_stream.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SplitReadStream", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead.SplitReadStream", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "fraction", - "type": "TYPE_DOUBLE" - } - ], - "resultType": ".google.cloud.bigquery.storage.v1.SplitReadStreamResponse", - "client": { - "shortName": "BigQueryReadClient", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryReadClient" + "regionTag": "bigquerystorage_v1_generated_BigQueryRead_ReadRows_async", + "title": "BigQueryRead readRows Sample", + "origin": "API_DEFINITION", + "description": " Reads rows from the stream in the format prescribed by the ReadSession. Each response contains one or more table rows, up to a maximum of 100 MiB per response; read requests which attempt to read individual rows larger than 100 MiB will fail. Each request also returns a set of stream statistics reflecting the current state of the stream.", + "canonical": true, + "file": "big_query_read.read_rows.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ReadRows", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead.ReadRows", + "async": true, + "parameters": [ + { + "name": "read_stream", + "type": "TYPE_STRING" + }, + { + "name": "offset", + "type": "TYPE_INT64" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1.ReadRowsResponse", + "client": { + "shortName": "BigQueryReadClient", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryReadClient" + }, + "method": { + "shortName": "ReadRows", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead.ReadRows", + "service": { + "shortName": "BigQueryRead", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead" + } + } + } }, - "method": { - "shortName": "SplitReadStream", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead.SplitReadStream", - "service": { - "shortName": "BigQueryRead", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead" - } - } - } - }, - { - "regionTag": "bigquerystorage_v1_generated_BigQueryWrite_CreateWriteStream_async", - "title": "BigQueryRead createWriteStream Sample", - "origin": "API_DEFINITION", - "description": " Creates a write stream to the given table. Additionally, every table has a special stream named '_default' to which data can be written. This stream doesn't need to be created using CreateWriteStream. It is a stream that can be used simultaneously by any number of clients. Data written to this stream is considered committed as soon as an acknowledgement is received.", - "canonical": true, - "file": "big_query_write.create_write_stream.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateWriteStream", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.CreateWriteStream", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "write_stream", - "type": ".google.cloud.bigquery.storage.v1.WriteStream" - } - ], - "resultType": ".google.cloud.bigquery.storage.v1.WriteStream", - "client": { - "shortName": "BigQueryWriteClient", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWriteClient" + "regionTag": "bigquerystorage_v1_generated_BigQueryRead_SplitReadStream_async", + "title": "BigQueryRead splitReadStream Sample", + "origin": "API_DEFINITION", + "description": " Splits a given `ReadStream` into two `ReadStream` objects. These `ReadStream` objects are referred to as the primary and the residual streams of the split. The original `ReadStream` can still be read from in the same manner as before. Both of the returned `ReadStream` objects can also be read from, and the rows returned by both child streams will be the same as the rows read from the original stream. Moreover, the two child streams will be allocated back-to-back in the original `ReadStream`. Concretely, it is guaranteed that for streams original, primary, and residual, that original[0-j] = primary[0-j] and original[j-n] = residual[0-m] once the streams have been read to completion.", + "canonical": true, + "file": "big_query_read.split_read_stream.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SplitReadStream", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead.SplitReadStream", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "fraction", + "type": "TYPE_DOUBLE" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1.SplitReadStreamResponse", + "client": { + "shortName": "BigQueryReadClient", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryReadClient" + }, + "method": { + "shortName": "SplitReadStream", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead.SplitReadStream", + "service": { + "shortName": "BigQueryRead", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryRead" + } + } + } }, - "method": { - "shortName": "CreateWriteStream", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.CreateWriteStream", - "service": { - "shortName": "BigQueryWrite", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite" - } - } - } - }, - { - "regionTag": "bigquerystorage_v1_generated_BigQueryWrite_AppendRows_async", - "title": "BigQueryRead appendRows Sample", - "origin": "API_DEFINITION", - "description": " Appends data to the given stream. If `offset` is specified, the `offset` is checked against the end of stream. The server returns `OUT_OF_RANGE` in `AppendRowsResponse` if an attempt is made to append to an offset beyond the current end of the stream or `ALREADY_EXISTS` if user provides an `offset` that has already been written to. User can retry with adjusted offset within the same RPC connection. If `offset` is not specified, append happens at the end of the stream. The response contains an optional offset at which the append happened. No offset information will be returned for appends to a default stream. Responses are received in the same order in which requests are sent. There will be one response for each successful inserted request. Responses may optionally embed error information if the originating AppendRequest was not successfully processed. The specifics of when successfully appended data is made visible to the table are governed by the type of stream: * For COMMITTED streams (which includes the default stream), data is visible immediately upon successful append. * For BUFFERED streams, data is made visible via a subsequent `FlushRows` rpc which advances a cursor to a newer offset in the stream. * For PENDING streams, data is not made visible until the stream itself is finalized (via the `FinalizeWriteStream` rpc), and the stream is explicitly committed via the `BatchCommitWriteStreams` rpc. Note: For users coding against the gRPC api directly, it may be necessary to supply the x-goog-request-params system parameter with `write_stream=`. More information about system parameters: https://cloud.google.com/apis/docs/system-parameters", - "canonical": true, - "file": "big_query_write.append_rows.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "AppendRows", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.AppendRows", - "async": true, - "parameters": [ - { - "name": "write_stream", - "type": "TYPE_STRING" - }, - { - "name": "offset", - "type": ".google.protobuf.Int64Value" - }, - { - "name": "proto_rows", - "type": ".google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData" - }, - { - "name": "trace_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.bigquery.storage.v1.AppendRowsResponse", - "client": { - "shortName": "BigQueryWriteClient", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWriteClient" + "regionTag": "bigquerystorage_v1_generated_BigQueryWrite_CreateWriteStream_async", + "title": "BigQueryRead createWriteStream Sample", + "origin": "API_DEFINITION", + "description": " Creates a write stream to the given table. Additionally, every table has a special stream named '_default' to which data can be written. This stream doesn't need to be created using CreateWriteStream. It is a stream that can be used simultaneously by any number of clients. Data written to this stream is considered committed as soon as an acknowledgement is received.", + "canonical": true, + "file": "big_query_write.create_write_stream.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateWriteStream", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.CreateWriteStream", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "write_stream", + "type": ".google.cloud.bigquery.storage.v1.WriteStream" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1.WriteStream", + "client": { + "shortName": "BigQueryWriteClient", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWriteClient" + }, + "method": { + "shortName": "CreateWriteStream", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.CreateWriteStream", + "service": { + "shortName": "BigQueryWrite", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite" + } + } + } }, - "method": { - "shortName": "AppendRows", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.AppendRows", - "service": { - "shortName": "BigQueryWrite", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite" - } - } - } - }, - { - "regionTag": "bigquerystorage_v1_generated_BigQueryWrite_GetWriteStream_async", - "title": "BigQueryRead getWriteStream Sample", - "origin": "API_DEFINITION", - "description": " Gets information about a write stream.", - "canonical": true, - "file": "big_query_write.get_write_stream.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetWriteStream", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.GetWriteStream", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.bigquery.storage.v1.WriteStream", - "client": { - "shortName": "BigQueryWriteClient", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWriteClient" + "regionTag": "bigquerystorage_v1_generated_BigQueryWrite_AppendRows_async", + "title": "BigQueryRead appendRows Sample", + "origin": "API_DEFINITION", + "description": " Appends data to the given stream. If `offset` is specified, the `offset` is checked against the end of stream. The server returns `OUT_OF_RANGE` in `AppendRowsResponse` if an attempt is made to append to an offset beyond the current end of the stream or `ALREADY_EXISTS` if user provides an `offset` that has already been written to. User can retry with adjusted offset within the same RPC connection. If `offset` is not specified, append happens at the end of the stream. The response contains an optional offset at which the append happened. No offset information will be returned for appends to a default stream. Responses are received in the same order in which requests are sent. There will be one response for each successful inserted request. Responses may optionally embed error information if the originating AppendRequest was not successfully processed. The specifics of when successfully appended data is made visible to the table are governed by the type of stream: * For COMMITTED streams (which includes the default stream), data is visible immediately upon successful append. * For BUFFERED streams, data is made visible via a subsequent `FlushRows` rpc which advances a cursor to a newer offset in the stream. * For PENDING streams, data is not made visible until the stream itself is finalized (via the `FinalizeWriteStream` rpc), and the stream is explicitly committed via the `BatchCommitWriteStreams` rpc. Note: For users coding against the gRPC api directly, it may be necessary to supply the x-goog-request-params system parameter with `write_stream=`. More information about system parameters: https://cloud.google.com/apis/docs/system-parameters", + "canonical": true, + "file": "big_query_write.append_rows.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AppendRows", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.AppendRows", + "async": true, + "parameters": [ + { + "name": "write_stream", + "type": "TYPE_STRING" + }, + { + "name": "offset", + "type": ".google.protobuf.Int64Value" + }, + { + "name": "proto_rows", + "type": ".google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData" + }, + { + "name": "trace_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1.AppendRowsResponse", + "client": { + "shortName": "BigQueryWriteClient", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWriteClient" + }, + "method": { + "shortName": "AppendRows", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.AppendRows", + "service": { + "shortName": "BigQueryWrite", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite" + } + } + } }, - "method": { - "shortName": "GetWriteStream", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.GetWriteStream", - "service": { - "shortName": "BigQueryWrite", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite" - } - } - } - }, - { - "regionTag": "bigquerystorage_v1_generated_BigQueryWrite_FinalizeWriteStream_async", - "title": "BigQueryRead finalizeWriteStream Sample", - "origin": "API_DEFINITION", - "description": " Finalize a write stream so that no new data can be appended to the stream. Finalize is not supported on the '_default' stream.", - "canonical": true, - "file": "big_query_write.finalize_write_stream.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FinalizeWriteStream", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.FinalizeWriteStream", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse", - "client": { - "shortName": "BigQueryWriteClient", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWriteClient" + "regionTag": "bigquerystorage_v1_generated_BigQueryWrite_GetWriteStream_async", + "title": "BigQueryRead getWriteStream Sample", + "origin": "API_DEFINITION", + "description": " Gets information about a write stream.", + "canonical": true, + "file": "big_query_write.get_write_stream.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetWriteStream", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.GetWriteStream", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1.WriteStream", + "client": { + "shortName": "BigQueryWriteClient", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWriteClient" + }, + "method": { + "shortName": "GetWriteStream", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.GetWriteStream", + "service": { + "shortName": "BigQueryWrite", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite" + } + } + } }, - "method": { - "shortName": "FinalizeWriteStream", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.FinalizeWriteStream", - "service": { - "shortName": "BigQueryWrite", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite" - } - } - } - }, - { - "regionTag": "bigquerystorage_v1_generated_BigQueryWrite_BatchCommitWriteStreams_async", - "title": "BigQueryRead batchCommitWriteStreams Sample", - "origin": "API_DEFINITION", - "description": " Atomically commits a group of `PENDING` streams that belong to the same `parent` table. Streams must be finalized before commit and cannot be committed multiple times. Once a stream is committed, data in the stream becomes available for read operations.", - "canonical": true, - "file": "big_query_write.batch_commit_write_streams.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchCommitWriteStreams", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.BatchCommitWriteStreams", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "write_streams", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse", - "client": { - "shortName": "BigQueryWriteClient", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWriteClient" + "regionTag": "bigquerystorage_v1_generated_BigQueryWrite_FinalizeWriteStream_async", + "title": "BigQueryRead finalizeWriteStream Sample", + "origin": "API_DEFINITION", + "description": " Finalize a write stream so that no new data can be appended to the stream. Finalize is not supported on the '_default' stream.", + "canonical": true, + "file": "big_query_write.finalize_write_stream.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FinalizeWriteStream", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.FinalizeWriteStream", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse", + "client": { + "shortName": "BigQueryWriteClient", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWriteClient" + }, + "method": { + "shortName": "FinalizeWriteStream", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.FinalizeWriteStream", + "service": { + "shortName": "BigQueryWrite", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite" + } + } + } }, - "method": { - "shortName": "BatchCommitWriteStreams", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.BatchCommitWriteStreams", - "service": { - "shortName": "BigQueryWrite", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite" - } - } - } - }, - { - "regionTag": "bigquerystorage_v1_generated_BigQueryWrite_FlushRows_async", - "title": "BigQueryRead flushRows Sample", - "origin": "API_DEFINITION", - "description": " Flushes rows to a BUFFERED stream. If users are appending rows to BUFFERED stream, flush operation is required in order for the rows to become available for reading. A Flush operation flushes up to any previously flushed offset in a BUFFERED stream, to the offset specified in the request. Flush is not supported on the _default stream, since it is not BUFFERED.", - "canonical": true, - "file": "big_query_write.flush_rows.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FlushRows", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.FlushRows", - "async": true, - "parameters": [ - { - "name": "write_stream", - "type": "TYPE_STRING" - }, - { - "name": "offset", - "type": ".google.protobuf.Int64Value" - } - ], - "resultType": ".google.cloud.bigquery.storage.v1.FlushRowsResponse", - "client": { - "shortName": "BigQueryWriteClient", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWriteClient" + "regionTag": "bigquerystorage_v1_generated_BigQueryWrite_BatchCommitWriteStreams_async", + "title": "BigQueryRead batchCommitWriteStreams Sample", + "origin": "API_DEFINITION", + "description": " Atomically commits a group of `PENDING` streams that belong to the same `parent` table. Streams must be finalized before commit and cannot be committed multiple times. Once a stream is committed, data in the stream becomes available for read operations.", + "canonical": true, + "file": "big_query_write.batch_commit_write_streams.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchCommitWriteStreams", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.BatchCommitWriteStreams", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "write_streams", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse", + "client": { + "shortName": "BigQueryWriteClient", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWriteClient" + }, + "method": { + "shortName": "BatchCommitWriteStreams", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.BatchCommitWriteStreams", + "service": { + "shortName": "BigQueryWrite", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite" + } + } + } }, - "method": { - "shortName": "FlushRows", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.FlushRows", - "service": { - "shortName": "BigQueryWrite", - "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite" - } + { + "regionTag": "bigquerystorage_v1_generated_BigQueryWrite_FlushRows_async", + "title": "BigQueryRead flushRows Sample", + "origin": "API_DEFINITION", + "description": " Flushes rows to a BUFFERED stream. If users are appending rows to BUFFERED stream, flush operation is required in order for the rows to become available for reading. A Flush operation flushes up to any previously flushed offset in a BUFFERED stream, to the offset specified in the request. Flush is not supported on the _default stream, since it is not BUFFERED.", + "canonical": true, + "file": "big_query_write.flush_rows.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FlushRows", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.FlushRows", + "async": true, + "parameters": [ + { + "name": "write_stream", + "type": "TYPE_STRING" + }, + { + "name": "offset", + "type": ".google.protobuf.Int64Value" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1.FlushRowsResponse", + "client": { + "shortName": "BigQueryWriteClient", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWriteClient" + }, + "method": { + "shortName": "FlushRows", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite.FlushRows", + "service": { + "shortName": "BigQueryWrite", + "fullName": "google.cloud.bigquery.storage.v1.BigQueryWrite" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json index a36b0694cf8..4bed0e60cc4 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json @@ -1,247 +1,247 @@ { - "clientLibrary": { - "name": "nodejs-storage", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.bigquery.storage.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "regionTag": "bigquerystorage_v1beta1_generated_BigQueryStorage_CreateReadSession_async", - "title": "BigQueryStorage createReadSession Sample", - "origin": "API_DEFINITION", - "description": " Creates a new read session. A read session divides the contents of a BigQuery table into one or more streams, which can then be used to read data from the table. The read session also specifies properties of the data to be read, such as a list of columns or a push-down filter describing the rows to be returned. A particular row can be read by at most one stream. When the caller has reached the end of each stream in the session, then all the data in the table has been read. Read sessions automatically expire 24 hours after they are created and do not require manual clean-up by the caller.", - "canonical": true, - "file": "big_query_storage.create_read_session.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 83, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateReadSession", - "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.CreateReadSession", - "async": true, - "parameters": [ - { - "name": "table_reference", - "type": ".google.cloud.bigquery.storage.v1beta1.TableReference" - }, - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "table_modifiers", - "type": ".google.cloud.bigquery.storage.v1beta1.TableModifiers" - }, - { - "name": "requested_streams", - "type": "TYPE_INT32" - }, - { - "name": "read_options", - "type": ".google.cloud.bigquery.storage.v1beta1.TableReadOptions" - }, - { - "name": "format", - "type": ".google.cloud.bigquery.storage.v1beta1.DataFormat" - }, - { - "name": "sharding_strategy", - "type": ".google.cloud.bigquery.storage.v1beta1.ShardingStrategy" - } - ], - "resultType": ".google.cloud.bigquery.storage.v1beta1.ReadSession", - "client": { - "shortName": "BigQueryStorageClient", - "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorageClient" - }, - "method": { - "shortName": "CreateReadSession", - "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.CreateReadSession", - "service": { - "shortName": "BigQueryStorage", - "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage" - } - } - } + "clientLibrary": { + "name": "nodejs-storage", + "version": "2.8.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.bigquery.storage.v1beta1", + "version": "v1beta1" + } + ] }, - { - "regionTag": "bigquerystorage_v1beta1_generated_BigQueryStorage_ReadRows_async", - "title": "BigQueryStorage readRows Sample", - "origin": "API_DEFINITION", - "description": " Reads rows from the table in the format prescribed by the read session. Each response contains one or more table rows, up to a maximum of 10 MiB per response; read requests which attempt to read individual rows larger than this will fail. Each request also returns a set of stream statistics reflecting the estimated total number of rows in the read stream. This number is computed based on the total table size and the number of active streams in the read session, and may change as other streams continue to read data.", - "canonical": true, - "file": "big_query_storage.read_rows.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ReadRows", - "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.ReadRows", - "async": true, - "parameters": [ - { - "name": "read_position", - "type": ".google.cloud.bigquery.storage.v1beta1.StreamPosition" - } - ], - "resultType": ".google.cloud.bigquery.storage.v1beta1.ReadRowsResponse", - "client": { - "shortName": "BigQueryStorageClient", - "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorageClient" + "regionTag": "bigquerystorage_v1beta1_generated_BigQueryStorage_CreateReadSession_async", + "title": "BigQueryStorage createReadSession Sample", + "origin": "API_DEFINITION", + "description": " Creates a new read session. A read session divides the contents of a BigQuery table into one or more streams, which can then be used to read data from the table. The read session also specifies properties of the data to be read, such as a list of columns or a push-down filter describing the rows to be returned. A particular row can be read by at most one stream. When the caller has reached the end of each stream in the session, then all the data in the table has been read. Read sessions automatically expire 24 hours after they are created and do not require manual clean-up by the caller.", + "canonical": true, + "file": "big_query_storage.create_read_session.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateReadSession", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.CreateReadSession", + "async": true, + "parameters": [ + { + "name": "table_reference", + "type": ".google.cloud.bigquery.storage.v1beta1.TableReference" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "table_modifiers", + "type": ".google.cloud.bigquery.storage.v1beta1.TableModifiers" + }, + { + "name": "requested_streams", + "type": "TYPE_INT32" + }, + { + "name": "read_options", + "type": ".google.cloud.bigquery.storage.v1beta1.TableReadOptions" + }, + { + "name": "format", + "type": ".google.cloud.bigquery.storage.v1beta1.DataFormat" + }, + { + "name": "sharding_strategy", + "type": ".google.cloud.bigquery.storage.v1beta1.ShardingStrategy" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1beta1.ReadSession", + "client": { + "shortName": "BigQueryStorageClient", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorageClient" + }, + "method": { + "shortName": "CreateReadSession", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.CreateReadSession", + "service": { + "shortName": "BigQueryStorage", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage" + } + } + } }, - "method": { - "shortName": "ReadRows", - "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.ReadRows", - "service": { - "shortName": "BigQueryStorage", - "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage" - } - } - } - }, - { - "regionTag": "bigquerystorage_v1beta1_generated_BigQueryStorage_BatchCreateReadSessionStreams_async", - "title": "BigQueryStorage batchCreateReadSessionStreams Sample", - "origin": "API_DEFINITION", - "description": " Creates additional streams for a ReadSession. This API can be used to dynamically adjust the parallelism of a batch processing task upwards by adding additional workers.", - "canonical": true, - "file": "big_query_storage.batch_create_read_session_streams.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchCreateReadSessionStreams", - "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.BatchCreateReadSessionStreams", - "async": true, - "parameters": [ - { - "name": "session", - "type": ".google.cloud.bigquery.storage.v1beta1.ReadSession" - }, - { - "name": "requested_streams", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse", - "client": { - "shortName": "BigQueryStorageClient", - "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorageClient" + "regionTag": "bigquerystorage_v1beta1_generated_BigQueryStorage_ReadRows_async", + "title": "BigQueryStorage readRows Sample", + "origin": "API_DEFINITION", + "description": " Reads rows from the table in the format prescribed by the read session. Each response contains one or more table rows, up to a maximum of 10 MiB per response; read requests which attempt to read individual rows larger than this will fail. Each request also returns a set of stream statistics reflecting the estimated total number of rows in the read stream. This number is computed based on the total table size and the number of active streams in the read session, and may change as other streams continue to read data.", + "canonical": true, + "file": "big_query_storage.read_rows.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ReadRows", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.ReadRows", + "async": true, + "parameters": [ + { + "name": "read_position", + "type": ".google.cloud.bigquery.storage.v1beta1.StreamPosition" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1beta1.ReadRowsResponse", + "client": { + "shortName": "BigQueryStorageClient", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorageClient" + }, + "method": { + "shortName": "ReadRows", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.ReadRows", + "service": { + "shortName": "BigQueryStorage", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage" + } + } + } }, - "method": { - "shortName": "BatchCreateReadSessionStreams", - "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.BatchCreateReadSessionStreams", - "service": { - "shortName": "BigQueryStorage", - "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage" - } - } - } - }, - { - "regionTag": "bigquerystorage_v1beta1_generated_BigQueryStorage_FinalizeStream_async", - "title": "BigQueryStorage finalizeStream Sample", - "origin": "API_DEFINITION", - "description": " Triggers the graceful termination of a single stream in a ReadSession. This API can be used to dynamically adjust the parallelism of a batch processing task downwards without losing data. This API does not delete the stream -- it remains visible in the ReadSession, and any data processed by the stream is not released to other streams. However, no additional data will be assigned to the stream once this call completes. Callers must continue reading data on the stream until the end of the stream is reached so that data which has already been assigned to the stream will be processed. This method will return an error if there are no other live streams in the Session, or if SplitReadStream() has been called on the given Stream.", - "canonical": true, - "file": "big_query_storage.finalize_stream.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 50, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FinalizeStream", - "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.FinalizeStream", - "async": true, - "parameters": [ - { - "name": "stream", - "type": ".google.cloud.bigquery.storage.v1beta1.Stream" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "BigQueryStorageClient", - "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorageClient" + "regionTag": "bigquerystorage_v1beta1_generated_BigQueryStorage_BatchCreateReadSessionStreams_async", + "title": "BigQueryStorage batchCreateReadSessionStreams Sample", + "origin": "API_DEFINITION", + "description": " Creates additional streams for a ReadSession. This API can be used to dynamically adjust the parallelism of a batch processing task upwards by adding additional workers.", + "canonical": true, + "file": "big_query_storage.batch_create_read_session_streams.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchCreateReadSessionStreams", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.BatchCreateReadSessionStreams", + "async": true, + "parameters": [ + { + "name": "session", + "type": ".google.cloud.bigquery.storage.v1beta1.ReadSession" + }, + { + "name": "requested_streams", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse", + "client": { + "shortName": "BigQueryStorageClient", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorageClient" + }, + "method": { + "shortName": "BatchCreateReadSessionStreams", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.BatchCreateReadSessionStreams", + "service": { + "shortName": "BigQueryStorage", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage" + } + } + } }, - "method": { - "shortName": "FinalizeStream", - "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.FinalizeStream", - "service": { - "shortName": "BigQueryStorage", - "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage" - } - } - } - }, - { - "regionTag": "bigquerystorage_v1beta1_generated_BigQueryStorage_SplitReadStream_async", - "title": "BigQueryStorage splitReadStream Sample", - "origin": "API_DEFINITION", - "description": " Splits a given read stream into two Streams. These streams are referred to as the primary and the residual of the split. The original stream can still be read from in the same manner as before. Both of the returned streams can also be read from, and the total rows return by both child streams will be the same as the rows read from the original stream. Moreover, the two child streams will be allocated back to back in the original Stream. Concretely, it is guaranteed that for streams Original, Primary, and Residual, that Original[0-j] = Primary[0-j] and Original[j-n] = Residual[0-m] once the streams have been read to completion. This method is guaranteed to be idempotent.", - "canonical": true, - "file": "big_query_storage.split_read_stream.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SplitReadStream", - "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.SplitReadStream", - "async": true, - "parameters": [ - { - "name": "original_stream", - "type": ".google.cloud.bigquery.storage.v1beta1.Stream" - }, - { - "name": "fraction", - "type": "TYPE_FLOAT" - } - ], - "resultType": ".google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse", - "client": { - "shortName": "BigQueryStorageClient", - "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorageClient" + "regionTag": "bigquerystorage_v1beta1_generated_BigQueryStorage_FinalizeStream_async", + "title": "BigQueryStorage finalizeStream Sample", + "origin": "API_DEFINITION", + "description": " Triggers the graceful termination of a single stream in a ReadSession. This API can be used to dynamically adjust the parallelism of a batch processing task downwards without losing data. This API does not delete the stream -- it remains visible in the ReadSession, and any data processed by the stream is not released to other streams. However, no additional data will be assigned to the stream once this call completes. Callers must continue reading data on the stream until the end of the stream is reached so that data which has already been assigned to the stream will be processed. This method will return an error if there are no other live streams in the Session, or if SplitReadStream() has been called on the given Stream.", + "canonical": true, + "file": "big_query_storage.finalize_stream.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FinalizeStream", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.FinalizeStream", + "async": true, + "parameters": [ + { + "name": "stream", + "type": ".google.cloud.bigquery.storage.v1beta1.Stream" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "BigQueryStorageClient", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorageClient" + }, + "method": { + "shortName": "FinalizeStream", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.FinalizeStream", + "service": { + "shortName": "BigQueryStorage", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage" + } + } + } }, - "method": { - "shortName": "SplitReadStream", - "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.SplitReadStream", - "service": { - "shortName": "BigQueryStorage", - "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage" - } + { + "regionTag": "bigquerystorage_v1beta1_generated_BigQueryStorage_SplitReadStream_async", + "title": "BigQueryStorage splitReadStream Sample", + "origin": "API_DEFINITION", + "description": " Splits a given read stream into two Streams. These streams are referred to as the primary and the residual of the split. The original stream can still be read from in the same manner as before. Both of the returned streams can also be read from, and the total rows return by both child streams will be the same as the rows read from the original stream. Moreover, the two child streams will be allocated back to back in the original Stream. Concretely, it is guaranteed that for streams Original, Primary, and Residual, that Original[0-j] = Primary[0-j] and Original[j-n] = Residual[0-m] once the streams have been read to completion. This method is guaranteed to be idempotent.", + "canonical": true, + "file": "big_query_storage.split_read_stream.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SplitReadStream", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.SplitReadStream", + "async": true, + "parameters": [ + { + "name": "original_stream", + "type": ".google.cloud.bigquery.storage.v1beta1.Stream" + }, + { + "name": "fraction", + "type": "TYPE_FLOAT" + } + ], + "resultType": ".google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse", + "client": { + "shortName": "BigQueryStorageClient", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorageClient" + }, + "method": { + "shortName": "SplitReadStream", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage.SplitReadStream", + "service": { + "shortName": "BigQueryStorage", + "fullName": "google.cloud.bigquery.storage.v1beta1.BigQueryStorage" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file From 5bbdfc191f2fbbc1a915203e0486cb736899da0e Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Mon, 16 May 2022 17:39:32 -0700 Subject: [PATCH 157/182] build!: update library to use Node 12 (#272) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat!: Update library to use Node 12 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- packages/google-cloud-bigquery-storage/package.json | 10 +++++----- .../google-cloud-bigquery-storage/samples/package.json | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 2790c6440f6..658aa7f1e01 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -27,28 +27,28 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^2.24.1" + "google-gax": "^3.0.1" }, "devDependencies": { "@types/mocha": "^8.0.0", "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.1.0", - "gts": "^3.0.0", + "gts": "^3.1.0", "jsdoc": "^3.6.3", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", "linkinator": "^2.0.1", - "mocha": "^8.0.0", + "mocha": "^9.2.2", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^13.0.0", "ts-loader": "^9.0.0", - "typescript": "^3.8.3", + "typescript": "^4.6.4", "webpack": "^5.0.0", "webpack-cli": "^4.0.0" }, "engines": { - "node": ">=10" + "node": ">=12.0.0" } } diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index c43c8948751..420a7bcd458 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=8" + "node": ">=12.0.0" }, "files": [ "*.js" @@ -14,8 +14,8 @@ }, "dependencies": { "@google-cloud/bigquery-storage": "^2.8.0", - "google-protobuf": "^3.19.1", "avsc": "^5.4.18", + "google-protobuf": "^3.19.1", "snappy": "^7.0.0" }, "devDependencies": { From e7beade5b9e0c31f52445550e8b2b66388561b0e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 31 May 2022 22:14:19 +0000 Subject: [PATCH 158/182] fix: fixes for dynamic routing and streaming descriptors (#274) - [ ] Regenerate this pull request now. Use gapic-generator-typescript v2.14.5. PiperOrigin-RevId: 450616838 Source-Link: https://github.com/googleapis/googleapis/commit/7a47b72791e0b84d78beca4c2b26bec42ce31572 Source-Link: https://github.com/googleapis/googleapis-gen/commit/42cc6331bae0b99f61b8e01ae15b05211716c4f9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDJjYzYzMzFiYWUwYjk5ZjYxYjhlMDFhZTE1YjA1MjExNzE2YzRmOSJ9 --- .../src/v1/big_query_read_client.ts | 3 ++- .../src/v1/big_query_write_client.ts | 3 ++- .../src/v1beta1/big_query_storage_client.ts | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index a0246aef5d2..525177ca372 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -185,7 +185,8 @@ export class BigQueryReadClient { // Provide descriptors for these. this.descriptors.stream = { readRows: new this._gaxModule.StreamDescriptor( - gax.StreamType.SERVER_STREAMING + gax.StreamType.SERVER_STREAMING, + opts.fallback === 'rest' ), }; diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts index 1cb67db7dac..2ab96c5d6e9 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts @@ -188,7 +188,8 @@ export class BigQueryWriteClient { // Provide descriptors for these. this.descriptors.stream = { appendRows: new this._gaxModule.StreamDescriptor( - gax.StreamType.BIDI_STREAMING + gax.StreamType.BIDI_STREAMING, + opts.fallback === 'rest' ), }; diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index 342ef1a6e9c..544d6d476ce 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -179,7 +179,8 @@ export class BigQueryStorageClient { // Provide descriptors for these. this.descriptors.stream = { readRows: new this._gaxModule.StreamDescriptor( - gax.StreamType.SERVER_STREAMING + gax.StreamType.SERVER_STREAMING, + opts.fallback === 'rest' ), }; From 78554114e7d53386816f13c3b678f07f09f8fe9d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 9 Jun 2022 20:37:38 +0200 Subject: [PATCH 159/182] chore(deps): update dependency @types/mocha to v9 (#264) --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 658aa7f1e01..64e698facc6 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -30,7 +30,7 @@ "google-gax": "^3.0.1" }, "devDependencies": { - "@types/mocha": "^8.0.0", + "@types/mocha": "^9.0.0", "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.1.0", From fe89c8df58b67eab9d033af6984860bc39c367e5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jun 2022 17:08:14 +0200 Subject: [PATCH 160/182] chore(deps): update dependency jsdoc-region-tag to v2 (#278) 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-storage). --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 64e698facc6..6d23856a4ce 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -37,7 +37,7 @@ "gts": "^3.1.0", "jsdoc": "^3.6.3", "jsdoc-fresh": "^1.0.2", - "jsdoc-region-tag": "^1.0.4", + "jsdoc-region-tag": "^2.0.0", "linkinator": "^2.0.1", "mocha": "^9.2.2", "null-loader": "^4.0.0", From 5124b1e3889d8059fc2867d4c8f78f64c917234a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jun 2022 17:32:36 +0200 Subject: [PATCH 161/182] chore(deps): update dependency jsdoc-fresh to v2 (#277) 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-storage). --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 6d23856a4ce..2d47cd2c2ad 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -36,7 +36,7 @@ "c8": "^7.1.0", "gts": "^3.1.0", "jsdoc": "^3.6.3", - "jsdoc-fresh": "^1.0.2", + "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "linkinator": "^2.0.1", "mocha": "^9.2.2", From 8df7d0404037a2500735464c5e073bfc5b719416 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 20 Jun 2022 21:11:32 +0200 Subject: [PATCH 162/182] chore(deps): update dependency sinon to v14 (#269) Co-authored-by: Steffany Brown <30247553+steffnay@users.noreply.github.com> --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 2d47cd2c2ad..635dbfce4ff 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -42,7 +42,7 @@ "mocha": "^9.2.2", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^13.0.0", + "sinon": "^14.0.0", "ts-loader": "^9.0.0", "typescript": "^4.6.4", "webpack": "^5.0.0", From 3ce00fb39d1c55c03b036ff64b0d5cdef8eac018 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 29 Jun 2022 12:40:42 -0400 Subject: [PATCH 163/182] fix: Modify client lib retry policy for CreateWriteStream with longer backoff, more error code and longer overall time (#279) feat: add fields to eventually contain row level errors Committer: @gnanda PiperOrigin-RevId: 456324780 Source-Link: https://github.com/googleapis/googleapis/commit/f24b37a351260ddce8208edae50d637fa0b88d6b Source-Link: https://github.com/googleapis/googleapis-gen/commit/33f9d814082117116c4b68a6f5aac3f42bec35c2 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzNmOWQ4MTQwODIxMTcxMTZjNGI2OGE2ZjVhYWMzZjQyYmVjMzVjMiJ9 feat: support regapic LRO PiperOrigin-RevId: 456946341 Source-Link: https://github.com/googleapis/googleapis/commit/88fd18d9d3b872b3d06a3d9392879f50b5bf3ce5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/accfa371f667439313335c64042b063c1c53102e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWNjZmEzNzFmNjY3NDM5MzEzMzM1YzY0MDQyYjA2M2MxYzUzMTAyZSJ9 See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md fix: Modify client lib retry policy for CreateWriteStream with longer backoff, more error code and longer overall time PiperOrigin-RevId: 457061436 Source-Link: https://github.com/googleapis/googleapis/commit/8ff130bc81fa1d175e410d14a300caa18d5ebf80 Source-Link: https://github.com/googleapis/googleapis-gen/commit/2eb0faca717d9cf44b838b7db5e862451b8a86ef Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmViMGZhY2E3MTdkOWNmNDRiODM4YjdkYjVlODYyNDUxYjhhODZlZiJ9 See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../cloud/bigquery/storage/v1/storage.proto | 38 ++- .../cloud/bigquery/storage/v1/stream.proto | 3 +- .../cloud/bigquery/storage/v1/table.proto | 4 +- .../protos/protos.d.ts | 117 +++++++ .../protos/protos.js | 317 ++++++++++++++++++ .../protos/protos.json | 29 ++ .../v1/big_query_read.create_read_session.js | 10 +- ...data.google.cloud.bigquery.storage.v1.json | 2 +- .../src/v1/big_query_read_client.ts | 21 +- .../src/v1/big_query_write_client.ts | 11 +- .../src/v1/big_query_write_client_config.json | 20 +- .../src/v1beta1/big_query_storage_client.ts | 11 +- 12 files changed, 546 insertions(+), 37 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto index 67c6c8a0295..f3c974c6461 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto @@ -248,11 +248,13 @@ message CreateReadSessionRequest { // Max initial number of streams. If unset or zero, the server will // provide a value of streams so as to produce reasonable throughput. Must be // non-negative. The number of streams may be lower than the requested number, - // depending on the amount parallelism that is reasonable for the table. Error - // will be returned if the max count is greater than the current system - // max limit of 1,000. + // depending on the amount parallelism that is reasonable for the table. + // There is a default system max limit of 1,000. // - // Streams must be read starting from offset 0. + // This must be greater than or equal to preferred_min_stream_count. + // Typically, clients should either leave this unset to let the system to + // determine an upper bound OR set this a size for the maximum "units of work" + // it can gracefully handle. int32 max_stream_count = 3; } @@ -329,7 +331,7 @@ message ReadRowsResponse { // The schema for the read. If read_options.selected_fields is set, the // schema may be different from the table schema as it will only contain - // the selected fields. This schema is equivelant to the one returned by + // the selected fields. This schema is equivalent to the one returned by // CreateSession. This field is only populated in the first ReadRowsResponse // RPC. oneof schema { @@ -488,6 +490,11 @@ message AppendRowsResponse { // use it to input new type of message. It will be empty when no schema // updates have occurred. TableSchema updated_schema = 3; + + // If a request failed due to corrupted rows, no rows in the batch will be + // appended. The API will return row level error info, so that the caller can + // remove the bad rows and retry the request. + repeated RowError row_errors = 4; } // Request message for `GetWriteStreamRequest`. @@ -622,3 +629,24 @@ message StorageError { // Message that describes the error. string error_message = 3; } + +// The message that presents row level error info in a request. +message RowError { + // Error code for `RowError`. + enum RowErrorCode { + // Default error. + ROW_ERROR_CODE_UNSPECIFIED = 0; + + // One or more fields in the row has errors. + FIELDS_ERROR = 1; + } + + // Index of the malformed row in the request. + int64 index = 1; + + // Structured error reason for a row error. + RowErrorCode code = 2; + + // Description of the issue encountered when processing the row. + string message = 3; +} diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto index bd1fa2ce98a..fd1e25b65fd 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto @@ -32,6 +32,7 @@ option php_namespace = "Google\\Cloud\\BigQuery\\Storage\\V1"; // Data format for input or output data. enum DataFormat { + // Data format is unspecified. DATA_FORMAT_UNSPECIFIED = 0; // Avro is a standard open source row based file format. @@ -91,7 +92,7 @@ message ReadSession { // automatically assigned and currently cannot be specified or updated. google.protobuf.Timestamp expire_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Immutable. Data format of the output data. + // Immutable. Data format of the output data. DATA_FORMAT_UNSPECIFIED not supported. DataFormat data_format = 3 [(google.api.field_behavior) = IMMUTABLE]; // The schema for the read. If read_options.selected_fields is set, the diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/table.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/table.proto index 545f6292712..fa4f840c580 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/table.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/table.proto @@ -25,7 +25,9 @@ option java_outer_classname = "TableProto"; option java_package = "com.google.cloud.bigquery.storage.v1"; option php_namespace = "Google\\Cloud\\BigQuery\\Storage\\V1"; -// Schema of a table. +// Schema of a table. This schema is a subset of +// google.cloud.bigquery.v2.TableSchema containing information necessary to +// generate valid message to write to BigQuery. message TableSchema { // Describes the fields in a table. repeated TableFieldSchema fields = 1; diff --git a/packages/google-cloud-bigquery-storage/protos/protos.d.ts b/packages/google-cloud-bigquery-storage/protos/protos.d.ts index a82f40762cd..b111ca1f564 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-storage/protos/protos.d.ts @@ -2036,6 +2036,9 @@ export namespace google { /** AppendRowsResponse updatedSchema */ updatedSchema?: (google.cloud.bigquery.storage.v1.ITableSchema|null); + + /** AppendRowsResponse rowErrors */ + rowErrors?: (google.cloud.bigquery.storage.v1.IRowError[]|null); } /** Represents an AppendRowsResponse. */ @@ -2056,6 +2059,9 @@ export namespace google { /** AppendRowsResponse updatedSchema. */ public updatedSchema?: (google.cloud.bigquery.storage.v1.ITableSchema|null); + /** AppendRowsResponse rowErrors. */ + public rowErrors: google.cloud.bigquery.storage.v1.IRowError[]; + /** AppendRowsResponse response. */ public response?: ("appendResult"|"error"); @@ -2990,6 +2996,117 @@ export namespace google { } } + /** Properties of a RowError. */ + interface IRowError { + + /** RowError index */ + index?: (number|Long|string|null); + + /** RowError code */ + code?: (google.cloud.bigquery.storage.v1.RowError.RowErrorCode|keyof typeof google.cloud.bigquery.storage.v1.RowError.RowErrorCode|null); + + /** RowError message */ + message?: (string|null); + } + + /** Represents a RowError. */ + class RowError implements IRowError { + + /** + * Constructs a new RowError. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.IRowError); + + /** RowError index. */ + public index: (number|Long|string); + + /** RowError code. */ + public code: (google.cloud.bigquery.storage.v1.RowError.RowErrorCode|keyof typeof google.cloud.bigquery.storage.v1.RowError.RowErrorCode); + + /** RowError message. */ + public message: string; + + /** + * Creates a new RowError instance using the specified properties. + * @param [properties] Properties to set + * @returns RowError instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.IRowError): google.cloud.bigquery.storage.v1.RowError; + + /** + * Encodes the specified RowError message. Does not implicitly {@link google.cloud.bigquery.storage.v1.RowError.verify|verify} messages. + * @param message RowError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.IRowError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RowError message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.RowError.verify|verify} messages. + * @param message RowError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IRowError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RowError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RowError + * @throws {Error} If the payload is not a 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.storage.v1.RowError; + + /** + * Decodes a RowError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RowError + * @throws {Error} If the payload is 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.storage.v1.RowError; + + /** + * Verifies a RowError message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RowError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RowError + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.RowError; + + /** + * Creates a plain object from a RowError message. Also converts values to other types if specified. + * @param message RowError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.RowError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RowError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace RowError { + + /** RowErrorCode enum. */ + enum RowErrorCode { + ROW_ERROR_CODE_UNSPECIFIED = 0, + FIELDS_ERROR = 1 + } + } + /** DataFormat enum. */ enum DataFormat { DATA_FORMAT_UNSPECIFIED = 0, diff --git a/packages/google-cloud-bigquery-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index 1d0989c2671..ea81e6448f4 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/protos/protos.js @@ -4532,6 +4532,7 @@ * @property {google.cloud.bigquery.storage.v1.AppendRowsResponse.IAppendResult|null} [appendResult] AppendRowsResponse appendResult * @property {google.rpc.IStatus|null} [error] AppendRowsResponse error * @property {google.cloud.bigquery.storage.v1.ITableSchema|null} [updatedSchema] AppendRowsResponse updatedSchema + * @property {Array.|null} [rowErrors] AppendRowsResponse rowErrors */ /** @@ -4543,6 +4544,7 @@ * @param {google.cloud.bigquery.storage.v1.IAppendRowsResponse=} [properties] Properties to set */ function AppendRowsResponse(properties) { + this.rowErrors = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4573,6 +4575,14 @@ */ AppendRowsResponse.prototype.updatedSchema = null; + /** + * AppendRowsResponse rowErrors. + * @member {Array.} rowErrors + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse + * @instance + */ + AppendRowsResponse.prototype.rowErrors = $util.emptyArray; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -4617,6 +4627,9 @@ $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.updatedSchema != null && Object.hasOwnProperty.call(message, "updatedSchema")) $root.google.cloud.bigquery.storage.v1.TableSchema.encode(message.updatedSchema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.rowErrors != null && message.rowErrors.length) + for (var i = 0; i < message.rowErrors.length; ++i) + $root.google.cloud.bigquery.storage.v1.RowError.encode(message.rowErrors[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -4660,6 +4673,11 @@ case 3: message.updatedSchema = $root.google.cloud.bigquery.storage.v1.TableSchema.decode(reader, reader.uint32()); break; + case 4: + if (!(message.rowErrors && message.rowErrors.length)) + message.rowErrors = []; + message.rowErrors.push($root.google.cloud.bigquery.storage.v1.RowError.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -4719,6 +4737,15 @@ if (error) return "updatedSchema." + error; } + if (message.rowErrors != null && message.hasOwnProperty("rowErrors")) { + if (!Array.isArray(message.rowErrors)) + return "rowErrors: array expected"; + for (var i = 0; i < message.rowErrors.length; ++i) { + var error = $root.google.cloud.bigquery.storage.v1.RowError.verify(message.rowErrors[i]); + if (error) + return "rowErrors." + error; + } + } return null; }; @@ -4749,6 +4776,16 @@ throw TypeError(".google.cloud.bigquery.storage.v1.AppendRowsResponse.updatedSchema: object expected"); message.updatedSchema = $root.google.cloud.bigquery.storage.v1.TableSchema.fromObject(object.updatedSchema); } + if (object.rowErrors) { + if (!Array.isArray(object.rowErrors)) + throw TypeError(".google.cloud.bigquery.storage.v1.AppendRowsResponse.rowErrors: array expected"); + message.rowErrors = []; + for (var i = 0; i < object.rowErrors.length; ++i) { + if (typeof object.rowErrors[i] !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.AppendRowsResponse.rowErrors: object expected"); + message.rowErrors[i] = $root.google.cloud.bigquery.storage.v1.RowError.fromObject(object.rowErrors[i]); + } + } return message; }; @@ -4765,6 +4802,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.rowErrors = []; if (options.defaults) object.updatedSchema = null; if (message.appendResult != null && message.hasOwnProperty("appendResult")) { @@ -4779,6 +4818,11 @@ } if (message.updatedSchema != null && message.hasOwnProperty("updatedSchema")) object.updatedSchema = $root.google.cloud.bigquery.storage.v1.TableSchema.toObject(message.updatedSchema, options); + if (message.rowErrors && message.rowErrors.length) { + object.rowErrors = []; + for (var j = 0; j < message.rowErrors.length; ++j) + object.rowErrors[j] = $root.google.cloud.bigquery.storage.v1.RowError.toObject(message.rowErrors[j], options); + } return object; }; @@ -6756,6 +6800,279 @@ return StorageError; })(); + v1.RowError = (function() { + + /** + * Properties of a RowError. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IRowError + * @property {number|Long|null} [index] RowError index + * @property {google.cloud.bigquery.storage.v1.RowError.RowErrorCode|null} [code] RowError code + * @property {string|null} [message] RowError message + */ + + /** + * Constructs a new RowError. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents a RowError. + * @implements IRowError + * @constructor + * @param {google.cloud.bigquery.storage.v1.IRowError=} [properties] Properties to set + */ + function RowError(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RowError index. + * @member {number|Long} index + * @memberof google.cloud.bigquery.storage.v1.RowError + * @instance + */ + RowError.prototype.index = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RowError code. + * @member {google.cloud.bigquery.storage.v1.RowError.RowErrorCode} code + * @memberof google.cloud.bigquery.storage.v1.RowError + * @instance + */ + RowError.prototype.code = 0; + + /** + * RowError message. + * @member {string} message + * @memberof google.cloud.bigquery.storage.v1.RowError + * @instance + */ + RowError.prototype.message = ""; + + /** + * Creates a new RowError instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.RowError + * @static + * @param {google.cloud.bigquery.storage.v1.IRowError=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.RowError} RowError instance + */ + RowError.create = function create(properties) { + return new RowError(properties); + }; + + /** + * Encodes the specified RowError message. Does not implicitly {@link google.cloud.bigquery.storage.v1.RowError.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.RowError + * @static + * @param {google.cloud.bigquery.storage.v1.IRowError} message RowError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowError.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.index); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.message); + return writer; + }; + + /** + * Encodes the specified RowError message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.RowError.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.RowError + * @static + * @param {google.cloud.bigquery.storage.v1.IRowError} message RowError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RowError message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.RowError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.RowError} RowError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowError.decode = function decode(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.storage.v1.RowError(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.int64(); + break; + case 2: + message.code = reader.int32(); + break; + case 3: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RowError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.RowError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.RowError} RowError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RowError message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.RowError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RowError.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index) && !(message.index && $util.isInteger(message.index.low) && $util.isInteger(message.index.high))) + return "index: integer|Long expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + break; + } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + return null; + }; + + /** + * Creates a RowError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.RowError + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.RowError} RowError + */ + RowError.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.RowError) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.RowError(); + if (object.index != null) + if ($util.Long) + (message.index = $util.Long.fromValue(object.index)).unsigned = false; + else if (typeof object.index === "string") + message.index = parseInt(object.index, 10); + else if (typeof object.index === "number") + message.index = object.index; + else if (typeof object.index === "object") + message.index = new $util.LongBits(object.index.low >>> 0, object.index.high >>> 0).toNumber(); + switch (object.code) { + case "ROW_ERROR_CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "FIELDS_ERROR": + case 1: + message.code = 1; + break; + } + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from a RowError message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.RowError + * @static + * @param {google.cloud.bigquery.storage.v1.RowError} message RowError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RowError.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.index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.index = options.longs === String ? "0" : 0; + object.code = options.enums === String ? "ROW_ERROR_CODE_UNSPECIFIED" : 0; + object.message = ""; + } + if (message.index != null && message.hasOwnProperty("index")) + if (typeof message.index === "number") + object.index = options.longs === String ? String(message.index) : message.index; + else + object.index = options.longs === String ? $util.Long.prototype.toString.call(message.index) : options.longs === Number ? new $util.LongBits(message.index.low >>> 0, message.index.high >>> 0).toNumber() : message.index; + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.cloud.bigquery.storage.v1.RowError.RowErrorCode[message.code] : message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + return object; + }; + + /** + * Converts this RowError to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.RowError + * @instance + * @returns {Object.} JSON object + */ + RowError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * RowErrorCode enum. + * @name google.cloud.bigquery.storage.v1.RowError.RowErrorCode + * @enum {number} + * @property {number} ROW_ERROR_CODE_UNSPECIFIED=0 ROW_ERROR_CODE_UNSPECIFIED value + * @property {number} FIELDS_ERROR=1 FIELDS_ERROR value + */ + RowError.RowErrorCode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROW_ERROR_CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FIELDS_ERROR"] = 1; + return values; + })(); + + return RowError; + })(); + /** * DataFormat enum. * @name google.cloud.bigquery.storage.v1.DataFormat diff --git a/packages/google-cloud-bigquery-storage/protos/protos.json b/packages/google-cloud-bigquery-storage/protos/protos.json index a892cd68782..d796f2c8745 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.json +++ b/packages/google-cloud-bigquery-storage/protos/protos.json @@ -523,6 +523,11 @@ "updatedSchema": { "type": "TableSchema", "id": 3 + }, + "rowErrors": { + "rule": "repeated", + "type": "RowError", + "id": 4 } }, "nested": { @@ -657,6 +662,30 @@ } } }, + "RowError": { + "fields": { + "index": { + "type": "int64", + "id": 1 + }, + "code": { + "type": "RowErrorCode", + "id": 2 + }, + "message": { + "type": "string", + "id": 3 + } + }, + "nested": { + "RowErrorCode": { + "values": { + "ROW_ERROR_CODE_UNSPECIFIED": 0, + "FIELDS_ERROR": 1 + } + } + } + }, "DataFormat": { "values": { "DATA_FORMAT_UNSPECIFIED": 0, diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js index f4d2f95025e..c5cc160a217 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js @@ -38,10 +38,12 @@ function main(parent, readSession) { * Max initial number of streams. If unset or zero, the server will * provide a value of streams so as to produce reasonable throughput. Must be * non-negative. The number of streams may be lower than the requested number, - * depending on the amount parallelism that is reasonable for the table. Error - * will be returned if the max count is greater than the current system - * max limit of 1,000. - * Streams must be read starting from offset 0. + * depending on the amount parallelism that is reasonable for the table. + * There is a default system max limit of 1,000. + * This must be greater than or equal to preferred_min_stream_count. + * Typically, clients should either leave this unset to let the system to + * determine an upper bound OR set this a size for the maximum "units of work" + * it can gracefully handle. */ // const maxStreamCount = 1234 diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json b/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json index 93aaa2255ba..90db40853ef 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 66, + "end": 68, "type": "FULL" } ], diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index 525177ca372..553fe889849 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -70,7 +70,7 @@ export class BigQueryReadClient { * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] @@ -93,11 +93,10 @@ export class BigQueryReadClient { * 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. @@ -370,11 +369,13 @@ export class BigQueryReadClient { * Max initial number of streams. If unset or zero, the server will * provide a value of streams so as to produce reasonable throughput. Must be * non-negative. The number of streams may be lower than the requested number, - * depending on the amount parallelism that is reasonable for the table. Error - * will be returned if the max count is greater than the current system - * max limit of 1,000. + * depending on the amount parallelism that is reasonable for the table. + * There is a default system max limit of 1,000. * - * Streams must be read starting from offset 0. + * This must be greater than or equal to preferred_min_stream_count. + * Typically, clients should either leave this unset to let the system to + * determine an upper bound OR set this a size for the maximum "units of work" + * it can gracefully handle. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts index 2ab96c5d6e9..1e0569e1f7e 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts @@ -73,7 +73,7 @@ export class BigQueryWriteClient { * * @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] @@ -96,11 +96,10 @@ export class BigQueryWriteClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client_config.json b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client_config.json index 67eb3165cb6..4b7f4b0657b 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client_config.json +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client_config.json @@ -7,6 +7,11 @@ "DEADLINE_EXCEEDED", "UNAVAILABLE" ], + "deadline_exceeded_resource_exhausted_unavailable": [ + "DEADLINE_EXCEEDED", + "RESOURCE_EXHAUSTED", + "UNAVAILABLE" + ], "unavailable": [ "UNAVAILABLE" ] @@ -20,13 +25,22 @@ "rpc_timeout_multiplier": 1, "max_rpc_timeout_millis": 60000, "total_timeout_millis": 600000 + }, + "ec82364a95d03873ac5f61710bb6b9b42e40f31d": { + "initial_retry_delay_millis": 10000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 120000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 } }, "methods": { "CreateWriteStream": { - "timeout_millis": 600000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" + "timeout_millis": 1200000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "ec82364a95d03873ac5f61710bb6b9b42e40f31d" }, "AppendRows": { "timeout_millis": 86400000, diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index 544d6d476ce..e1c27a9e683 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -70,7 +70,7 @@ export class BigQueryStorageClient { * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] @@ -93,11 +93,10 @@ export class BigQueryStorageClient { * 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 dfe294d57b099f658b4d710b96b2d90bc980a0c7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 30 Jun 2022 19:40:14 +0000 Subject: [PATCH 164/182] chore(main): release 3.0.0 (#273) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit :robot: I have created a release *beep* *boop* --- ## [3.0.0](https://github.com/googleapis/nodejs-bigquery-storage/compare/v2.8.0...v3.0.0) (2022-06-29) ### ⚠ BREAKING CHANGES * update library to use Node 12 (#272) ### Features * Deprecate format specific `row_count` field in Read API ([#249](https://github.com/googleapis/nodejs-bigquery-storage/issues/249)) ([fb8acf1](https://github.com/googleapis/nodejs-bigquery-storage/commit/fb8acf1f4eab7823132159bcf5927c9eda6374e2)) ### Bug Fixes * fixes for dynamic routing and streaming descriptors ([#274](https://github.com/googleapis/nodejs-bigquery-storage/issues/274)) ([4271ea0](https://github.com/googleapis/nodejs-bigquery-storage/commit/4271ea0aaa98286696eb6822d0bef82a655a5811)) * Modify client lib retry policy for CreateWriteStream with longer backoff, more error code and longer overall time ([#279](https://github.com/googleapis/nodejs-bigquery-storage/issues/279)) ([849cc23](https://github.com/googleapis/nodejs-bigquery-storage/commit/849cc237081e63a585264a62d49e9407d2f14450)) ### Build System * update library to use Node 12 ([#272](https://github.com/googleapis/nodejs-bigquery-storage/issues/272)) ([5e774e6](https://github.com/googleapis/nodejs-bigquery-storage/commit/5e774e614132f189362d56c502960d87200a11a0)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- .../CHANGELOG.md | 22 +++++++++++++++++++ .../package.json | 2 +- ...data.google.cloud.bigquery.storage.v1.json | 2 +- ...google.cloud.bigquery.storage.v1beta1.json | 2 +- .../samples/package.json | 2 +- 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md index 7f8d97f132f..5d9719cffc8 100644 --- a/packages/google-cloud-bigquery-storage/CHANGELOG.md +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## [3.0.0](https://github.com/googleapis/nodejs-bigquery-storage/compare/v2.8.0...v3.0.0) (2022-06-29) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#272) + +### Features + +* Deprecate format specific `row_count` field in Read API ([#249](https://github.com/googleapis/nodejs-bigquery-storage/issues/249)) ([fb8acf1](https://github.com/googleapis/nodejs-bigquery-storage/commit/fb8acf1f4eab7823132159bcf5927c9eda6374e2)) + + +### Bug Fixes + +* fixes for dynamic routing and streaming descriptors ([#274](https://github.com/googleapis/nodejs-bigquery-storage/issues/274)) ([4271ea0](https://github.com/googleapis/nodejs-bigquery-storage/commit/4271ea0aaa98286696eb6822d0bef82a655a5811)) +* Modify client lib retry policy for CreateWriteStream with longer backoff, more error code and longer overall time ([#279](https://github.com/googleapis/nodejs-bigquery-storage/issues/279)) ([849cc23](https://github.com/googleapis/nodejs-bigquery-storage/commit/849cc237081e63a585264a62d49e9407d2f14450)) + + +### Build System + +* update library to use Node 12 ([#272](https://github.com/googleapis/nodejs-bigquery-storage/issues/272)) ([5e774e6](https://github.com/googleapis/nodejs-bigquery-storage/commit/5e774e614132f189362d56c502960d87200a11a0)) + ## [2.8.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.7.0...v2.8.0) (2021-12-30) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 635dbfce4ff..a2e9713f6d9 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "2.8.0", + "version": "3.0.0", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json b/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json index 90db40853ef..28d36811dc6 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-storage", - "version": "2.8.0", + "version": "3.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json index 4bed0e60cc4..58ffbbc5164 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-storage", - "version": "2.8.0", + "version": "3.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index 420a7bcd458..adeada155c9 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^2.8.0", + "@google-cloud/bigquery-storage": "^3.0.0", "avsc": "^5.4.18", "google-protobuf": "^3.19.1", "snappy": "^7.0.0" From dca45957cb4cd4df23b735c779cabd70dc6edc59 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 8 Jul 2022 23:02:15 +0200 Subject: [PATCH 165/182] chore(deps): update dependency linkinator to v4 (#282) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [linkinator](https://togithub.com/JustinBeckwith/linkinator) | [`^2.0.1` -> `^4.0.0`](https://renovatebot.com/diffs/npm/linkinator/2.16.2/4.0.0) | [![age](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/compatibility-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/confidence-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
JustinBeckwith/linkinator ### [`v4.0.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v4.0.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.1.0...v4.0.0) ##### Features - create new release with notes ([#​508](https://togithub.com/JustinBeckwith/linkinator/issues/508)) ([2cab633](https://togithub.com/JustinBeckwith/linkinator/commit/2cab633c9659eb10794a4bac06f8b0acdc3e2c0c)) ##### BREAKING CHANGES - The commits in [#​507](https://togithub.com/JustinBeckwith/linkinator/issues/507) and [#​506](https://togithub.com/JustinBeckwith/linkinator/issues/506) both had breaking changes. They included dropping support for Node.js 12.x and updating the CSV export to be streaming, and to use a new way of writing the CSV file. This is an empty to commit using the `BREAKING CHANGE` format in the commit message to ensure a release is triggered. ### [`v3.1.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.1.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.6...v3.1.0) ##### Features - allow --skip to be defined multiple times ([#​399](https://togithub.com/JustinBeckwith/linkinator/issues/399)) ([5ca5a46](https://togithub.com/JustinBeckwith/linkinator/commit/5ca5a461508e688de12e5ae6b4cfb6565f832ebf)) ### [`v3.0.6`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.6) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.5...v3.0.6) ##### Bug Fixes - **deps:** upgrade node-glob to v8 ([#​397](https://togithub.com/JustinBeckwith/linkinator/issues/397)) ([d334dc6](https://togithub.com/JustinBeckwith/linkinator/commit/d334dc6734cd7c2b73d7ed3dea0550a6c3072ad5)) ### [`v3.0.5`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.5) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.4...v3.0.5) ##### Bug Fixes - **deps:** upgrade to htmlparser2 v8.0.1 ([#​396](https://togithub.com/JustinBeckwith/linkinator/issues/396)) ([ba3b9a8](https://togithub.com/JustinBeckwith/linkinator/commit/ba3b9a8a9b19d39af6ed91790135e833b80c1eb6)) ### [`v3.0.4`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.4) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.3...v3.0.4) ##### Bug Fixes - **deps:** update dependency gaxios to v5 ([#​391](https://togithub.com/JustinBeckwith/linkinator/issues/391)) ([48af50e](https://togithub.com/JustinBeckwith/linkinator/commit/48af50e787731204aeb7eff41325c62291311e45)) ### [`v3.0.3`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.3) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.2...v3.0.3) ##### Bug Fixes - export getConfig from index ([#​371](https://togithub.com/JustinBeckwith/linkinator/issues/371)) ([0bc0355](https://togithub.com/JustinBeckwith/linkinator/commit/0bc0355c7e2ea457f247e6b52d1577b8c4ecb3a1)) ### [`v3.0.2`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.2) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.1...v3.0.2) ##### Bug Fixes - allow server root with trailing slash ([#​370](https://togithub.com/JustinBeckwith/linkinator/issues/370)) ([8adf6b0](https://togithub.com/JustinBeckwith/linkinator/commit/8adf6b025fda250e38461f1cdad40fe08c3b3b7c)) ### [`v3.0.1`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.1) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.0...v3.0.1) ##### Bug Fixes - decode path parts in local web server ([#​369](https://togithub.com/JustinBeckwith/linkinator/issues/369)) ([4696a0c](https://togithub.com/JustinBeckwith/linkinator/commit/4696a0c38c341b178ed815f47371fca955979feb)) ### [`v3.0.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v2.16.2...v3.0.0) ##### Bug Fixes - **deps:** update dependency chalk to v5 ([#​362](https://togithub.com/JustinBeckwith/linkinator/issues/362)) ([4b17a8d](https://togithub.com/JustinBeckwith/linkinator/commit/4b17a8d87b649eaf813428f8ee6955e1d21dae4f)) - feat!: convert to es modules, drop node 10 ([#​359](https://togithub.com/JustinBeckwith/linkinator/issues/359)) ([efee299](https://togithub.com/JustinBeckwith/linkinator/commit/efee299ab8a805accef751eecf8538915a4e7783)), closes [#​359](https://togithub.com/JustinBeckwith/linkinator/issues/359) ##### BREAKING CHANGES - this module now requires node.js 12 and above, and has moved to es modules by default.
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-bigquery-storage). --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index a2e9713f6d9..367d3085b85 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -38,7 +38,7 @@ "jsdoc": "^3.6.3", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^2.0.1", + "linkinator": "^4.0.0", "mocha": "^9.2.2", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", From c1a36c93a754bf3697747ea84bf663a2881b3d6f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 9 Jul 2022 00:45:47 +0200 Subject: [PATCH 166/182] chore(deps): update dependency @google-cloud/bigquery to v6 (#275) --- packages/google-cloud-bigquery-storage/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index adeada155c9..296fa69a3b1 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -19,7 +19,7 @@ "snappy": "^7.0.0" }, "devDependencies": { - "@google-cloud/bigquery": "^5.9.3", + "@google-cloud/bigquery": "^6.0.0", "c8": "^7.0.0", "chai": "^4.2.0", "mocha": "^8.0.0", From 7bd13e708490fe893b520ac2144da7e992fedb5e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 10:50:43 -0700 Subject: [PATCH 167/182] docs: clarify size limitations for AppendRowsRequest (#283) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: clarify size limitations for AppendRowsRequest chore: add preferred_min_stream_count to CreateReadSessionRequest chore: add write_stream to AppendRowsResponse PiperOrigin-RevId: 463602530 Source-Link: https://github.com/googleapis/googleapis/commit/d33b3fa0897cee1cc57b5b428587052c87e9bf25 Source-Link: https://github.com/googleapis/googleapis-gen/commit/90995f6433d0ecd290f186168ce957d6a0db9c68 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTA5OTVmNjQzM2QwZWNkMjkwZjE4NjE2OGNlOTU3ZDZhMGRiOWM2OCJ9 * 🦉 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 --- .../cloud/bigquery/storage/v1/storage.proto | 17 +++++++ .../protos/protos.d.ts | 12 +++++ .../protos/protos.js | 47 ++++++++++++++++++- .../protos/protos.json | 8 ++++ .../v1/big_query_read.create_read_session.js | 10 ++++ ...data.google.cloud.bigquery.storage.v1.json | 6 ++- .../src/v1/big_query_read_client.ts | 9 ++++ 7 files changed, 107 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto index f3c974c6461..e0b25c1afef 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto @@ -256,6 +256,16 @@ message CreateReadSessionRequest { // determine an upper bound OR set this a size for the maximum "units of work" // it can gracefully handle. int32 max_stream_count = 3; + + // The minimum preferred stream count. This parameter can be used to inform + // the service that there is a desired lower bound on the number of streams. + // This is typically a target parallelism of the client (e.g. a Spark + // cluster with N-workers would set this to a low multiple of N to ensure + // good cluster utilization). + // + // The system will make a best effort to provide at least this number of + // streams, but in some cases might provide less. + int32 preferred_min_stream_count = 4; } // Request message for `ReadRows`. @@ -395,6 +405,9 @@ message CreateWriteStreamRequest { // Due to the nature of AppendRows being a bidirectional streaming RPC, certain // parts of the AppendRowsRequest need only be specified for the first request // sent each time the gRPC network connection is opened/reopened. +// +// The size of a single AppendRowsRequest must be less than 10 MB in size. +// Requests larger than this return an error, typically `INVALID_ARGUMENT`. message AppendRowsRequest { // ProtoData contains the data rows and schema when constructing append // requests. @@ -495,6 +508,10 @@ message AppendRowsResponse { // appended. The API will return row level error info, so that the caller can // remove the bad rows and retry the request. repeated RowError row_errors = 4; + + // The target of the append operation. Matches the write_stream in the + // corresponding request. + string write_stream = 5; } // Request message for `GetWriteStreamRequest`. diff --git a/packages/google-cloud-bigquery-storage/protos/protos.d.ts b/packages/google-cloud-bigquery-storage/protos/protos.d.ts index b111ca1f564..197d0abe8c4 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-storage/protos/protos.d.ts @@ -929,6 +929,9 @@ export namespace google { /** CreateReadSessionRequest maxStreamCount */ maxStreamCount?: (number|null); + + /** CreateReadSessionRequest preferredMinStreamCount */ + preferredMinStreamCount?: (number|null); } /** Represents a CreateReadSessionRequest. */ @@ -949,6 +952,9 @@ export namespace google { /** CreateReadSessionRequest maxStreamCount. */ public maxStreamCount: number; + /** CreateReadSessionRequest preferredMinStreamCount. */ + public preferredMinStreamCount: number; + /** * Creates a new CreateReadSessionRequest instance using the specified properties. * @param [properties] Properties to set @@ -2039,6 +2045,9 @@ export namespace google { /** AppendRowsResponse rowErrors */ rowErrors?: (google.cloud.bigquery.storage.v1.IRowError[]|null); + + /** AppendRowsResponse writeStream */ + writeStream?: (string|null); } /** Represents an AppendRowsResponse. */ @@ -2062,6 +2071,9 @@ export namespace google { /** AppendRowsResponse rowErrors. */ public rowErrors: google.cloud.bigquery.storage.v1.IRowError[]; + /** AppendRowsResponse writeStream. */ + public writeStream: string; + /** AppendRowsResponse response. */ public response?: ("appendResult"|"error"); diff --git a/packages/google-cloud-bigquery-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index ea81e6448f4..32551b9ff33 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/protos/protos.js @@ -1919,6 +1919,7 @@ * @property {string|null} [parent] CreateReadSessionRequest parent * @property {google.cloud.bigquery.storage.v1.IReadSession|null} [readSession] CreateReadSessionRequest readSession * @property {number|null} [maxStreamCount] CreateReadSessionRequest maxStreamCount + * @property {number|null} [preferredMinStreamCount] CreateReadSessionRequest preferredMinStreamCount */ /** @@ -1960,6 +1961,14 @@ */ CreateReadSessionRequest.prototype.maxStreamCount = 0; + /** + * CreateReadSessionRequest preferredMinStreamCount. + * @member {number} preferredMinStreamCount + * @memberof google.cloud.bigquery.storage.v1.CreateReadSessionRequest + * @instance + */ + CreateReadSessionRequest.prototype.preferredMinStreamCount = 0; + /** * Creates a new CreateReadSessionRequest instance using the specified properties. * @function create @@ -1990,6 +1999,8 @@ $root.google.cloud.bigquery.storage.v1.ReadSession.encode(message.readSession, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.maxStreamCount != null && Object.hasOwnProperty.call(message, "maxStreamCount")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxStreamCount); + if (message.preferredMinStreamCount != null && Object.hasOwnProperty.call(message, "preferredMinStreamCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.preferredMinStreamCount); return writer; }; @@ -2033,6 +2044,9 @@ case 3: message.maxStreamCount = reader.int32(); break; + case 4: + message.preferredMinStreamCount = reader.int32(); + break; default: reader.skipType(tag & 7); break; @@ -2079,6 +2093,9 @@ if (message.maxStreamCount != null && message.hasOwnProperty("maxStreamCount")) if (!$util.isInteger(message.maxStreamCount)) return "maxStreamCount: integer expected"; + if (message.preferredMinStreamCount != null && message.hasOwnProperty("preferredMinStreamCount")) + if (!$util.isInteger(message.preferredMinStreamCount)) + return "preferredMinStreamCount: integer expected"; return null; }; @@ -2103,6 +2120,8 @@ } if (object.maxStreamCount != null) message.maxStreamCount = object.maxStreamCount | 0; + if (object.preferredMinStreamCount != null) + message.preferredMinStreamCount = object.preferredMinStreamCount | 0; return message; }; @@ -2123,6 +2142,7 @@ object.parent = ""; object.readSession = null; object.maxStreamCount = 0; + object.preferredMinStreamCount = 0; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; @@ -2130,6 +2150,8 @@ object.readSession = $root.google.cloud.bigquery.storage.v1.ReadSession.toObject(message.readSession, options); if (message.maxStreamCount != null && message.hasOwnProperty("maxStreamCount")) object.maxStreamCount = message.maxStreamCount; + if (message.preferredMinStreamCount != null && message.hasOwnProperty("preferredMinStreamCount")) + object.preferredMinStreamCount = message.preferredMinStreamCount; return object; }; @@ -4533,6 +4555,7 @@ * @property {google.rpc.IStatus|null} [error] AppendRowsResponse error * @property {google.cloud.bigquery.storage.v1.ITableSchema|null} [updatedSchema] AppendRowsResponse updatedSchema * @property {Array.|null} [rowErrors] AppendRowsResponse rowErrors + * @property {string|null} [writeStream] AppendRowsResponse writeStream */ /** @@ -4583,6 +4606,14 @@ */ AppendRowsResponse.prototype.rowErrors = $util.emptyArray; + /** + * AppendRowsResponse writeStream. + * @member {string} writeStream + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse + * @instance + */ + AppendRowsResponse.prototype.writeStream = ""; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -4630,6 +4661,8 @@ if (message.rowErrors != null && message.rowErrors.length) for (var i = 0; i < message.rowErrors.length; ++i) $root.google.cloud.bigquery.storage.v1.RowError.encode(message.rowErrors[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.writeStream != null && Object.hasOwnProperty.call(message, "writeStream")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.writeStream); return writer; }; @@ -4678,6 +4711,9 @@ message.rowErrors = []; message.rowErrors.push($root.google.cloud.bigquery.storage.v1.RowError.decode(reader, reader.uint32())); break; + case 5: + message.writeStream = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -4746,6 +4782,9 @@ return "rowErrors." + error; } } + if (message.writeStream != null && message.hasOwnProperty("writeStream")) + if (!$util.isString(message.writeStream)) + return "writeStream: string expected"; return null; }; @@ -4786,6 +4825,8 @@ message.rowErrors[i] = $root.google.cloud.bigquery.storage.v1.RowError.fromObject(object.rowErrors[i]); } } + if (object.writeStream != null) + message.writeStream = String(object.writeStream); return message; }; @@ -4804,8 +4845,10 @@ var object = {}; if (options.arrays || options.defaults) object.rowErrors = []; - if (options.defaults) + if (options.defaults) { object.updatedSchema = null; + object.writeStream = ""; + } if (message.appendResult != null && message.hasOwnProperty("appendResult")) { object.appendResult = $root.google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult.toObject(message.appendResult, options); if (options.oneofs) @@ -4823,6 +4866,8 @@ for (var j = 0; j < message.rowErrors.length; ++j) object.rowErrors[j] = $root.google.cloud.bigquery.storage.v1.RowError.toObject(message.rowErrors[j], options); } + if (message.writeStream != null && message.hasOwnProperty("writeStream")) + object.writeStream = message.writeStream; return object; }; diff --git a/packages/google-cloud-bigquery-storage/protos/protos.json b/packages/google-cloud-bigquery-storage/protos/protos.json index d796f2c8745..25abbfdca79 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.json +++ b/packages/google-cloud-bigquery-storage/protos/protos.json @@ -309,6 +309,10 @@ "maxStreamCount": { "type": "int32", "id": 3 + }, + "preferredMinStreamCount": { + "type": "int32", + "id": 4 } } }, @@ -528,6 +532,10 @@ "rule": "repeated", "type": "RowError", "id": 4 + }, + "writeStream": { + "type": "string", + "id": 5 } }, "nested": { diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js index c5cc160a217..1f239c8f2e1 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js @@ -46,6 +46,16 @@ function main(parent, readSession) { * it can gracefully handle. */ // const maxStreamCount = 1234 + /** + * The minimum preferred stream count. This parameter can be used to inform + * the service that there is a desired lower bound on the number of streams. + * This is typically a target parallelism of the client (e.g. a Spark + * cluster with N-workers would set this to a low multiple of N to ensure + * good cluster utilization). + * The system will make a best effort to provide at least this number of + * streams, but in some cases might provide less. + */ + // const preferredMinStreamCount = 1234 // Imports the Storage library const {BigQueryReadClient} = require('@google-cloud/bigquery-storage').v1; diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json b/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json index 28d36811dc6..ef8132bd613 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 78, "type": "FULL" } ], @@ -42,6 +42,10 @@ { "name": "max_stream_count", "type": "TYPE_INT32" + }, + { + "name": "preferred_min_stream_count", + "type": "TYPE_INT32" } ], "resultType": ".google.cloud.bigquery.storage.v1.ReadSession", diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index 553fe889849..671bb00f297 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -376,6 +376,15 @@ export class BigQueryReadClient { * Typically, clients should either leave this unset to let the system to * determine an upper bound OR set this a size for the maximum "units of work" * it can gracefully handle. + * @param {number} request.preferredMinStreamCount + * The minimum preferred stream count. This parameter can be used to inform + * the service that there is a desired lower bound on the number of streams. + * This is typically a target parallelism of the client (e.g. a Spark + * cluster with N-workers would set this to a low multiple of N to ensure + * good cluster utilization). + * + * The system will make a best effort to provide at least this number of + * streams, but in some cases might provide less. * @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. From 3b578178b231be39a1c876ed4e8c2a7aa687634d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 18 Aug 2022 08:55:09 -0700 Subject: [PATCH 168/182] feat: allow users to set Apache Avro output format options through avro_serialization_options param in TableReadOptions message (#284) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: allow users to set Apache Avro output format options through avro_serialization_options param in TableReadOptions message Through AvroSerializationOptions, users can set enable_display_name_attribute, which populates displayName for every avro field with the original column name Improved documentation for selected_fields, added example for clarity. PiperOrigin-RevId: 468290142 Source-Link: https://github.com/googleapis/googleapis/commit/62ae1af49c90b68071b098f64189c3ecea125033 Source-Link: https://github.com/googleapis/googleapis-gen/commit/732b7f922477d25328b92359f0667fe95de52fa2 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzMyYjdmOTIyNDc3ZDI1MzI4YjkyMzU5ZjA2NjdmZTk1ZGU1MmZhMiJ9 * 🦉 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 --- .../cloud/bigquery/storage/v1/avro.proto | 15 ++ .../cloud/bigquery/storage/v1/stream.proto | 54 ++++- .../protos/protos.d.ts | 98 +++++++- .../protos/protos.js | 225 +++++++++++++++++- .../protos/protos.json | 18 +- 5 files changed, 402 insertions(+), 8 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/avro.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/avro.proto index 15de2db5468..e1ecb667b61 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/avro.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/avro.proto @@ -39,3 +39,18 @@ message AvroRows { // Please use the format-independent ReadRowsResponse.row_count instead. int64 row_count = 2 [deprecated = true]; } + +// Contains options specific to Avro Serialization. +message AvroSerializationOptions { + // Enable displayName attribute in Avro schema. + // + // The Avro specification requires field names to be alphanumeric. By + // default, in cases when column names do not conform to these requirements + // (e.g. non-ascii unicode codepoints) and Avro is requested as an output + // format, the CreateReadSession call will fail. + // + // Setting this field to true, populates avro field names with a placeholder + // value and populates a "displayName" attribute for every avro field with the + // original column name. + bool enable_display_name_attribute = 1; +} diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto index fd1e25b65fd..3735c73d670 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto @@ -59,10 +59,53 @@ message ReadSession { // Options dictating how we read a table. message TableReadOptions { - // Names of the fields in the table that should be read. If empty, all - // fields will be read. If the specified field is a nested field, all - // the sub-fields in the field will be selected. The output field order is - // unrelated to the order of fields in selected_fields. + // Optional. The names of the fields in the table to be returned. If no + // field names are specified, then all fields in the table are returned. + // + // Nested fields -- the child elements of a STRUCT field -- can be selected + // individually using their fully-qualified names, and will be returned as + // record fields containing only the selected nested fields. If a STRUCT + // field is specified in the selected fields list, all of the child elements + // will be returned. + // + // As an example, consider a table with the following schema: + // + // { + // "name": "struct_field", + // "type": "RECORD", + // "mode": "NULLABLE", + // "fields": [ + // { + // "name": "string_field1", + // "type": "STRING", + // . "mode": "NULLABLE" + // }, + // { + // "name": "string_field2", + // "type": "STRING", + // "mode": "NULLABLE" + // } + // ] + // } + // + // Specifying "struct_field" in the selected fields list will result in a + // read session schema with the following logical structure: + // + // struct_field { + // string_field1 + // string_field2 + // } + // + // Specifying "struct_field.string_field1" in the selected fields list will + // result in a read session schema with the following logical structure: + // + // struct_field { + // string_field1 + // } + // + // The order of the fields in the read session schema is derived from the + // table schema and does not correspond to the order in which the fields are + // specified in this list. repeated string selected_fields = 1; // SQL text filtering statement, similar to a WHERE clause in a query. @@ -80,6 +123,9 @@ message ReadSession { oneof output_format_serialization_options { // Optional. Options specific to the Apache Arrow output format. ArrowSerializationOptions arrow_serialization_options = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Options specific to the Apache Avro output format + AvroSerializationOptions avro_serialization_options = 4 [(google.api.field_behavior) = OPTIONAL]; } } diff --git a/packages/google-cloud-bigquery-storage/protos/protos.d.ts b/packages/google-cloud-bigquery-storage/protos/protos.d.ts index 197d0abe8c4..bb841e4c0d3 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-storage/protos/protos.d.ts @@ -501,6 +501,96 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of an AvroSerializationOptions. */ + interface IAvroSerializationOptions { + + /** AvroSerializationOptions enableDisplayNameAttribute */ + enableDisplayNameAttribute?: (boolean|null); + } + + /** Represents an AvroSerializationOptions. */ + class AvroSerializationOptions implements IAvroSerializationOptions { + + /** + * Constructs a new AvroSerializationOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1.IAvroSerializationOptions); + + /** AvroSerializationOptions enableDisplayNameAttribute. */ + public enableDisplayNameAttribute: boolean; + + /** + * Creates a new AvroSerializationOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns AvroSerializationOptions instance + */ + public static create(properties?: google.cloud.bigquery.storage.v1.IAvroSerializationOptions): google.cloud.bigquery.storage.v1.AvroSerializationOptions; + + /** + * Encodes the specified AvroSerializationOptions message. Does not implicitly {@link google.cloud.bigquery.storage.v1.AvroSerializationOptions.verify|verify} messages. + * @param message AvroSerializationOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.storage.v1.IAvroSerializationOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AvroSerializationOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.AvroSerializationOptions.verify|verify} messages. + * @param message AvroSerializationOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.storage.v1.IAvroSerializationOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AvroSerializationOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AvroSerializationOptions + * @throws {Error} If the payload is not a 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.storage.v1.AvroSerializationOptions; + + /** + * Decodes an AvroSerializationOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AvroSerializationOptions + * @throws {Error} If the payload is 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.storage.v1.AvroSerializationOptions; + + /** + * Verifies an AvroSerializationOptions message. + * @param message Plain 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 AvroSerializationOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AvroSerializationOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.storage.v1.AvroSerializationOptions; + + /** + * Creates a plain object from an AvroSerializationOptions message. Also converts values to other types if specified. + * @param message AvroSerializationOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.storage.v1.AvroSerializationOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AvroSerializationOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a ProtoSchema. */ interface IProtoSchema { @@ -3382,6 +3472,9 @@ export namespace google { /** TableReadOptions arrowSerializationOptions */ arrowSerializationOptions?: (google.cloud.bigquery.storage.v1.IArrowSerializationOptions|null); + + /** TableReadOptions avroSerializationOptions */ + avroSerializationOptions?: (google.cloud.bigquery.storage.v1.IAvroSerializationOptions|null); } /** Represents a TableReadOptions. */ @@ -3402,8 +3495,11 @@ export namespace google { /** TableReadOptions arrowSerializationOptions. */ public arrowSerializationOptions?: (google.cloud.bigquery.storage.v1.IArrowSerializationOptions|null); + /** TableReadOptions avroSerializationOptions. */ + public avroSerializationOptions?: (google.cloud.bigquery.storage.v1.IAvroSerializationOptions|null); + /** TableReadOptions outputFormatSerializationOptions. */ - public outputFormatSerializationOptions?: "arrowSerializationOptions"; + public outputFormatSerializationOptions?: ("arrowSerializationOptions"|"avroSerializationOptions"); /** * Creates a new TableReadOptions instance using the specified properties. diff --git a/packages/google-cloud-bigquery-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index 32551b9ff33..5996556813f 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/protos/protos.js @@ -1145,6 +1145,193 @@ return AvroRows; })(); + v1.AvroSerializationOptions = (function() { + + /** + * Properties of an AvroSerializationOptions. + * @memberof google.cloud.bigquery.storage.v1 + * @interface IAvroSerializationOptions + * @property {boolean|null} [enableDisplayNameAttribute] AvroSerializationOptions enableDisplayNameAttribute + */ + + /** + * Constructs a new AvroSerializationOptions. + * @memberof google.cloud.bigquery.storage.v1 + * @classdesc Represents an AvroSerializationOptions. + * @implements IAvroSerializationOptions + * @constructor + * @param {google.cloud.bigquery.storage.v1.IAvroSerializationOptions=} [properties] Properties to set + */ + function AvroSerializationOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AvroSerializationOptions enableDisplayNameAttribute. + * @member {boolean} enableDisplayNameAttribute + * @memberof google.cloud.bigquery.storage.v1.AvroSerializationOptions + * @instance + */ + AvroSerializationOptions.prototype.enableDisplayNameAttribute = false; + + /** + * Creates a new AvroSerializationOptions instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.storage.v1.AvroSerializationOptions + * @static + * @param {google.cloud.bigquery.storage.v1.IAvroSerializationOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1.AvroSerializationOptions} AvroSerializationOptions instance + */ + AvroSerializationOptions.create = function create(properties) { + return new AvroSerializationOptions(properties); + }; + + /** + * Encodes the specified AvroSerializationOptions message. Does not implicitly {@link google.cloud.bigquery.storage.v1.AvroSerializationOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.storage.v1.AvroSerializationOptions + * @static + * @param {google.cloud.bigquery.storage.v1.IAvroSerializationOptions} message AvroSerializationOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvroSerializationOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableDisplayNameAttribute != null && Object.hasOwnProperty.call(message, "enableDisplayNameAttribute")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableDisplayNameAttribute); + return writer; + }; + + /** + * Encodes the specified AvroSerializationOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1.AvroSerializationOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.storage.v1.AvroSerializationOptions + * @static + * @param {google.cloud.bigquery.storage.v1.IAvroSerializationOptions} message AvroSerializationOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AvroSerializationOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AvroSerializationOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.storage.v1.AvroSerializationOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.storage.v1.AvroSerializationOptions} AvroSerializationOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvroSerializationOptions.decode = function decode(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.storage.v1.AvroSerializationOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enableDisplayNameAttribute = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AvroSerializationOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.storage.v1.AvroSerializationOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.storage.v1.AvroSerializationOptions} AvroSerializationOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AvroSerializationOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AvroSerializationOptions message. + * @function verify + * @memberof google.cloud.bigquery.storage.v1.AvroSerializationOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AvroSerializationOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableDisplayNameAttribute != null && message.hasOwnProperty("enableDisplayNameAttribute")) + if (typeof message.enableDisplayNameAttribute !== "boolean") + return "enableDisplayNameAttribute: boolean expected"; + return null; + }; + + /** + * Creates an AvroSerializationOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.storage.v1.AvroSerializationOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.storage.v1.AvroSerializationOptions} AvroSerializationOptions + */ + AvroSerializationOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.storage.v1.AvroSerializationOptions) + return object; + var message = new $root.google.cloud.bigquery.storage.v1.AvroSerializationOptions(); + if (object.enableDisplayNameAttribute != null) + message.enableDisplayNameAttribute = Boolean(object.enableDisplayNameAttribute); + return message; + }; + + /** + * Creates a plain object from an AvroSerializationOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.storage.v1.AvroSerializationOptions + * @static + * @param {google.cloud.bigquery.storage.v1.AvroSerializationOptions} message AvroSerializationOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AvroSerializationOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enableDisplayNameAttribute = false; + if (message.enableDisplayNameAttribute != null && message.hasOwnProperty("enableDisplayNameAttribute")) + object.enableDisplayNameAttribute = message.enableDisplayNameAttribute; + return object; + }; + + /** + * Converts this AvroSerializationOptions to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.storage.v1.AvroSerializationOptions + * @instance + * @returns {Object.} JSON object + */ + AvroSerializationOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AvroSerializationOptions; + })(); + v1.ProtoSchema = (function() { /** @@ -7846,6 +8033,7 @@ * @property {Array.|null} [selectedFields] TableReadOptions selectedFields * @property {string|null} [rowRestriction] TableReadOptions rowRestriction * @property {google.cloud.bigquery.storage.v1.IArrowSerializationOptions|null} [arrowSerializationOptions] TableReadOptions arrowSerializationOptions + * @property {google.cloud.bigquery.storage.v1.IAvroSerializationOptions|null} [avroSerializationOptions] TableReadOptions avroSerializationOptions */ /** @@ -7888,17 +8076,25 @@ */ TableReadOptions.prototype.arrowSerializationOptions = null; + /** + * TableReadOptions avroSerializationOptions. + * @member {google.cloud.bigquery.storage.v1.IAvroSerializationOptions|null|undefined} avroSerializationOptions + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @instance + */ + TableReadOptions.prototype.avroSerializationOptions = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * TableReadOptions outputFormatSerializationOptions. - * @member {"arrowSerializationOptions"|undefined} outputFormatSerializationOptions + * @member {"arrowSerializationOptions"|"avroSerializationOptions"|undefined} outputFormatSerializationOptions * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions * @instance */ Object.defineProperty(TableReadOptions.prototype, "outputFormatSerializationOptions", { - get: $util.oneOfGetter($oneOfFields = ["arrowSerializationOptions"]), + get: $util.oneOfGetter($oneOfFields = ["arrowSerializationOptions", "avroSerializationOptions"]), set: $util.oneOfSetter($oneOfFields) }); @@ -7933,6 +8129,8 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.rowRestriction); if (message.arrowSerializationOptions != null && Object.hasOwnProperty.call(message, "arrowSerializationOptions")) $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.encode(message.arrowSerializationOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.avroSerializationOptions != null && Object.hasOwnProperty.call(message, "avroSerializationOptions")) + $root.google.cloud.bigquery.storage.v1.AvroSerializationOptions.encode(message.avroSerializationOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -7978,6 +8176,9 @@ case 3: message.arrowSerializationOptions = $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.decode(reader, reader.uint32()); break; + case 4: + message.avroSerializationOptions = $root.google.cloud.bigquery.storage.v1.AvroSerializationOptions.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -8032,6 +8233,16 @@ return "arrowSerializationOptions." + error; } } + if (message.avroSerializationOptions != null && message.hasOwnProperty("avroSerializationOptions")) { + if (properties.outputFormatSerializationOptions === 1) + return "outputFormatSerializationOptions: multiple values"; + properties.outputFormatSerializationOptions = 1; + { + var error = $root.google.cloud.bigquery.storage.v1.AvroSerializationOptions.verify(message.avroSerializationOptions); + if (error) + return "avroSerializationOptions." + error; + } + } return null; }; @@ -8061,6 +8272,11 @@ throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.arrowSerializationOptions: object expected"); message.arrowSerializationOptions = $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.fromObject(object.arrowSerializationOptions); } + if (object.avroSerializationOptions != null) { + if (typeof object.avroSerializationOptions !== "object") + throw TypeError(".google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.avroSerializationOptions: object expected"); + message.avroSerializationOptions = $root.google.cloud.bigquery.storage.v1.AvroSerializationOptions.fromObject(object.avroSerializationOptions); + } return message; }; @@ -8093,6 +8309,11 @@ if (options.oneofs) object.outputFormatSerializationOptions = "arrowSerializationOptions"; } + if (message.avroSerializationOptions != null && message.hasOwnProperty("avroSerializationOptions")) { + object.avroSerializationOptions = $root.google.cloud.bigquery.storage.v1.AvroSerializationOptions.toObject(message.avroSerializationOptions, options); + if (options.oneofs) + object.outputFormatSerializationOptions = "avroSerializationOptions"; + } return object; }; diff --git a/packages/google-cloud-bigquery-storage/protos/protos.json b/packages/google-cloud-bigquery-storage/protos/protos.json index 25abbfdca79..389ea6f3f92 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.json +++ b/packages/google-cloud-bigquery-storage/protos/protos.json @@ -83,6 +83,14 @@ } } }, + "AvroSerializationOptions": { + "fields": { + "enableDisplayNameAttribute": { + "type": "bool", + "id": 1 + } + } + }, "ProtoSchema": { "fields": { "protoDescriptor": { @@ -808,7 +816,8 @@ "oneofs": { "outputFormatSerializationOptions": { "oneof": [ - "arrowSerializationOptions" + "arrowSerializationOptions", + "avroSerializationOptions" ] } }, @@ -828,6 +837,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "avroSerializationOptions": { + "type": "AvroSerializationOptions", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } } From a2b19dc071c12478c3f078021c0c4b9ad4203d48 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 19 Aug 2022 20:24:14 +0000 Subject: [PATCH 169/182] chore: remove unused proto imports (#286) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 468735472 Source-Link: https://github.com/googleapis/googleapis/commit/cfa1b3782da7ccae31673d45401a0b79d2d4a84b Source-Link: https://github.com/googleapis/googleapis-gen/commit/09b7666656510f5b00b893f003a0ba5766f9e250 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDliNzY2NjY1NjUxMGY1YjAwYjg5M2YwMDNhMGJhNTc2NmY5ZTI1MCJ9 --- .../google/cloud/bigquery/storage/v1beta1/table_reference.proto | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/table_reference.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/table_reference.proto index 4269392f676..22c940c0e6b 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/table_reference.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1beta1/table_reference.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.cloud.bigquery.storage.v1beta1; -import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta1;storage"; From 2d291082c32caf7169fa586c801939beeb28d7da Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 00:04:16 +0000 Subject: [PATCH 170/182] fix: better support for fallback mode (#287) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 468790263 Source-Link: https://github.com/googleapis/googleapis/commit/873ab456273d105245df0fb82a6c17a814553b80 Source-Link: https://github.com/googleapis/googleapis-gen/commit/cb6f37aeff2a3472e40a7bbace8c67d75e24bee5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2I2ZjM3YWVmZjJhMzQ3MmU0MGE3YmJhY2U4YzY3ZDc1ZTI0YmVlNSJ9 --- .../v1/big_query_read.create_read_session.js | 3 + .../generated/v1/big_query_read.read_rows.js | 3 + .../v1/big_query_read.split_read_stream.js | 3 + .../v1/big_query_write.append_rows.js | 3 + ..._query_write.batch_commit_write_streams.js | 3 + .../v1/big_query_write.create_write_stream.js | 3 + .../big_query_write.finalize_write_stream.js | 3 + .../v1/big_query_write.flush_rows.js | 3 + .../v1/big_query_write.get_write_stream.js | 3 + ...data.google.cloud.bigquery.storage.v1.json | 18 +- ...orage.batch_create_read_session_streams.js | 3 + .../big_query_storage.create_read_session.js | 3 + .../big_query_storage.finalize_stream.js | 3 + .../v1beta1/big_query_storage.read_rows.js | 3 + .../big_query_storage.split_read_stream.js | 3 + ...google.cloud.bigquery.storage.v1beta1.json | 10 +- .../src/v1/big_query_read_client.ts | 3 +- .../src/v1/big_query_write_client.ts | 3 +- .../src/v1beta1/big_query_storage_client.ts | 3 +- .../test/gapic_big_query_read_v1.ts | 156 ++++++++--------- .../test/gapic_big_query_storage_v1beta1.ts | 160 +++++++++--------- .../test/gapic_big_query_write_v1.ts | 158 ++++++++--------- 22 files changed, 303 insertions(+), 250 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js index 1f239c8f2e1..6cbaf38dcdf 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.create_read_session.js @@ -23,6 +23,9 @@ function main(parent, readSession) { // [START bigquerystorage_v1_generated_BigQueryRead_CreateReadSession_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-storage/samples/generated/v1/big_query_read.read_rows.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.read_rows.js index f5f781a46b8..30bea092495 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.read_rows.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.read_rows.js @@ -23,6 +23,9 @@ function main(readStream) { // [START bigquerystorage_v1_generated_BigQueryRead_ReadRows_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-storage/samples/generated/v1/big_query_read.split_read_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.split_read_stream.js index 6e146955b95..a7d2a761348 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.split_read_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_read.split_read_stream.js @@ -23,6 +23,9 @@ function main(name) { // [START bigquerystorage_v1_generated_BigQueryRead_SplitReadStream_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-storage/samples/generated/v1/big_query_write.append_rows.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.append_rows.js index 9cefbb22166..24764fa1010 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.append_rows.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.append_rows.js @@ -23,6 +23,9 @@ function main(writeStream) { // [START bigquerystorage_v1_generated_BigQueryWrite_AppendRows_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-storage/samples/generated/v1/big_query_write.batch_commit_write_streams.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.batch_commit_write_streams.js index 9c258a30082..90cdefc4f94 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.batch_commit_write_streams.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.batch_commit_write_streams.js @@ -23,6 +23,9 @@ function main(parent, writeStreams) { // [START bigquerystorage_v1_generated_BigQueryWrite_BatchCommitWriteStreams_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-storage/samples/generated/v1/big_query_write.create_write_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.create_write_stream.js index 839a8bf6628..e67550626ab 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.create_write_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.create_write_stream.js @@ -23,6 +23,9 @@ function main(parent, writeStream) { // [START bigquerystorage_v1_generated_BigQueryWrite_CreateWriteStream_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-storage/samples/generated/v1/big_query_write.finalize_write_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.finalize_write_stream.js index 3ff3da7adc8..85faa908822 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.finalize_write_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.finalize_write_stream.js @@ -23,6 +23,9 @@ function main(name) { // [START bigquerystorage_v1_generated_BigQueryWrite_FinalizeWriteStream_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-storage/samples/generated/v1/big_query_write.flush_rows.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.flush_rows.js index 751fdebf6e0..ae6e56be382 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.flush_rows.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.flush_rows.js @@ -23,6 +23,9 @@ function main(writeStream) { // [START bigquerystorage_v1_generated_BigQueryWrite_FlushRows_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-storage/samples/generated/v1/big_query_write.get_write_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.get_write_stream.js index 1650750820f..2d83ddbe23b 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.get_write_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.get_write_stream.js @@ -23,6 +23,9 @@ function main(name) { // [START bigquerystorage_v1_generated_BigQueryWrite_GetWriteStream_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-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json b/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json index ef8132bd613..1036b356fbb 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 78, + "end": 81, "type": "FULL" } ], @@ -74,7 +74,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 61, "type": "FULL" } ], @@ -118,7 +118,7 @@ "segments": [ { "start": 25, - "end": 60, + "end": 63, "type": "FULL" } ], @@ -162,7 +162,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -206,7 +206,7 @@ "segments": [ { "start": 25, - "end": 77, + "end": 80, "type": "FULL" } ], @@ -258,7 +258,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -298,7 +298,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -338,7 +338,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -382,7 +382,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.batch_create_read_session_streams.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.batch_create_read_session_streams.js index 3d7b6d3e429..dd1d96f46b4 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.batch_create_read_session_streams.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.batch_create_read_session_streams.js @@ -23,6 +23,9 @@ function main(session, requestedStreams) { // [START bigquerystorage_v1beta1_generated_BigQueryStorage_BatchCreateReadSessionStreams_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-storage/samples/generated/v1beta1/big_query_storage.create_read_session.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.create_read_session.js index c71a464ce5d..3bf8d5ab0df 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.create_read_session.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.create_read_session.js @@ -23,6 +23,9 @@ function main(tableReference, parent) { // [START bigquerystorage_v1beta1_generated_BigQueryStorage_CreateReadSession_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-storage/samples/generated/v1beta1/big_query_storage.finalize_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.finalize_stream.js index 51d63d0bb69..274b957673b 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.finalize_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.finalize_stream.js @@ -23,6 +23,9 @@ function main(stream) { // [START bigquerystorage_v1beta1_generated_BigQueryStorage_FinalizeStream_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-storage/samples/generated/v1beta1/big_query_storage.read_rows.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.read_rows.js index 65924b1746b..27981cfa6a3 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.read_rows.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.read_rows.js @@ -23,6 +23,9 @@ function main(readPosition) { // [START bigquerystorage_v1beta1_generated_BigQueryStorage_ReadRows_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-storage/samples/generated/v1beta1/big_query_storage.split_read_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.split_read_stream.js index 24ae597d43a..79c048a8427 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.split_read_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/big_query_storage.split_read_stream.js @@ -23,6 +23,9 @@ function main(originalStream) { // [START bigquerystorage_v1beta1_generated_BigQueryStorage_SplitReadStream_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-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json index 58ffbbc5164..ac58a9c66c9 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 83, + "end": 86, "type": "FULL" } ], @@ -86,7 +86,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 57, "type": "FULL" } ], @@ -126,7 +126,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 61, "type": "FULL" } ], @@ -170,7 +170,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -210,7 +210,7 @@ "segments": [ { "start": 25, - "end": 60, + "end": 63, "type": "FULL" } ], diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index 671bb00f297..81c81a81d68 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -272,7 +272,8 @@ export class BigQueryReadClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts index 1e0569e1f7e..02021a6bd26 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts @@ -278,7 +278,8 @@ export class BigQueryWriteClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index e1c27a9e683..a6a6d6c9596 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -269,7 +269,8 @@ export class BigQueryStorageClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts index 793ecd88c3e..18113a85423 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts @@ -73,99 +73,101 @@ function stubServerStreamingCall( } describe('v1.BigQueryReadClient', () => { - it('has servicePath', () => { - const servicePath = bigqueryreadModule.v1.BigQueryReadClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = bigqueryreadModule.v1.BigQueryReadClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = bigqueryreadModule.v1.BigQueryReadClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new bigqueryreadModule.v1.BigQueryReadClient(); - assert(client); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = bigqueryreadModule.v1.BigQueryReadClient.servicePath; + assert(servicePath); + }); - it('should create a client with gRPC fallback', () => { - const client = new bigqueryreadModule.v1.BigQueryReadClient({ - fallback: true, + it('has apiEndpoint', () => { + const apiEndpoint = bigqueryreadModule.v1.BigQueryReadClient.apiEndpoint; + assert(apiEndpoint); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new bigqueryreadModule.v1.BigQueryReadClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has port', () => { + const port = bigqueryreadModule.v1.BigQueryReadClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert.strictEqual(client.bigQueryReadStub, undefined); - await client.initialize(); - assert(client.bigQueryReadStub); - }); - it('has close method for the initialized client', done => { - const client = new bigqueryreadModule.v1.BigQueryReadClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new bigqueryreadModule.v1.BigQueryReadClient(); + assert(client); }); - client.initialize(); - assert(client.bigQueryReadStub); - client.close().then(() => { - done(); + + it('should create a client with gRPC fallback', () => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + fallback: true, + }); + assert(client); }); - }); - it('has close method for the non-initialized client', done => { - const client = new bigqueryreadModule.v1.BigQueryReadClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has initialize method and supports deferred initialization', async () => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.bigQueryReadStub, undefined); + await client.initialize(); + assert(client.bigQueryReadStub); }); - assert.strictEqual(client.bigQueryReadStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the initialized client', done => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.bigQueryReadStub); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new bigqueryreadModule.v1.BigQueryReadClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.bigQueryReadStub, 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 bigqueryreadModule.v1.BigQueryReadClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new bigqueryreadModule.v1.BigQueryReadClient({ + 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 bigqueryreadModule.v1.BigQueryReadClient({ + 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('createReadSession', () => { diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts index 005e54894e1..7e38e445bce 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts @@ -73,101 +73,103 @@ function stubServerStreamingCall( } describe('v1beta1.BigQueryStorageClient', () => { - it('has servicePath', () => { - const servicePath = - bigquerystorageModule.v1beta1.BigQueryStorageClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - bigquerystorageModule.v1beta1.BigQueryStorageClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = bigquerystorageModule.v1beta1.BigQueryStorageClient.port; - assert(port); - assert(typeof port === 'number'); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + bigquerystorageModule.v1beta1.BigQueryStorageClient.servicePath; + assert(servicePath); + }); - it('should create a client with no option', () => { - const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient(); - assert(client); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + bigquerystorageModule.v1beta1.BigQueryStorageClient.apiEndpoint; + assert(apiEndpoint); + }); - it('should create a client with gRPC fallback', () => { - const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ - fallback: true, + it('has port', () => { + const port = bigquerystorageModule.v1beta1.BigQueryStorageClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient(); + assert(client); }); - assert.strictEqual(client.bigQueryStorageStub, undefined); - await client.initialize(); - assert(client.bigQueryStorageStub); - }); - it('has close method for the initialized client', done => { - const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with gRPC fallback', () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + fallback: true, + }); + assert(client); }); - client.initialize(); - assert(client.bigQueryStorageStub); - client.close().then(() => { - done(); + + it('has initialize method and supports deferred initialization', async () => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.bigQueryStorageStub, undefined); + await client.initialize(); + assert(client.bigQueryStorageStub); }); - }); - it('has close method for the non-initialized client', done => { - const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.bigQueryStorageStub); + client.close().then(() => { + done(); + }); }); - assert.strictEqual(client.bigQueryStorageStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the non-initialized client', done => { + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.bigQueryStorageStub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({ + 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('createReadSession', () => { diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_write_v1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_write_v1.ts index 44fdb98de72..c27c4dfd91f 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_write_v1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_write_v1.ts @@ -66,99 +66,103 @@ function stubBidiStreamingCall( } describe('v1.BigQueryWriteClient', () => { - it('has servicePath', () => { - const servicePath = bigquerywriteModule.v1.BigQueryWriteClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = bigquerywriteModule.v1.BigQueryWriteClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = bigquerywriteModule.v1.BigQueryWriteClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new bigquerywriteModule.v1.BigQueryWriteClient(); - assert(client); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + bigquerywriteModule.v1.BigQueryWriteClient.servicePath; + assert(servicePath); + }); - it('should create a client with gRPC fallback', () => { - const client = new bigquerywriteModule.v1.BigQueryWriteClient({ - fallback: true, + it('has apiEndpoint', () => { + const apiEndpoint = + bigquerywriteModule.v1.BigQueryWriteClient.apiEndpoint; + assert(apiEndpoint); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new bigquerywriteModule.v1.BigQueryWriteClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has port', () => { + const port = bigquerywriteModule.v1.BigQueryWriteClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert.strictEqual(client.bigQueryWriteStub, undefined); - await client.initialize(); - assert(client.bigQueryWriteStub); - }); - it('has close method for the initialized client', done => { - const client = new bigquerywriteModule.v1.BigQueryWriteClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient(); + assert(client); }); - client.initialize(); - assert(client.bigQueryWriteStub); - client.close().then(() => { - done(); + + it('should create a client with gRPC fallback', () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + fallback: true, + }); + assert(client); }); - }); - it('has close method for the non-initialized client', done => { - const client = new bigquerywriteModule.v1.BigQueryWriteClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has initialize method and supports deferred initialization', async () => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.bigQueryWriteStub, undefined); + await client.initialize(); + assert(client.bigQueryWriteStub); }); - assert.strictEqual(client.bigQueryWriteStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the initialized client', done => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.bigQueryWriteStub); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new bigquerywriteModule.v1.BigQueryWriteClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.bigQueryWriteStub, 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 bigquerywriteModule.v1.BigQueryWriteClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new bigquerywriteModule.v1.BigQueryWriteClient({ + 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 bigquerywriteModule.v1.BigQueryWriteClient({ + 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('createWriteStream', () => { From d79ca981e69bb65197768557e9f8fabdc9de6330 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:38:17 +0000 Subject: [PATCH 171/182] fix: change import long to require (#289) 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 | 779 ++- .../protos/protos.js | 4194 ++++++++++++----- .../protos/protos.json | 24 + 3 files changed, 3867 insertions(+), 1130 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/protos/protos.d.ts b/packages/google-cloud-bigquery-storage/protos/protos.d.ts index bb841e4c0d3..2cfa3409b32 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-storage/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 { @@ -117,6 +117,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ArrowSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an ArrowRecordBatch. */ @@ -213,6 +220,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ArrowRecordBatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an ArrowSerializationOptions. */ @@ -303,6 +317,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ArrowSerializationOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ArrowSerializationOptions { @@ -403,6 +424,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AvroSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an AvroRows. */ @@ -499,6 +527,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AvroRows + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an AvroSerializationOptions. */ @@ -589,6 +624,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AvroSerializationOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ProtoSchema. */ @@ -679,6 +721,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProtoSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ProtoRows. */ @@ -769,6 +818,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProtoRows + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Represents a BigQueryRead */ @@ -837,21 +893,21 @@ export namespace google { namespace BigQueryRead { /** - * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryRead#createReadSession}. + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryRead|createReadSession}. * @param error Error, if any * @param [response] ReadSession */ type CreateReadSessionCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1.ReadSession) => void; /** - * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryRead#readRows}. + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryRead|readRows}. * @param error Error, if any * @param [response] ReadRowsResponse */ type ReadRowsCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1.ReadRowsResponse) => void; /** - * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryRead#splitReadStream}. + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryRead|splitReadStream}. * @param error Error, if any * @param [response] SplitReadStreamResponse */ @@ -966,42 +1022,42 @@ export namespace google { namespace BigQueryWrite { /** - * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#createWriteStream}. + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite|createWriteStream}. * @param error Error, if any * @param [response] WriteStream */ type CreateWriteStreamCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1.WriteStream) => void; /** - * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#appendRows}. + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite|appendRows}. * @param error Error, if any * @param [response] AppendRowsResponse */ type AppendRowsCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1.AppendRowsResponse) => void; /** - * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#getWriteStream}. + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite|getWriteStream}. * @param error Error, if any * @param [response] WriteStream */ type GetWriteStreamCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1.WriteStream) => void; /** - * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#finalizeWriteStream}. + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite|finalizeWriteStream}. * @param error Error, if any * @param [response] FinalizeWriteStreamResponse */ type FinalizeWriteStreamCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse) => void; /** - * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#batchCommitWriteStreams}. + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite|batchCommitWriteStreams}. * @param error Error, if any * @param [response] BatchCommitWriteStreamsResponse */ type BatchCommitWriteStreamsCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse) => void; /** - * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#flushRows}. + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite|flushRows}. * @param error Error, if any * @param [response] FlushRowsResponse */ @@ -1114,6 +1170,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateReadSessionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ReadRowsRequest. */ @@ -1210,6 +1273,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadRowsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ThrottleState. */ @@ -1300,6 +1370,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ThrottleState + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a StreamStats. */ @@ -1390,6 +1467,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamStats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace StreamStats { @@ -1488,6 +1572,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Progress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -1621,6 +1712,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadRowsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SplitReadStreamRequest. */ @@ -1717,6 +1815,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SplitReadStreamRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SplitReadStreamResponse. */ @@ -1813,6 +1918,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SplitReadStreamResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CreateWriteStreamRequest. */ @@ -1909,6 +2021,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateWriteStreamRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an AppendRowsRequest. */ @@ -2020,6 +2139,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AppendRowsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace AppendRowsRequest { @@ -2118,6 +2244,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProtoData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -2236,6 +2369,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AppendRowsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace AppendRowsResponse { @@ -2328,6 +2468,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AppendResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -2419,6 +2566,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetWriteStreamRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BatchCommitWriteStreamsRequest. */ @@ -2515,6 +2669,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCommitWriteStreamsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BatchCommitWriteStreamsResponse. */ @@ -2611,6 +2772,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCommitWriteStreamsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a FinalizeWriteStreamRequest. */ @@ -2701,6 +2869,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FinalizeWriteStreamRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a FinalizeWriteStreamResponse. */ @@ -2791,6 +2966,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FinalizeWriteStreamResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a FlushRowsRequest. */ @@ -2887,6 +3069,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FlushRowsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a FlushRowsResponse. */ @@ -2977,6 +3166,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FlushRowsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a StorageError. */ @@ -3079,6 +3275,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StorageError + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace StorageError { @@ -3198,6 +3401,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RowError + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace RowError { @@ -3367,6 +3577,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadSession + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ReadSession { @@ -3459,6 +3676,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableModifiers + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a TableReadOptions. */ @@ -3570,6 +3794,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableReadOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -3661,6 +3892,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadStream + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a WriteStream. */ @@ -3781,6 +4019,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WriteStream + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace WriteStream { @@ -3888,6 +4133,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a TableFieldSchema. */ @@ -4020,6 +4272,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableFieldSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace TableFieldSchema { @@ -4145,6 +4404,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ArrowSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an ArrowRecordBatch. */ @@ -4241,6 +4507,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ArrowRecordBatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an AvroSchema. */ @@ -4331,6 +4604,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AvroSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an AvroRows. */ @@ -4427,6 +4707,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AvroRows + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a TableReadOptions. */ @@ -4523,6 +4810,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableReadOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Represents a BigQueryStorage */ @@ -4619,35 +4913,35 @@ export namespace google { namespace BigQueryStorage { /** - * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#createReadSession}. + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage|createReadSession}. * @param error Error, if any * @param [response] ReadSession */ type CreateReadSessionCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1beta1.ReadSession) => void; /** - * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#readRows}. + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage|readRows}. * @param error Error, if any * @param [response] ReadRowsResponse */ type ReadRowsCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1beta1.ReadRowsResponse) => void; /** - * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#batchCreateReadSessionStreams}. + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage|batchCreateReadSessionStreams}. * @param error Error, if any * @param [response] BatchCreateReadSessionStreamsResponse */ type BatchCreateReadSessionStreamsCallback = (error: (Error|null), response?: google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse) => void; /** - * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#finalizeStream}. + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage|finalizeStream}. * @param error Error, if any * @param [response] Empty */ type FinalizeStreamCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#splitReadStream}. + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage|splitReadStream}. * @param error Error, if any * @param [response] SplitReadStreamResponse */ @@ -4742,6 +5036,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Stream + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a StreamPosition. */ @@ -4838,6 +5139,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamPosition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ReadSession. */ @@ -4973,6 +5281,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadSession + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CreateReadSessionRequest. */ @@ -5099,6 +5414,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateReadSessionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** DataFormat enum. */ @@ -5203,6 +5525,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadRowsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a StreamStatus. */ @@ -5311,6 +5640,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Progress. */ @@ -5407,6 +5743,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Progress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ThrottleStatus. */ @@ -5497,6 +5840,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ThrottleStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ReadRowsResponse. */ @@ -5614,6 +5964,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadRowsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BatchCreateReadSessionStreamsRequest. */ @@ -5710,6 +6067,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateReadSessionStreamsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BatchCreateReadSessionStreamsResponse. */ @@ -5800,6 +6164,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateReadSessionStreamsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a FinalizeStreamRequest. */ @@ -5890,6 +6261,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FinalizeStreamRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SplitReadStreamRequest. */ @@ -5986,6 +6364,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SplitReadStreamRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SplitReadStreamResponse. */ @@ -6082,6 +6467,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SplitReadStreamResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a TableReference. */ @@ -6184,6 +6576,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 TableModifiers. */ @@ -6274,6 +6673,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableModifiers + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } @@ -6371,6 +6777,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. */ @@ -6411,6 +6824,9 @@ export namespace google { /** FileDescriptorProto syntax */ syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); } /** Represents a FileDescriptorProto. */ @@ -6458,6 +6874,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 @@ -6527,6 +6946,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. */ @@ -6671,6 +7097,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 { @@ -6775,6 +7208,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. */ @@ -6871,6 +7311,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; } } @@ -6962,6 +7409,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. */ @@ -7112,6 +7566,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 { @@ -7240,6 +7701,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. */ @@ -7354,6 +7822,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 { @@ -7452,6 +7927,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; } } @@ -7555,6 +8037,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. */ @@ -7657,6 +8146,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. */ @@ -7777,6 +8273,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. */ @@ -7990,6 +8493,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 { @@ -8117,6 +8627,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. */ @@ -8134,6 +8651,9 @@ export namespace google { /** FieldOptions lazy */ lazy?: (boolean|null); + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + /** FieldOptions deprecated */ deprecated?: (boolean|null); @@ -8171,6 +8691,9 @@ export namespace google { /** FieldOptions lazy. */ public lazy: boolean; + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + /** FieldOptions deprecated. */ public deprecated: boolean; @@ -8249,6 +8772,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 { @@ -8356,6 +8886,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. */ @@ -8458,6 +8995,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. */ @@ -8554,6 +9098,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. */ @@ -8656,6 +9207,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. */ @@ -8764,6 +9322,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 { @@ -8900,6 +9465,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 { @@ -8998,6 +9570,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; } } @@ -9089,6 +9668,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 { @@ -9205,6 +9791,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; } } @@ -9296,6 +9889,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 { @@ -9314,6 +9914,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. */ @@ -9337,6 +9940,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 @@ -9406,6 +10012,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 + } } } @@ -9503,6 +10126,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DoubleValue. */ @@ -9593,6 +10223,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a FloatValue. */ @@ -9683,6 +10320,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Int64Value. */ @@ -9773,6 +10417,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a UInt64Value. */ @@ -9863,6 +10514,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Int32Value. */ @@ -9953,6 +10611,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a UInt32Value. */ @@ -10043,6 +10708,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BoolValue. */ @@ -10133,6 +10805,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a StringValue. */ @@ -10223,6 +10902,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BytesValue. */ @@ -10313,6 +10999,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Any. */ @@ -10409,6 +11102,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Empty. */ @@ -10493,6 +11193,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; } } @@ -10593,6 +11300,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. */ @@ -10740,6 +11454,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. */ @@ -10836,6 +11557,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. */ @@ -10974,6 +11702,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 { @@ -11086,6 +11821,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; } } @@ -11192,6 +11934,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-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index 5996556813f..542a50d85f2 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/protos/protos.js @@ -167,9 +167,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.serializedSchema = reader.bytes(); - break; + case 1: { + message.serializedSchema = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -226,7 +227,7 @@ if (object.serializedSchema != null) if (typeof object.serializedSchema === "string") $util.base64.decode(object.serializedSchema, message.serializedSchema = $util.newBuffer($util.base64.length(object.serializedSchema)), 0); - else if (object.serializedSchema.length) + else if (object.serializedSchema.length >= 0) message.serializedSchema = object.serializedSchema; return message; }; @@ -268,6 +269,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ArrowSchema + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.ArrowSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArrowSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.ArrowSchema"; + }; + return ArrowSchema; })(); @@ -374,12 +390,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.serializedRecordBatch = reader.bytes(); - break; - case 2: - message.rowCount = reader.int64(); - break; + case 1: { + message.serializedRecordBatch = reader.bytes(); + break; + } + case 2: { + message.rowCount = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -439,7 +457,7 @@ if (object.serializedRecordBatch != null) if (typeof object.serializedRecordBatch === "string") $util.base64.decode(object.serializedRecordBatch, message.serializedRecordBatch = $util.newBuffer($util.base64.length(object.serializedRecordBatch)), 0); - else if (object.serializedRecordBatch.length) + else if (object.serializedRecordBatch.length >= 0) message.serializedRecordBatch = object.serializedRecordBatch; if (object.rowCount != null) if ($util.Long) @@ -501,6 +519,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ArrowRecordBatch + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.ArrowRecordBatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArrowRecordBatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.ArrowRecordBatch"; + }; + return ArrowRecordBatch; })(); @@ -596,9 +629,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - message.bufferCompression = reader.int32(); - break; + case 2: { + message.bufferCompression = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -706,6 +740,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ArrowSerializationOptions + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.ArrowSerializationOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArrowSerializationOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.ArrowSerializationOptions"; + }; + /** * CompressionCodec enum. * @name google.cloud.bigquery.storage.v1.ArrowSerializationOptions.CompressionCodec @@ -817,9 +866,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.schema = reader.string(); - break; + case 1: { + message.schema = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -909,6 +959,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AvroSchema + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.AvroSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AvroSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.AvroSchema"; + }; + return AvroSchema; })(); @@ -1015,12 +1080,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.serializedBinaryRows = reader.bytes(); - break; - case 2: - message.rowCount = reader.int64(); - break; + case 1: { + message.serializedBinaryRows = reader.bytes(); + break; + } + case 2: { + message.rowCount = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -1080,7 +1147,7 @@ if (object.serializedBinaryRows != null) if (typeof object.serializedBinaryRows === "string") $util.base64.decode(object.serializedBinaryRows, message.serializedBinaryRows = $util.newBuffer($util.base64.length(object.serializedBinaryRows)), 0); - else if (object.serializedBinaryRows.length) + else if (object.serializedBinaryRows.length >= 0) message.serializedBinaryRows = object.serializedBinaryRows; if (object.rowCount != null) if ($util.Long) @@ -1142,6 +1209,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AvroRows + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.AvroRows + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AvroRows.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.AvroRows"; + }; + return AvroRows; })(); @@ -1237,9 +1319,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.enableDisplayNameAttribute = reader.bool(); - break; + case 1: { + message.enableDisplayNameAttribute = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -1329,6 +1412,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AvroSerializationOptions + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.AvroSerializationOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AvroSerializationOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.AvroSerializationOptions"; + }; + return AvroSerializationOptions; })(); @@ -1424,9 +1522,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.protoDescriptor = $root.google.protobuf.DescriptorProto.decode(reader, reader.uint32()); - break; + case 1: { + message.protoDescriptor = $root.google.protobuf.DescriptorProto.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -1521,6 +1620,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ProtoSchema + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.ProtoSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProtoSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.ProtoSchema"; + }; + return ProtoSchema; })(); @@ -1618,11 +1732,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.serializedRows && message.serializedRows.length)) - message.serializedRows = []; - message.serializedRows.push(reader.bytes()); - break; + case 1: { + if (!(message.serializedRows && message.serializedRows.length)) + message.serializedRows = []; + message.serializedRows.push(reader.bytes()); + break; + } default: reader.skipType(tag & 7); break; @@ -1687,7 +1802,7 @@ for (var i = 0; i < object.serializedRows.length; ++i) if (typeof object.serializedRows[i] === "string") $util.base64.decode(object.serializedRows[i], message.serializedRows[i] = $util.newBuffer($util.base64.length(object.serializedRows[i])), 0); - else if (object.serializedRows[i].length) + else if (object.serializedRows[i].length >= 0) message.serializedRows[i] = object.serializedRows[i]; } return message; @@ -1727,6 +1842,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ProtoRows + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.ProtoRows + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProtoRows.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.ProtoRows"; + }; + return ProtoRows; })(); @@ -1763,7 +1893,7 @@ }; /** - * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryRead#createReadSession}. + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryRead|createReadSession}. * @memberof google.cloud.bigquery.storage.v1.BigQueryRead * @typedef CreateReadSessionCallback * @type {function} @@ -1796,7 +1926,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryRead#readRows}. + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryRead|readRows}. * @memberof google.cloud.bigquery.storage.v1.BigQueryRead * @typedef ReadRowsCallback * @type {function} @@ -1829,7 +1959,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryRead#splitReadStream}. + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryRead|splitReadStream}. * @memberof google.cloud.bigquery.storage.v1.BigQueryRead * @typedef SplitReadStreamCallback * @type {function} @@ -1897,7 +2027,7 @@ }; /** - * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#createWriteStream}. + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite|createWriteStream}. * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite * @typedef CreateWriteStreamCallback * @type {function} @@ -1930,7 +2060,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#appendRows}. + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite|appendRows}. * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite * @typedef AppendRowsCallback * @type {function} @@ -1963,7 +2093,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#getWriteStream}. + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite|getWriteStream}. * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite * @typedef GetWriteStreamCallback * @type {function} @@ -1996,7 +2126,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#finalizeWriteStream}. + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite|finalizeWriteStream}. * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite * @typedef FinalizeWriteStreamCallback * @type {function} @@ -2029,7 +2159,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#batchCommitWriteStreams}. + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite|batchCommitWriteStreams}. * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite * @typedef BatchCommitWriteStreamsCallback * @type {function} @@ -2062,7 +2192,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite#flushRows}. + * Callback as used by {@link google.cloud.bigquery.storage.v1.BigQueryWrite|flushRows}. * @memberof google.cloud.bigquery.storage.v1.BigQueryWrite * @typedef FlushRowsCallback * @type {function} @@ -2222,18 +2352,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.readSession = $root.google.cloud.bigquery.storage.v1.ReadSession.decode(reader, reader.uint32()); - break; - case 3: - message.maxStreamCount = reader.int32(); - break; - case 4: - message.preferredMinStreamCount = reader.int32(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.readSession = $root.google.cloud.bigquery.storage.v1.ReadSession.decode(reader, reader.uint32()); + break; + } + case 3: { + message.maxStreamCount = reader.int32(); + break; + } + case 4: { + message.preferredMinStreamCount = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -2353,6 +2487,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateReadSessionRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.CreateReadSessionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateReadSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.CreateReadSessionRequest"; + }; + return CreateReadSessionRequest; })(); @@ -2459,12 +2608,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.readStream = reader.string(); - break; - case 2: - message.offset = reader.int64(); - break; + case 1: { + message.readStream = reader.string(); + break; + } + case 2: { + message.offset = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -2577,6 +2728,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ReadRowsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.ReadRowsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadRowsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.ReadRowsRequest"; + }; + return ReadRowsRequest; })(); @@ -2672,9 +2838,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.throttlePercent = reader.int32(); - break; + case 1: { + message.throttlePercent = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -2764,6 +2931,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ThrottleState + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.ThrottleState + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThrottleState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.ThrottleState"; + }; + return ThrottleState; })(); @@ -2859,9 +3041,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - message.progress = $root.google.cloud.bigquery.storage.v1.StreamStats.Progress.decode(reader, reader.uint32()); - break; + case 2: { + message.progress = $root.google.cloud.bigquery.storage.v1.StreamStats.Progress.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -2956,6 +3139,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for StreamStats + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.StreamStats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.StreamStats"; + }; + StreamStats.Progress = (function() { /** @@ -3059,12 +3257,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.atResponseStart = reader.double(); - break; - case 2: - message.atResponseEnd = reader.double(); - break; + case 1: { + message.atResponseStart = reader.double(); + break; + } + case 2: { + message.atResponseEnd = reader.double(); + break; + } default: reader.skipType(tag & 7); break; @@ -3163,6 +3363,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Progress + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.StreamStats.Progress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Progress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.StreamStats.Progress"; + }; + return Progress; })(); @@ -3352,27 +3567,34 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: - message.avroRows = $root.google.cloud.bigquery.storage.v1.AvroRows.decode(reader, reader.uint32()); - break; - case 4: - message.arrowRecordBatch = $root.google.cloud.bigquery.storage.v1.ArrowRecordBatch.decode(reader, reader.uint32()); - break; - case 6: - message.rowCount = reader.int64(); - break; - case 2: - message.stats = $root.google.cloud.bigquery.storage.v1.StreamStats.decode(reader, reader.uint32()); - break; - case 5: - message.throttleState = $root.google.cloud.bigquery.storage.v1.ThrottleState.decode(reader, reader.uint32()); - break; - case 7: - message.avroSchema = $root.google.cloud.bigquery.storage.v1.AvroSchema.decode(reader, reader.uint32()); - break; - case 8: - message.arrowSchema = $root.google.cloud.bigquery.storage.v1.ArrowSchema.decode(reader, reader.uint32()); - break; + case 3: { + message.avroRows = $root.google.cloud.bigquery.storage.v1.AvroRows.decode(reader, reader.uint32()); + break; + } + case 4: { + message.arrowRecordBatch = $root.google.cloud.bigquery.storage.v1.ArrowRecordBatch.decode(reader, reader.uint32()); + break; + } + case 6: { + message.rowCount = reader.int64(); + break; + } + case 2: { + message.stats = $root.google.cloud.bigquery.storage.v1.StreamStats.decode(reader, reader.uint32()); + break; + } + case 5: { + message.throttleState = $root.google.cloud.bigquery.storage.v1.ThrottleState.decode(reader, reader.uint32()); + break; + } + case 7: { + message.avroSchema = $root.google.cloud.bigquery.storage.v1.AvroSchema.decode(reader, reader.uint32()); + break; + } + case 8: { + message.arrowSchema = $root.google.cloud.bigquery.storage.v1.ArrowSchema.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -3580,6 +3802,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ReadRowsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.ReadRowsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadRowsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.ReadRowsResponse"; + }; + return ReadRowsResponse; })(); @@ -3686,12 +3923,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.fraction = reader.double(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.fraction = reader.double(); + break; + } default: reader.skipType(tag & 7); break; @@ -3790,6 +4029,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SplitReadStreamRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SplitReadStreamRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.SplitReadStreamRequest"; + }; + return SplitReadStreamRequest; })(); @@ -3896,12 +4150,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.primaryStream = $root.google.cloud.bigquery.storage.v1.ReadStream.decode(reader, reader.uint32()); - break; - case 2: - message.remainderStream = $root.google.cloud.bigquery.storage.v1.ReadStream.decode(reader, reader.uint32()); - break; + case 1: { + message.primaryStream = $root.google.cloud.bigquery.storage.v1.ReadStream.decode(reader, reader.uint32()); + break; + } + case 2: { + message.remainderStream = $root.google.cloud.bigquery.storage.v1.ReadStream.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -4010,6 +4266,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SplitReadStreamResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.SplitReadStreamResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SplitReadStreamResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.SplitReadStreamResponse"; + }; + return SplitReadStreamResponse; })(); @@ -4116,12 +4387,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.writeStream = $root.google.cloud.bigquery.storage.v1.WriteStream.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.writeStream = $root.google.cloud.bigquery.storage.v1.WriteStream.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -4225,6 +4498,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateWriteStreamRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.CreateWriteStreamRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateWriteStreamRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.CreateWriteStreamRequest"; + }; + return CreateWriteStreamRequest; })(); @@ -4367,21 +4655,25 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.writeStream = reader.string(); - break; - case 2: - message.offset = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); - break; - case 4: - message.protoRows = $root.google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData.decode(reader, reader.uint32()); - break; - case 6: - message.traceId = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + case 1: { + message.writeStream = reader.string(); + break; + } + case 2: { + message.offset = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + break; + } + case 4: { + message.protoRows = $root.google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData.decode(reader, reader.uint32()); + break; + } + case 6: { + message.traceId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; } } return message; @@ -4509,6 +4801,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AppendRowsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AppendRowsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.AppendRowsRequest"; + }; + AppendRowsRequest.ProtoData = (function() { /** @@ -4612,12 +4919,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.writerSchema = $root.google.cloud.bigquery.storage.v1.ProtoSchema.decode(reader, reader.uint32()); - break; - case 2: - message.rows = $root.google.cloud.bigquery.storage.v1.ProtoRows.decode(reader, reader.uint32()); - break; + case 1: { + message.writerSchema = $root.google.cloud.bigquery.storage.v1.ProtoSchema.decode(reader, reader.uint32()); + break; + } + case 2: { + message.rows = $root.google.cloud.bigquery.storage.v1.ProtoRows.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -4726,6 +5035,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ProtoData + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProtoData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData"; + }; + return ProtoData; })(); @@ -4884,23 +5208,28 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.appendResult = $root.google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult.decode(reader, reader.uint32()); - break; - case 2: - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - case 3: - message.updatedSchema = $root.google.cloud.bigquery.storage.v1.TableSchema.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.rowErrors && message.rowErrors.length)) - message.rowErrors = []; - message.rowErrors.push($root.google.cloud.bigquery.storage.v1.RowError.decode(reader, reader.uint32())); - break; - case 5: - message.writeStream = reader.string(); - break; + case 1: { + message.appendResult = $root.google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult.decode(reader, reader.uint32()); + break; + } + case 2: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updatedSchema = $root.google.cloud.bigquery.storage.v1.TableSchema.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.rowErrors && message.rowErrors.length)) + message.rowErrors = []; + message.rowErrors.push($root.google.cloud.bigquery.storage.v1.RowError.decode(reader, reader.uint32())); + break; + } + case 5: { + message.writeStream = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -5069,6 +5398,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AppendRowsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AppendRowsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.AppendRowsResponse"; + }; + AppendRowsResponse.AppendResult = (function() { /** @@ -5161,9 +5505,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.offset = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); - break; + case 1: { + message.offset = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -5258,6 +5603,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AppendResult + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AppendResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult"; + }; + return AppendResult; })(); @@ -5356,9 +5716,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; @@ -5448,6 +5809,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetWriteStreamRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.GetWriteStreamRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetWriteStreamRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.GetWriteStreamRequest"; + }; + return GetWriteStreamRequest; })(); @@ -5556,14 +5932,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - if (!(message.writeStreams && message.writeStreams.length)) - message.writeStreams = []; - message.writeStreams.push(reader.string()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.writeStreams && message.writeStreams.length)) + message.writeStreams = []; + message.writeStreams.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -5674,6 +6052,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchCommitWriteStreamsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCommitWriteStreamsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest"; + }; + return BatchCommitWriteStreamsRequest; })(); @@ -5782,14 +6175,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.commitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.streamErrors && message.streamErrors.length)) - message.streamErrors = []; - message.streamErrors.push($root.google.cloud.bigquery.storage.v1.StorageError.decode(reader, reader.uint32())); - break; + case 1: { + message.commitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.streamErrors && message.streamErrors.length)) + message.streamErrors = []; + message.streamErrors.push($root.google.cloud.bigquery.storage.v1.StorageError.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -5910,6 +6305,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchCommitWriteStreamsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCommitWriteStreamsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse"; + }; + return BatchCommitWriteStreamsResponse; })(); @@ -6005,9 +6415,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; @@ -6097,6 +6508,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FinalizeWriteStreamRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FinalizeWriteStreamRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest"; + }; + return FinalizeWriteStreamRequest; })(); @@ -6192,9 +6618,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.rowCount = reader.int64(); - break; + case 1: { + message.rowCount = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -6298,6 +6725,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FinalizeWriteStreamResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FinalizeWriteStreamResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse"; + }; + return FinalizeWriteStreamResponse; })(); @@ -6404,12 +6846,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.writeStream = reader.string(); - break; - case 2: - message.offset = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); - break; + case 1: { + message.writeStream = reader.string(); + break; + } + case 2: { + message.offset = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -6513,6 +6957,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FlushRowsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.FlushRowsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FlushRowsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.FlushRowsRequest"; + }; + return FlushRowsRequest; })(); @@ -6608,9 +7067,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.offset = reader.int64(); - break; + case 1: { + message.offset = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -6714,6 +7174,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FlushRowsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.FlushRowsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FlushRowsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.FlushRowsResponse"; + }; + return FlushRowsResponse; })(); @@ -6831,15 +7306,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.code = reader.int32(); - break; - case 2: - message.entity = reader.string(); - break; - case 3: - message.errorMessage = reader.string(); - break; + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.entity = reader.string(); + break; + } + case 3: { + message.errorMessage = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -6999,6 +7477,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for StorageError + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.StorageError + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StorageError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.StorageError"; + }; + /** * StorageErrorCode enum. * @name google.cloud.bigquery.storage.v1.StorageError.StorageErrorCode @@ -7146,15 +7639,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.index = reader.int64(); - break; - case 2: - message.code = reader.int32(); - break; - case 3: - message.message = reader.string(); - break; + case 1: { + message.index = reader.int64(); + break; + } + case 2: { + message.code = reader.int32(); + break; + } + case 3: { + message.message = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -7288,6 +7784,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RowError + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.RowError + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RowError.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.RowError"; + }; + /** * RowErrorCode enum. * @name google.cloud.bigquery.storage.v1.RowError.RowErrorCode @@ -7539,41 +8050,52 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.dataFormat = reader.int32(); - break; - case 4: - message.avroSchema = $root.google.cloud.bigquery.storage.v1.AvroSchema.decode(reader, reader.uint32()); - break; - case 5: - message.arrowSchema = $root.google.cloud.bigquery.storage.v1.ArrowSchema.decode(reader, reader.uint32()); - break; - case 6: - message.table = reader.string(); - break; - case 7: - message.tableModifiers = $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.decode(reader, reader.uint32()); - break; - case 8: - message.readOptions = $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.decode(reader, reader.uint32()); - break; - case 10: - if (!(message.streams && message.streams.length)) - message.streams = []; - message.streams.push($root.google.cloud.bigquery.storage.v1.ReadStream.decode(reader, reader.uint32())); - break; - case 12: - message.estimatedTotalBytesScanned = reader.int64(); - break; - case 13: - message.traceId = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.dataFormat = reader.int32(); + break; + } + case 4: { + message.avroSchema = $root.google.cloud.bigquery.storage.v1.AvroSchema.decode(reader, reader.uint32()); + break; + } + case 5: { + message.arrowSchema = $root.google.cloud.bigquery.storage.v1.ArrowSchema.decode(reader, reader.uint32()); + break; + } + case 6: { + message.table = reader.string(); + break; + } + case 7: { + message.tableModifiers = $root.google.cloud.bigquery.storage.v1.ReadSession.TableModifiers.decode(reader, reader.uint32()); + break; + } + case 8: { + message.readOptions = $root.google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.streams && message.streams.length)) + message.streams = []; + message.streams.push($root.google.cloud.bigquery.storage.v1.ReadStream.decode(reader, reader.uint32())); + break; + } + case 12: { + message.estimatedTotalBytesScanned = reader.int64(); + break; + } + case 13: { + message.traceId = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -7832,6 +8354,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ReadSession + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.ReadSession + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadSession.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.ReadSession"; + }; + ReadSession.TableModifiers = (function() { /** @@ -7924,9 +8461,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.snapshotTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.snapshotTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -8021,6 +8559,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TableModifiers + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableModifiers + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableModifiers.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.ReadSession.TableModifiers"; + }; + return TableModifiers; })(); @@ -8165,20 +8718,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.selectedFields && message.selectedFields.length)) - message.selectedFields = []; - message.selectedFields.push(reader.string()); - break; - case 2: - message.rowRestriction = reader.string(); - break; - case 3: - message.arrowSerializationOptions = $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.decode(reader, reader.uint32()); - break; - case 4: - message.avroSerializationOptions = $root.google.cloud.bigquery.storage.v1.AvroSerializationOptions.decode(reader, reader.uint32()); - break; + case 1: { + if (!(message.selectedFields && message.selectedFields.length)) + message.selectedFields = []; + message.selectedFields.push(reader.string()); + break; + } + case 2: { + message.rowRestriction = reader.string(); + break; + } + case 3: { + message.arrowSerializationOptions = $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + message.avroSerializationOptions = $root.google.cloud.bigquery.storage.v1.AvroSerializationOptions.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -8328,6 +8885,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TableReadOptions + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableReadOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.ReadSession.TableReadOptions"; + }; + return TableReadOptions; })(); @@ -8426,9 +8998,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; @@ -8518,6 +9091,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ReadStream + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.ReadStream + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadStream.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.ReadStream"; + }; + return ReadStream; })(); @@ -8668,24 +9256,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.type = reader.int32(); - break; - case 3: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 4: - message.commitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.tableSchema = $root.google.cloud.bigquery.storage.v1.TableSchema.decode(reader, reader.uint32()); - break; - case 7: - message.writeMode = reader.int32(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.commitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.tableSchema = $root.google.cloud.bigquery.storage.v1.TableSchema.decode(reader, reader.uint32()); + break; + } + case 7: { + message.writeMode = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -8867,6 +9461,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for WriteStream + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.WriteStream + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WriteStream.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.WriteStream"; + }; + /** * Type enum. * @name google.cloud.bigquery.storage.v1.WriteStream.Type @@ -8996,11 +9605,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.fields && message.fields.length)) - message.fields = []; - message.fields.push($root.google.cloud.bigquery.storage.v1.TableFieldSchema.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.cloud.bigquery.storage.v1.TableFieldSchema.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -9107,6 +9717,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TableSchema + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.TableSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.TableSchema"; + }; + return TableSchema; })(); @@ -9281,32 +9906,40 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.type = reader.int32(); - break; - case 3: - message.mode = reader.int32(); - break; - case 4: - if (!(message.fields && message.fields.length)) - message.fields = []; - message.fields.push($root.google.cloud.bigquery.storage.v1.TableFieldSchema.decode(reader, reader.uint32())); - break; - case 6: - message.description = reader.string(); - break; - case 7: - message.maxLength = reader.int64(); - break; - case 8: - message.precision = reader.int64(); - break; - case 9: - message.scale = reader.int64(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 3: { + message.mode = reader.int32(); + break; + } + case 4: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.cloud.bigquery.storage.v1.TableFieldSchema.decode(reader, reader.uint32())); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 7: { + message.maxLength = reader.int64(); + break; + } + case 8: { + message.precision = reader.int64(); + break; + } + case 9: { + message.scale = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -9619,6 +10252,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TableFieldSchema + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1.TableFieldSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableFieldSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1.TableFieldSchema"; + }; + /** * Type enum. * @name google.cloud.bigquery.storage.v1.TableFieldSchema.Type @@ -9786,9 +10434,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.serializedSchema = reader.bytes(); - break; + case 1: { + message.serializedSchema = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -9845,7 +10494,7 @@ if (object.serializedSchema != null) if (typeof object.serializedSchema === "string") $util.base64.decode(object.serializedSchema, message.serializedSchema = $util.newBuffer($util.base64.length(object.serializedSchema)), 0); - else if (object.serializedSchema.length) + else if (object.serializedSchema.length >= 0) message.serializedSchema = object.serializedSchema; return message; }; @@ -9887,6 +10536,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ArrowSchema + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArrowSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1beta1.ArrowSchema"; + }; + return ArrowSchema; })(); @@ -9993,12 +10657,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.serializedRecordBatch = reader.bytes(); - break; - case 2: - message.rowCount = reader.int64(); - break; + case 1: { + message.serializedRecordBatch = reader.bytes(); + break; + } + case 2: { + message.rowCount = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -10058,7 +10724,7 @@ if (object.serializedRecordBatch != null) if (typeof object.serializedRecordBatch === "string") $util.base64.decode(object.serializedRecordBatch, message.serializedRecordBatch = $util.newBuffer($util.base64.length(object.serializedRecordBatch)), 0); - else if (object.serializedRecordBatch.length) + else if (object.serializedRecordBatch.length >= 0) message.serializedRecordBatch = object.serializedRecordBatch; if (object.rowCount != null) if ($util.Long) @@ -10120,6 +10786,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ArrowRecordBatch + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArrowRecordBatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch"; + }; + return ArrowRecordBatch; })(); @@ -10215,9 +10896,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.schema = reader.string(); - break; + case 1: { + message.schema = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -10307,6 +10989,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AvroSchema + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AvroSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1beta1.AvroSchema"; + }; + return AvroSchema; })(); @@ -10413,12 +11110,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.serializedBinaryRows = reader.bytes(); - break; - case 2: - message.rowCount = reader.int64(); - break; + case 1: { + message.serializedBinaryRows = reader.bytes(); + break; + } + case 2: { + message.rowCount = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -10478,7 +11177,7 @@ if (object.serializedBinaryRows != null) if (typeof object.serializedBinaryRows === "string") $util.base64.decode(object.serializedBinaryRows, message.serializedBinaryRows = $util.newBuffer($util.base64.length(object.serializedBinaryRows)), 0); - else if (object.serializedBinaryRows.length) + else if (object.serializedBinaryRows.length >= 0) message.serializedBinaryRows = object.serializedBinaryRows; if (object.rowCount != null) if ($util.Long) @@ -10540,6 +11239,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AvroRows + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AvroRows.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1beta1.AvroRows"; + }; + return AvroRows; })(); @@ -10648,14 +11362,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.selectedFields && message.selectedFields.length)) - message.selectedFields = []; - message.selectedFields.push(reader.string()); - break; - case 2: - message.rowRestriction = reader.string(); - break; + case 1: { + if (!(message.selectedFields && message.selectedFields.length)) + message.selectedFields = []; + message.selectedFields.push(reader.string()); + break; + } + case 2: { + message.rowRestriction = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -10766,6 +11482,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TableReadOptions + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableReadOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1beta1.TableReadOptions"; + }; + return TableReadOptions; })(); @@ -10802,7 +11533,7 @@ }; /** - * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#createReadSession}. + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage|createReadSession}. * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage * @typedef CreateReadSessionCallback * @type {function} @@ -10835,7 +11566,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#readRows}. + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage|readRows}. * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage * @typedef ReadRowsCallback * @type {function} @@ -10868,7 +11599,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#batchCreateReadSessionStreams}. + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage|batchCreateReadSessionStreams}. * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage * @typedef BatchCreateReadSessionStreamsCallback * @type {function} @@ -10901,7 +11632,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#finalizeStream}. + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage|finalizeStream}. * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage * @typedef FinalizeStreamCallback * @type {function} @@ -10934,7 +11665,7 @@ */ /** - * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage#splitReadStream}. + * Callback as used by {@link google.cloud.bigquery.storage.v1beta1.BigQueryStorage|splitReadStream}. * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage * @typedef SplitReadStreamCallback * @type {function} @@ -11061,9 +11792,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; @@ -11153,6 +11885,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Stream + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Stream.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1beta1.Stream"; + }; + return Stream; })(); @@ -11259,12 +12006,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); - break; - case 2: - message.offset = reader.int64(); - break; + case 1: { + message.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); + break; + } + case 2: { + message.offset = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -11382,6 +12131,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for StreamPosition + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamPosition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1beta1.StreamPosition"; + }; + return StreamPosition; })(); @@ -11570,32 +12334,40 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.avroSchema = $root.google.cloud.bigquery.storage.v1beta1.AvroSchema.decode(reader, reader.uint32()); - break; - case 6: - message.arrowSchema = $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.streams && message.streams.length)) - message.streams = []; - message.streams.push($root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32())); - break; - case 7: - message.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.decode(reader, reader.uint32()); - break; - case 8: - message.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.decode(reader, reader.uint32()); - break; - case 9: - message.shardingStrategy = reader.int32(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.avroSchema = $root.google.cloud.bigquery.storage.v1beta1.AvroSchema.decode(reader, reader.uint32()); + break; + } + case 6: { + message.arrowSchema = $root.google.cloud.bigquery.storage.v1beta1.ArrowSchema.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.streams && message.streams.length)) + message.streams = []; + message.streams.push($root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32())); + break; + } + case 7: { + message.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.decode(reader, reader.uint32()); + break; + } + case 8: { + message.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.decode(reader, reader.uint32()); + break; + } + case 9: { + message.shardingStrategy = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -11816,6 +12588,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ReadSession + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadSession.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1beta1.ReadSession"; + }; + return ReadSession; })(); @@ -11977,29 +12764,36 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.decode(reader, reader.uint32()); - break; - case 6: - message.parent = reader.string(); - break; - case 2: - message.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.decode(reader, reader.uint32()); - break; - case 3: - message.requestedStreams = reader.int32(); - break; - case 4: - message.readOptions = $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions.decode(reader, reader.uint32()); - break; - case 5: - message.format = reader.int32(); - break; - case 7: - message.shardingStrategy = reader.int32(); - break; - default: - reader.skipType(tag & 7); + case 1: { + message.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.decode(reader, reader.uint32()); + break; + } + case 6: { + message.parent = reader.string(); + break; + } + case 2: { + message.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestedStreams = reader.int32(); + break; + } + case 4: { + message.readOptions = $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.format = reader.int32(); + break; + } + case 7: { + message.shardingStrategy = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); break; } } @@ -12187,6 +12981,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateReadSessionRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateReadSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest"; + }; + return CreateReadSessionRequest; })(); @@ -12314,9 +13123,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.readPosition = $root.google.cloud.bigquery.storage.v1beta1.StreamPosition.decode(reader, reader.uint32()); - break; + case 1: { + message.readPosition = $root.google.cloud.bigquery.storage.v1beta1.StreamPosition.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -12411,6 +13221,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ReadRowsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadRowsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1beta1.ReadRowsRequest"; + }; + return ReadRowsRequest; })(); @@ -12539,18 +13364,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.estimatedRowCount = reader.int64(); - break; - case 2: - message.fractionConsumed = reader.float(); - break; - case 4: - message.progress = $root.google.cloud.bigquery.storage.v1beta1.Progress.decode(reader, reader.uint32()); - break; - case 3: - message.isSplittable = reader.bool(); - break; + case 1: { + message.estimatedRowCount = reader.int64(); + break; + } + case 2: { + message.fractionConsumed = reader.float(); + break; + } + case 4: { + message.progress = $root.google.cloud.bigquery.storage.v1beta1.Progress.decode(reader, reader.uint32()); + break; + } + case 3: { + message.isSplittable = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -12684,6 +13513,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for StreamStatus + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1beta1.StreamStatus"; + }; + return StreamStatus; })(); @@ -12790,12 +13634,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.atResponseStart = reader.float(); - break; - case 2: - message.atResponseEnd = reader.float(); - break; + case 1: { + message.atResponseStart = reader.float(); + break; + } + case 2: { + message.atResponseEnd = reader.float(); + break; + } default: reader.skipType(tag & 7); break; @@ -12894,6 +13740,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Progress + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Progress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1beta1.Progress"; + }; + return Progress; })(); @@ -12989,9 +13850,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.throttlePercent = reader.int32(); - break; + case 1: { + message.throttlePercent = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -13081,6 +13943,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ThrottleStatus + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThrottleStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1beta1.ThrottleStatus"; + }; + return ThrottleStatus; })(); @@ -13234,21 +14111,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: - message.avroRows = $root.google.cloud.bigquery.storage.v1beta1.AvroRows.decode(reader, reader.uint32()); - break; - case 4: - message.arrowRecordBatch = $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.decode(reader, reader.uint32()); - break; - case 6: - message.rowCount = reader.int64(); - break; - case 2: - message.status = $root.google.cloud.bigquery.storage.v1beta1.StreamStatus.decode(reader, reader.uint32()); - break; - case 5: - message.throttleStatus = $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus.decode(reader, reader.uint32()); - break; + case 3: { + message.avroRows = $root.google.cloud.bigquery.storage.v1beta1.AvroRows.decode(reader, reader.uint32()); + break; + } + case 4: { + message.arrowRecordBatch = $root.google.cloud.bigquery.storage.v1beta1.ArrowRecordBatch.decode(reader, reader.uint32()); + break; + } + case 6: { + message.rowCount = reader.int64(); + break; + } + case 2: { + message.status = $root.google.cloud.bigquery.storage.v1beta1.StreamStatus.decode(reader, reader.uint32()); + break; + } + case 5: { + message.throttleStatus = $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -13418,6 +14300,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ReadRowsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadRowsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1beta1.ReadRowsResponse"; + }; + return ReadRowsResponse; })(); @@ -13524,12 +14421,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.session = $root.google.cloud.bigquery.storage.v1beta1.ReadSession.decode(reader, reader.uint32()); - break; - case 2: - message.requestedStreams = reader.int32(); - break; + case 1: { + message.session = $root.google.cloud.bigquery.storage.v1beta1.ReadSession.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestedStreams = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -13633,6 +14532,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchCreateReadSessionStreamsRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateReadSessionStreamsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest"; + }; + return BatchCreateReadSessionStreamsRequest; })(); @@ -13730,11 +14644,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.streams && message.streams.length)) - message.streams = []; - message.streams.push($root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.streams && message.streams.length)) + message.streams = []; + message.streams.push($root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -13841,6 +14756,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BatchCreateReadSessionStreamsResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateReadSessionStreamsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse"; + }; + return BatchCreateReadSessionStreamsResponse; })(); @@ -13936,9 +14866,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - message.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); - break; + case 2: { + message.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -14033,6 +14964,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FinalizeStreamRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FinalizeStreamRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest"; + }; + return FinalizeStreamRequest; })(); @@ -14139,12 +15085,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.originalStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); - break; - case 2: - message.fraction = reader.float(); - break; + case 1: { + message.originalStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); + break; + } + case 2: { + message.fraction = reader.float(); + break; + } default: reader.skipType(tag & 7); break; @@ -14248,6 +15196,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SplitReadStreamRequest + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SplitReadStreamRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest"; + }; + return SplitReadStreamRequest; })(); @@ -14354,12 +15317,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.primaryStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); - break; - case 2: - message.remainderStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); - break; + case 1: { + message.primaryStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); + break; + } + case 2: { + message.remainderStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -14468,6 +15433,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SplitReadStreamResponse + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SplitReadStreamResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse"; + }; + return SplitReadStreamResponse; })(); @@ -14585,15 +15565,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; @@ -14700,6 +15683,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TableReference + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1beta1.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.storage.v1beta1.TableReference"; + }; + return TableReference; })(); @@ -14795,9 +15793,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.snapshotTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.snapshotTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -14892,6 +15891,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for TableModifiers + * @function getTypeUrl + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableModifiers.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.storage.v1beta1.TableModifiers"; + }; + return TableModifiers; })(); @@ -15010,11 +16024,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; @@ -15121,6 +16136,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; })(); @@ -15142,6 +16172,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 */ /** @@ -15262,6 +16293,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 @@ -15317,6 +16356,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; }; @@ -15351,66 +16392,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; @@ -15522,6 +16579,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; }; @@ -15614,6 +16674,8 @@ } if (object.syntax != null) message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); return message; }; @@ -15645,6 +16707,7 @@ object.options = null; object.sourceCodeInfo = null; object.syntax = ""; + object.edition = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -15691,6 +16754,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; }; @@ -15705,6 +16770,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; })(); @@ -15915,52 +16995,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; @@ -16261,6 +17351,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() { /** @@ -16375,15 +17480,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; @@ -16495,6 +17603,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; })(); @@ -16601,12 +17724,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; @@ -16705,6 +17830,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; })(); @@ -16805,11 +17945,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; @@ -16916,6 +18057,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; })(); @@ -17121,39 +18277,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; @@ -17440,6 +18607,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 @@ -17608,12 +18790,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -17717,6 +18901,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; })(); @@ -17862,27 +19061,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; @@ -18058,6 +19262,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() { /** @@ -18161,12 +19380,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; @@ -18265,6 +19486,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; })(); @@ -18385,15 +19621,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; @@ -18505,6 +19744,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; })(); @@ -18624,17 +19878,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; @@ -18764,6 +20021,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; })(); @@ -18914,24 +20186,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; @@ -19067,6 +20345,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; })(); @@ -19397,76 +20690,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; @@ -19779,6 +21094,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 @@ -19947,26 +21277,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; @@ -20120,6 +21456,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; })(); @@ -20133,6 +21484,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 @@ -20189,6 +21541,14 @@ */ FieldOptions.prototype.lazy = false; + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + /** * FieldOptions deprecated. * @member {boolean} deprecated @@ -20265,6 +21625,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(); @@ -20310,42 +21672,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; @@ -20405,6 +21780,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"; @@ -20490,6 +21868,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) @@ -20577,6 +21957,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")) @@ -20591,6 +21972,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) @@ -20617,6 +22000,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 @@ -20746,11 +22144,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; @@ -20857,6 +22256,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; })(); @@ -20976,17 +22390,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; @@ -21111,6 +22528,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; })(); @@ -21219,14 +22651,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; @@ -21342,6 +22776,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; })(); @@ -21472,20 +22921,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; @@ -21618,6 +23071,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + return ServiceOptions; })(); @@ -21761,25 +23229,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; @@ -21956,6 +23429,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 @@ -22135,29 +23623,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; @@ -22270,7 +23765,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); @@ -22351,6 +23846,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() { /** @@ -22452,12 +23962,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; @@ -22558,6 +24070,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; })(); @@ -22658,11 +24185,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; @@ -22769,6 +24297,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() { /** @@ -22917,37 +24460,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; @@ -23108,6 +24656,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; })(); @@ -23208,11 +24771,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; @@ -23319,6 +24883,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() { /** @@ -23329,6 +24908,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 */ /** @@ -23379,6 +24959,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 @@ -23415,6 +25003,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; }; @@ -23449,25 +25039,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; @@ -23519,6 +25117,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; }; @@ -23547,6 +25154,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; }; @@ -23569,6 +25190,7 @@ object.sourceFile = ""; object.begin = 0; object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; } if (message.path && message.path.length) { object.path = []; @@ -23581,6 +25203,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; }; @@ -23595,6 +25219,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; })(); @@ -23704,12 +25359,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; @@ -23822,6 +25479,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; })(); @@ -23917,9 +25589,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.value = reader.double(); - break; + case 1: { + message.value = reader.double(); + break; + } default: reader.skipType(tag & 7); break; @@ -24009,6 +25682,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + return DoubleValue; })(); @@ -24104,9 +25792,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.value = reader.float(); - break; + case 1: { + message.value = reader.float(); + break; + } default: reader.skipType(tag & 7); break; @@ -24196,6 +25885,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + return FloatValue; })(); @@ -24291,9 +25995,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.value = reader.int64(); - break; + case 1: { + message.value = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -24397,6 +26102,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + return Int64Value; })(); @@ -24492,9 +26212,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.value = reader.uint64(); - break; + case 1: { + message.value = reader.uint64(); + break; + } default: reader.skipType(tag & 7); break; @@ -24598,6 +26319,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + return UInt64Value; })(); @@ -24693,9 +26429,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.value = reader.int32(); - break; + case 1: { + message.value = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -24785,6 +26522,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + return Int32Value; })(); @@ -24880,9 +26632,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.value = reader.uint32(); - break; + case 1: { + message.value = reader.uint32(); + break; + } default: reader.skipType(tag & 7); break; @@ -24972,6 +26725,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + return UInt32Value; })(); @@ -25067,9 +26835,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.value = reader.bool(); - break; + case 1: { + message.value = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -25159,6 +26928,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + return BoolValue; })(); @@ -25254,9 +27038,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.value = reader.string(); - break; + case 1: { + message.value = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -25346,6 +27131,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + return StringValue; })(); @@ -25441,9 +27241,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.value = reader.bytes(); - break; + case 1: { + message.value = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -25500,7 +27301,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; }; @@ -25542,6 +27343,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + return BytesValue; })(); @@ -25648,12 +27464,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; @@ -25715,7 +27533,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; }; @@ -25761,6 +27579,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; })(); @@ -25921,6 +27754,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; })(); @@ -26041,14 +27889,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; @@ -26164,6 +28014,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; })(); @@ -26374,38 +28239,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; @@ -26627,6 +28502,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; })(); @@ -26733,12 +28623,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; @@ -26837,6 +28729,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; })(); @@ -27031,36 +28938,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; @@ -27258,6 +29172,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + /** * History enum. * @name google.api.ResourceDescriptor.History @@ -27394,12 +29323,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; @@ -27498,6 +29429,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; })(); @@ -27629,17 +29575,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; @@ -27764,6 +29713,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-storage/protos/protos.json b/packages/google-cloud-bigquery-storage/protos/protos.json index 389ea6f3f92..e2fa6466986 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.json +++ b/packages/google-cloud-bigquery-storage/protos/protos.json @@ -1591,6 +1591,10 @@ "syntax": { "type": "string", "id": 12 + }, + "edition": { + "type": "string", + "id": 13 } } }, @@ -2119,6 +2123,13 @@ "default": false } }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, "deprecated": { "type": "bool", "id": 3, @@ -2411,6 +2422,19 @@ "end": { "type": "int32", "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } } } } From 0676041b4c04955663dd4f7adf46c0278e5c7f66 Mon Sep 17 00:00:00 2001 From: shollyman Date: Tue, 23 Aug 2022 13:23:43 -0700 Subject: [PATCH 172/182] docs: augment write API sample to add more types (#288) * docs: augment write API sample to add more types This PR adds some missing functionality to the appending data example for node, namely to demonstrate writing complex messages with nested message types. It augments the sample data proto to be in line with other languages and adds the testing to ensure that complex types are propagated through to query results. --- packages/google-cloud-bigquery-storage/README.md | 2 +- .../google-cloud-bigquery-storage/samples/README.md | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/README.md b/packages/google-cloud-bigquery-storage/README.md index 40dfb1f6162..a83b819122b 100644 --- a/packages/google-cloud-bigquery-storage/README.md +++ b/packages/google-cloud-bigquery-storage/README.md @@ -189,7 +189,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-bigquery-st | Append_rows_proto2 | [source code](https://github.com/googleapis/nodejs-bigquery-storage/blob/main/samples/append_rows_proto2.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigquery-storage&page=editor&open_in_editor=samples/append_rows_proto2.js,samples/README.md) | | Customer_record_pb | [source code](https://github.com/googleapis/nodejs-bigquery-storage/blob/main/samples/customer_record_pb.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigquery-storage&page=editor&open_in_editor=samples/customer_record_pb.js,samples/README.md) | | BigQuery Storage Quickstart | [source code](https://github.com/googleapis/nodejs-bigquery-storage/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-storage&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | -| Sample_data_pb2 | [source code](https://github.com/googleapis/nodejs-bigquery-storage/blob/main/samples/sample_data_pb2.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigquery-storage&page=editor&open_in_editor=samples/sample_data_pb2.js,samples/README.md) | +| Sample_data_pb | [source code](https://github.com/googleapis/nodejs-bigquery-storage/blob/main/samples/sample_data_pb.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigquery-storage&page=editor&open_in_editor=samples/sample_data_pb.js,samples/README.md) | diff --git a/packages/google-cloud-bigquery-storage/samples/README.md b/packages/google-cloud-bigquery-storage/samples/README.md index 26adb60c4e1..a280bcae1c7 100644 --- a/packages/google-cloud-bigquery-storage/samples/README.md +++ b/packages/google-cloud-bigquery-storage/samples/README.md @@ -16,7 +16,7 @@ * [Append_rows_proto2](#append_rows_proto2) * [Customer_record_pb](#customer_record_pb) * [BigQuery Storage Quickstart](#bigquery-storage-quickstart) - * [Sample_data_pb2](#sample_data_pb2) + * [Sample_data_pb](#sample_data_pb) ## Before you begin @@ -103,16 +103,16 @@ __Usage:__ -### Sample_data_pb2 +### Sample_data_pb -View the [source code](https://github.com/googleapis/nodejs-bigquery-storage/blob/main/samples/sample_data_pb2.js). +View the [source code](https://github.com/googleapis/nodejs-bigquery-storage/blob/main/samples/sample_data_pb.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigquery-storage&page=editor&open_in_editor=samples/sample_data_pb2.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigquery-storage&page=editor&open_in_editor=samples/sample_data_pb.js,samples/README.md) __Usage:__ -`node samples/sample_data_pb2.js` +`node samples/sample_data_pb.js` From dd2007408dee94bf6070073cda9ea906ac530482 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 15:02:12 -0700 Subject: [PATCH 173/182] chore(main): release 3.1.0 (#285) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 3.1.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- .../google-cloud-bigquery-storage/CHANGELOG.md | 14 ++++++++++++++ .../google-cloud-bigquery-storage/package.json | 2 +- ..._metadata.google.cloud.bigquery.storage.v1.json | 2 +- ...data.google.cloud.bigquery.storage.v1beta1.json | 2 +- .../samples/package.json | 2 +- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md index 5d9719cffc8..5e48ed039f2 100644 --- a/packages/google-cloud-bigquery-storage/CHANGELOG.md +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [3.1.0](https://github.com/googleapis/nodejs-bigquery-storage/compare/v3.0.0...v3.1.0) (2022-08-23) + + +### Features + +* allow users to set Apache Avro output format options through avro_serialization_options param in TableReadOptions message ([#284](https://github.com/googleapis/nodejs-bigquery-storage/issues/284)) ([99b8afc](https://github.com/googleapis/nodejs-bigquery-storage/commit/99b8afc3fb2aa1d47151b90924eab2016432034f)) + + +### Bug Fixes + +* better support for fallback mode ([#287](https://github.com/googleapis/nodejs-bigquery-storage/issues/287)) ([08b0bb2](https://github.com/googleapis/nodejs-bigquery-storage/commit/08b0bb2c300ce49a65121805ea674e9c56726a87)) +* change import long to require ([#289](https://github.com/googleapis/nodejs-bigquery-storage/issues/289)) ([63a3dc2](https://github.com/googleapis/nodejs-bigquery-storage/commit/63a3dc2bcbac775e8c41dd19248ef3cd4829c21f)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-bigquery-storage/issues/1546)) ([#290](https://github.com/googleapis/nodejs-bigquery-storage/issues/290)) ([1436388](https://github.com/googleapis/nodejs-bigquery-storage/commit/143638862040327e89c74c87a7018e2342576a95)) + ## [3.0.0](https://github.com/googleapis/nodejs-bigquery-storage/compare/v2.8.0...v3.0.0) (2022-06-29) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 367d3085b85..cefd5cc432c 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "3.0.0", + "version": "3.1.0", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json b/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json index 1036b356fbb..e20ae7d6385 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-storage", - "version": "3.0.0", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json index ac58a9c66c9..01be75591a9 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-storage", - "version": "3.0.0", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index 296fa69a3b1..b3d2d63d00f 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^3.0.0", + "@google-cloud/bigquery-storage": "^3.1.0", "avsc": "^5.4.18", "google-protobuf": "^3.19.1", "snappy": "^7.0.0" From 75bb021b9f1b1951429225d92cdb6815a8f44ca3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 27 Aug 2022 05:08:18 +0000 Subject: [PATCH 174/182] fix: do not import the whole google-gax from proto JS (#1553) (#291) 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-storage/package.json | 2 +- packages/google-cloud-bigquery-storage/protos/protos.d.ts | 2 +- packages/google-cloud-bigquery-storage/protos/protos.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index cefd5cc432c..38b40127abd 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -27,7 +27,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^3.0.1" + "google-gax": "^3.3.0" }, "devDependencies": { "@types/mocha": "^9.0.0", diff --git a/packages/google-cloud-bigquery-storage/protos/protos.d.ts b/packages/google-cloud-bigquery-storage/protos/protos.d.ts index 2cfa3409b32..6dcd8c08147 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-storage/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-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index 542a50d85f2..156259548cb 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/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 4ff11649430845e77d15719e1719212b7e18bd51 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:46:26 +0000 Subject: [PATCH 175/182] fix: allow passing gax instance to client constructor (#292) - [ ] 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/big_query_read_client.ts | 40 +++++++++++------ .../src/v1/big_query_write_client.ts | 44 ++++++++++++------- .../src/v1beta1/big_query_storage_client.ts | 44 ++++++++++++------- 3 files changed, 85 insertions(+), 43 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index 81c81a81d68..7ba3e1e633e 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -17,15 +17,13 @@ // ** 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, ClientOptions, - GoogleError, } from 'google-gax'; - import {PassThrough} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -35,7 +33,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './big_query_read_client_config.json'; - const version = require('../../../package.json').version; /** @@ -97,8 +94,18 @@ export class BigQueryReadClient { * 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 BigQueryReadClient({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 BigQueryReadClient; const servicePath = @@ -118,8 +125,13 @@ export class BigQueryReadClient { 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); @@ -184,7 +196,7 @@ export class BigQueryReadClient { // Provide descriptors for these. this.descriptors.stream = { readRows: new this._gaxModule.StreamDescriptor( - gax.StreamType.SERVER_STREAMING, + this._gaxModule.StreamType.SERVER_STREAMING, opts.fallback === 'rest' ), }; @@ -203,7 +215,7 @@ export class BigQueryReadClient { 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; } /** @@ -253,7 +265,9 @@ export class BigQueryReadClient { setImmediate(() => { stream.emit( 'error', - new GoogleError('The client has already been closed.') + new this._gaxModule.GoogleError( + 'The client has already been closed.' + ) ); }); return stream; @@ -470,7 +484,7 @@ export class BigQueryReadClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'read_session.table': request.readSession!.table || '', }); this.initialize(); @@ -586,7 +600,7 @@ export class BigQueryReadClient { 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(); @@ -629,7 +643,7 @@ export class BigQueryReadClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ read_stream: request.readStream || '', }); this.initialize(); diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts index 02021a6bd26..10a5b597c6f 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts @@ -17,15 +17,13 @@ // ** 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, ClientOptions, - GoogleError, } from 'google-gax'; - import {PassThrough} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -35,7 +33,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './big_query_write_client_config.json'; - const version = require('../../../package.json').version; /** @@ -100,8 +97,18 @@ export class BigQueryWriteClient { * 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 BigQueryWriteClient({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 BigQueryWriteClient; const servicePath = @@ -121,8 +128,13 @@ export class BigQueryWriteClient { opts['scopes'] = staticMembers.scopes; } + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); @@ -187,7 +199,7 @@ export class BigQueryWriteClient { // Provide descriptors for these. this.descriptors.stream = { appendRows: new this._gaxModule.StreamDescriptor( - gax.StreamType.BIDI_STREAMING, + this._gaxModule.StreamType.BIDI_STREAMING, opts.fallback === 'rest' ), }; @@ -206,7 +218,7 @@ export class BigQueryWriteClient { 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; } /** @@ -259,7 +271,9 @@ export class BigQueryWriteClient { setImmediate(() => { stream.emit( 'error', - new GoogleError('The client has already been closed.') + new this._gaxModule.GoogleError( + 'The client has already been closed.' + ) ); }); return stream; @@ -444,7 +458,7 @@ export class BigQueryWriteClient { 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(); @@ -542,7 +556,7 @@ export class BigQueryWriteClient { 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(); @@ -641,7 +655,7 @@ export class BigQueryWriteClient { 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(); @@ -746,7 +760,7 @@ export class BigQueryWriteClient { 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(); @@ -851,7 +865,7 @@ export class BigQueryWriteClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ write_stream: request.writeStream || '', }); this.initialize(); diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index a6a6d6c9596..9b545b1af42 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -17,15 +17,13 @@ // ** 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, ClientOptions, - GoogleError, } from 'google-gax'; - import {PassThrough} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -35,7 +33,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './big_query_storage_client_config.json'; - const version = require('../../../package.json').version; /** @@ -97,8 +94,18 @@ export class BigQueryStorageClient { * 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 BigQueryStorageClient({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 BigQueryStorageClient; const servicePath = @@ -118,8 +125,13 @@ export class BigQueryStorageClient { 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); @@ -178,7 +190,7 @@ export class BigQueryStorageClient { // Provide descriptors for these. this.descriptors.stream = { readRows: new this._gaxModule.StreamDescriptor( - gax.StreamType.SERVER_STREAMING, + this._gaxModule.StreamType.SERVER_STREAMING, opts.fallback === 'rest' ), }; @@ -197,7 +209,7 @@ export class BigQueryStorageClient { 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; } /** @@ -250,7 +262,9 @@ export class BigQueryStorageClient { setImmediate(() => { stream.emit( 'error', - new GoogleError('The client has already been closed.') + new this._gaxModule.GoogleError( + 'The client has already been closed.' + ) ); }); return stream; @@ -458,7 +472,7 @@ export class BigQueryStorageClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'table_reference.project_id': request.tableReference!.projectId || '', 'table_reference.dataset_id': request.tableReference!.datasetId || '', }); @@ -563,7 +577,7 @@ export class BigQueryStorageClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'session.name': request.session!.name || '', }); this.initialize(); @@ -677,7 +691,7 @@ export class BigQueryStorageClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'stream.name': request.stream!.name || '', }); this.initialize(); @@ -794,7 +808,7 @@ export class BigQueryStorageClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'original_stream.name': request.originalStream!.name || '', }); this.initialize(); @@ -837,7 +851,7 @@ export class BigQueryStorageClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'read_position.stream.name': request.readPosition!.stream!.name || '', }); this.initialize(); From 0c0a354fa8fd890f9e5ce2ca2de83c6993ccda96 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 7 Sep 2022 18:01:53 -0400 Subject: [PATCH 176/182] chore(main): release 3.1.1 (#293) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 3.1.1 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-bigquery-storage/CHANGELOG.md | 8 ++++++++ packages/google-cloud-bigquery-storage/package.json | 2 +- ...snippet_metadata.google.cloud.bigquery.storage.v1.json | 2 +- ...et_metadata.google.cloud.bigquery.storage.v1beta1.json | 2 +- .../google-cloud-bigquery-storage/samples/package.json | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md index 5e48ed039f2..33229aabf90 100644 --- a/packages/google-cloud-bigquery-storage/CHANGELOG.md +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [3.1.1](https://github.com/googleapis/nodejs-bigquery-storage/compare/v3.1.0...v3.1.1) (2022-09-01) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#292](https://github.com/googleapis/nodejs-bigquery-storage/issues/292)) ([89f953d](https://github.com/googleapis/nodejs-bigquery-storage/commit/89f953de24d774de076ce9aeef649122ab3d65a6)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-bigquery-storage/issues/1553)) ([#291](https://github.com/googleapis/nodejs-bigquery-storage/issues/291)) ([507e378](https://github.com/googleapis/nodejs-bigquery-storage/commit/507e3780553fa339ffccbba9a8f9ac930d1e9c6d)) + ## [3.1.0](https://github.com/googleapis/nodejs-bigquery-storage/compare/v3.0.0...v3.1.0) (2022-08-23) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 38b40127abd..0453492655c 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "3.1.0", + "version": "3.1.1", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json b/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json index e20ae7d6385..6ff22b675bd 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-storage", - "version": "3.1.0", + "version": "3.1.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json index 01be75591a9..3e4305f2828 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-storage", - "version": "3.1.0", + "version": "3.1.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index b3d2d63d00f..83c9a638be4 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^3.1.0", + "@google-cloud/bigquery-storage": "^3.1.1", "avsc": "^5.4.18", "google-protobuf": "^3.19.1", "snappy": "^7.0.0" From 34f78efac2ee274c82f536d94b80ca7e886209e3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 9 Sep 2022 05:06:14 +0200 Subject: [PATCH 177/182] chore(deps): update dependency uuid to v9 (#294) 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 | |---|---|---|---|---|---| | [uuid](https://togithub.com/uuidjs/uuid) | [`^8.0.0` -> `^9.0.0`](https://renovatebot.com/diffs/npm/uuid/8.3.2/9.0.0) | [![age](https://badges.renovateapi.com/packages/npm/uuid/9.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/uuid/9.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/uuid/9.0.0/compatibility-slim/8.3.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/uuid/9.0.0/confidence-slim/8.3.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
uuidjs/uuid ### [`v9.0.0`](https://togithub.com/uuidjs/uuid/blob/HEAD/CHANGELOG.md#​900-httpsgithubcomuuidjsuuidcomparev832v900-2022-09-05) [Compare Source](https://togithub.com/uuidjs/uuid/compare/v8.3.2...v9.0.0) ##### ⚠ BREAKING CHANGES - Drop Node.js 10.x support. This library always aims at supporting one EOLed LTS release which by this time now is 12.x which has reached EOL 30 Apr 2022. - Remove the minified UMD build from the package. Minified code is hard to audit and since this is a widely used library it seems more appropriate nowadays to optimize for auditability than to ship a legacy module format that, at best, serves educational purposes nowadays. For production browser use cases, users should be using a bundler. For educational purposes, today's online sandboxes like replit.com offer convenient ways to load npm modules, so the use case for UMD through repos like UNPKG or jsDelivr has largely vanished. - Drop IE 11 and Safari 10 support. Drop support for browsers that don't correctly implement const/let and default arguments, and no longer transpile the browser build to ES2015. This also removes the fallback on msCrypto instead of the crypto API. Browser tests are run in the first supported version of each supported browser and in the latest (as of this commit) version available on Browserstack. ##### Features - optimize uuid.v1 by 1.3x uuid.v4 by 4.3x (430%) ([#​597](https://togithub.com/uuidjs/uuid/issues/597)) ([3a033f6](https://togithub.com/uuidjs/uuid/commit/3a033f6bab6bb3780ece6d645b902548043280bc)) - remove UMD build ([#​645](https://togithub.com/uuidjs/uuid/issues/645)) ([e948a0f](https://togithub.com/uuidjs/uuid/commit/e948a0f22bf22f4619b27bd913885e478e20fe6f)), closes [#​620](https://togithub.com/uuidjs/uuid/issues/620) - use native crypto.randomUUID when available ([#​600](https://togithub.com/uuidjs/uuid/issues/600)) ([c9e076c](https://togithub.com/uuidjs/uuid/commit/c9e076c852edad7e9a06baaa1d148cf4eda6c6c4)) ##### Bug Fixes - add Jest/jsdom compatibility ([#​642](https://togithub.com/uuidjs/uuid/issues/642)) ([16f9c46](https://togithub.com/uuidjs/uuid/commit/16f9c469edf46f0786164cdf4dc980743984a6fd)) - change default export to named function ([#​545](https://togithub.com/uuidjs/uuid/issues/545)) ([c57bc5a](https://togithub.com/uuidjs/uuid/commit/c57bc5a9a0653273aa639cda9177ce52efabe42a)) - handle error when parameter is not set in v3 and v5 ([#​622](https://togithub.com/uuidjs/uuid/issues/622)) ([fcd7388](https://togithub.com/uuidjs/uuid/commit/fcd73881692d9fabb63872576ba28e30ff852091)) - run npm audit fix ([#​644](https://togithub.com/uuidjs/uuid/issues/644)) ([04686f5](https://togithub.com/uuidjs/uuid/commit/04686f54c5fed2cfffc1b619f4970c4bb8532353)) - upgrading from uuid3 broken link ([#​568](https://togithub.com/uuidjs/uuid/issues/568)) ([1c849da](https://togithub.com/uuidjs/uuid/commit/1c849da6e164259e72e18636726345b13a7eddd6)) ##### build - drop Node.js 8.x from babel transpile target ([#​603](https://togithub.com/uuidjs/uuid/issues/603)) ([aa11485](https://togithub.com/uuidjs/uuid/commit/aa114858260402107ec8a1e1a825dea0a259bcb5)) - drop support for legacy browsers (IE11, Safari 10) ([#​604](https://togithub.com/uuidjs/uuid/issues/604)) ([0f433e5](https://togithub.com/uuidjs/uuid/commit/0f433e5ec444edacd53016de67db021102f36148)) - drop node 10.x to upgrade dev dependencies ([#​653](https://togithub.com/uuidjs/uuid/issues/653)) ([28a5712](https://togithub.com/uuidjs/uuid/commit/28a571283f8abda6b9d85e689f95b7d3ee9e282e)), closes [#​643](https://togithub.com/uuidjs/uuid/issues/643) ##### [8.3.2](https://togithub.com/uuidjs/uuid/compare/v8.3.1...v8.3.2) (2020-12-08) ##### Bug Fixes - lazy load getRandomValues ([#​537](https://togithub.com/uuidjs/uuid/issues/537)) ([16c8f6d](https://togithub.com/uuidjs/uuid/commit/16c8f6df2f6b09b4d6235602d6a591188320a82e)), closes [#​536](https://togithub.com/uuidjs/uuid/issues/536) ##### [8.3.1](https://togithub.com/uuidjs/uuid/compare/v8.3.0...v8.3.1) (2020-10-04) ##### Bug Fixes - support expo>=39.0.0 ([#​515](https://togithub.com/uuidjs/uuid/issues/515)) ([c65a0f3](https://togithub.com/uuidjs/uuid/commit/c65a0f3fa73b901959d638d1e3591dfacdbed867)), closes [#​375](https://togithub.com/uuidjs/uuid/issues/375)
--- ### 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-storage). --- packages/google-cloud-bigquery-storage/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index 83c9a638be4..baf43987c43 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -23,6 +23,6 @@ "c8": "^7.0.0", "chai": "^4.2.0", "mocha": "^8.0.0", - "uuid": "^8.0.0" + "uuid": "^9.0.0" } } From 48db9d54092c8b5c05d7c76d74f8fdf4b888243b 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 13:14:14 -0700 Subject: [PATCH 178/182] feat: add location to WriteStream and add WriteStreamView support (#295) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add location to WriteStream and add WriteStreamView support PiperOrigin-RevId: 472835596 Source-Link: https://github.com/googleapis/googleapis/commit/1cf9407d5a7c889b7b30bd8a8ea4b67275943ac9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/59d0f10badec867913ebc2eb4bac021f79904519 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTlkMGYxMGJhZGVjODY3OTEzZWJjMmViNGJhYzAyMWY3OTkwNDUxOSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add proto annotation for non-ascii field mapping PiperOrigin-RevId: 473815595 Source-Link: https://github.com/googleapis/googleapis/commit/46cfc4c8d90cad2a878bac4f15aa5c8683374ec3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/955ca31d81100d81ed7e0ae0522358ac45d53cc9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTU1Y2EzMWQ4MTEwMGQ4MWVkN2UwYWUwNTIyMzU4YWM0NWQ1M2NjOSJ9 * chore: use gapic-generator-typescript v2.17.0 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 * 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 * fix: regenerated locally * fix(deps): use google-gax v3.5.2 Co-authored-by: Owl Bot Co-authored-by: Alexander Fenster --- .../package.json | 4 +- .../bigquery/storage/v1/annotations.proto | 28 + .../cloud/bigquery/storage/v1/storage.proto | 4 + .../cloud/bigquery/storage/v1/stream.proto | 22 + .../protos/protos.d.ts | 24 +- .../protos/protos.js | 276 +++++++++- .../protos/protos.json | 33 +- .../v1/big_query_write.get_write_stream.js | 5 + ...data.google.cloud.bigquery.storage.v1.json | 6 +- .../src/v1/big_query_read_client.ts | 6 +- .../src/v1/big_query_read_proto_list.json | 1 + .../src/v1/big_query_write_client.ts | 13 +- .../src/v1/big_query_write_proto_list.json | 1 + .../src/v1beta1/big_query_storage_client.ts | 12 +- .../test/gapic_big_query_read_v1.ts | 265 +++++---- .../test/gapic_big_query_storage_v1beta1.ts | 516 ++++++++++-------- .../test/gapic_big_query_write_v1.ts | 466 ++++++++-------- 17 files changed, 1073 insertions(+), 609 deletions(-) create mode 100644 packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/annotations.proto diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 0453492655c..a74cc2991f9 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -27,7 +27,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^3.3.0" + "google-gax": "^3.5.2" }, "devDependencies": { "@types/mocha": "^9.0.0", @@ -44,7 +44,7 @@ "pack-n-play": "^1.0.0-2", "sinon": "^14.0.0", "ts-loader": "^9.0.0", - "typescript": "^4.6.4", + "typescript": "^4.8.3", "webpack": "^5.0.0", "webpack-cli": "^4.0.0" }, diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/annotations.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/annotations.proto new file mode 100644 index 00000000000..1627fd12a0c --- /dev/null +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/annotations.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; + +package google.cloud.bigquery.storage.v1; + +import "google/protobuf/descriptor.proto"; + +option csharp_namespace = "Google.Cloud.BigQuery.Storage.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1;storage"; +option java_package = "com.google.cloud.bigquery.storage.v1"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationsProto"; +option php_namespace = "Google\\Cloud\\BigQuery\\Storage\\V1"; + +extend google.protobuf.FieldOptions { + // Setting the column_name extension allows users to reference + // bigquery column independently of the field name in the protocol buffer + // message. + // + // The intended use of this annotation is to reference a destination column + // named using characters unavailable for protobuf field names (e.g. unicode + // characters). + // + // More details about BigQuery naming limitations can be found here: + // https://cloud.google.com/bigquery/docs/schemas#column_names + // + // This extension is currently experimental. + optional string column_name = 454943157; +} diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto index e0b25c1afef..a49e1a389c2 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto @@ -524,6 +524,10 @@ message GetWriteStreamRequest { type: "bigquerystorage.googleapis.com/WriteStream" } ]; + + // Indicates whether to get full or partial view of the WriteStream. If + // not set, view returned will be basic. + WriteStreamView view = 3; } // Request message for `BatchCommitWriteStreams`. diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto index 3735c73d670..fe71adfa6b7 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/stream.proto @@ -203,6 +203,23 @@ message ReadStream { string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; } +// WriteStreamView is a view enum that controls what details about a write +// stream should be returned. +enum WriteStreamView { + // The default / unset value. + WRITE_STREAM_VIEW_UNSPECIFIED = 0; + + // The BASIC projection returns basic metadata about a write stream. The + // basic view does not include schema information. This is the default view + // returned by GetWriteStream. + BASIC = 1; + + // The FULL projection returns all available write stream metadata, including + // the schema. CreateWriteStream returns the full projection of write stream + // metadata. + FULL = 2; +} + // Information about a single stream that gets data inside the storage system. message WriteStream { option (google.api.resource) = { @@ -261,4 +278,9 @@ message WriteStream { // Immutable. Mode of the stream. WriteMode write_mode = 7 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The geographic location where the stream's dataset resides. See + // https://cloud.google.com/bigquery/docs/locations for supported + // locations. + string location = 8 [(google.api.field_behavior) = IMMUTABLE]; } diff --git a/packages/google-cloud-bigquery-storage/protos/protos.d.ts b/packages/google-cloud-bigquery-storage/protos/protos.d.ts index 6dcd8c08147..7d4eae00205 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-storage/protos/protos.d.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Long = require("long"); import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); /** Namespace google. */ export namespace google { @@ -2483,6 +2483,9 @@ export namespace google { /** GetWriteStreamRequest name */ name?: (string|null); + + /** GetWriteStreamRequest view */ + view?: (google.cloud.bigquery.storage.v1.WriteStreamView|keyof typeof google.cloud.bigquery.storage.v1.WriteStreamView|null); } /** Represents a GetWriteStreamRequest. */ @@ -2497,6 +2500,9 @@ export namespace google { /** GetWriteStreamRequest name. */ public name: string; + /** GetWriteStreamRequest view. */ + public view: (google.cloud.bigquery.storage.v1.WriteStreamView|keyof typeof google.cloud.bigquery.storage.v1.WriteStreamView); + /** * Creates a new GetWriteStreamRequest instance using the specified properties. * @param [properties] Properties to set @@ -3901,6 +3907,13 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** WriteStreamView enum. */ + enum WriteStreamView { + WRITE_STREAM_VIEW_UNSPECIFIED = 0, + BASIC = 1, + FULL = 2 + } + /** Properties of a WriteStream. */ interface IWriteStream { @@ -3921,6 +3934,9 @@ export namespace google { /** WriteStream writeMode */ writeMode?: (google.cloud.bigquery.storage.v1.WriteStream.WriteMode|keyof typeof google.cloud.bigquery.storage.v1.WriteStream.WriteMode|null); + + /** WriteStream location */ + location?: (string|null); } /** Represents a WriteStream. */ @@ -3950,6 +3966,9 @@ export namespace google { /** WriteStream writeMode. */ public writeMode: (google.cloud.bigquery.storage.v1.WriteStream.WriteMode|keyof typeof google.cloud.bigquery.storage.v1.WriteStream.WriteMode); + /** WriteStream location. */ + public location: string; + /** * Creates a new WriteStream instance using the specified properties. * @param [properties] Properties to set @@ -8663,6 +8682,9 @@ export namespace google { /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** FieldOptions .google.cloud.bigquery.storage.v1.columnName */ + ".google.cloud.bigquery.storage.v1.columnName"?: (string|null); + /** FieldOptions .google.api.fieldBehavior */ ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); diff --git a/packages/google-cloud-bigquery-storage/protos/protos.js b/packages/google-cloud-bigquery-storage/protos/protos.js index 156259548cb..53da7298f1a 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.js +++ b/packages/google-cloud-bigquery-storage/protos/protos.js @@ -693,6 +693,12 @@ return object; var message = new $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions(); switch (object.bufferCompression) { + default: + if (typeof object.bufferCompression === "number") { + message.bufferCompression = object.bufferCompression; + break; + } + break; case "COMPRESSION_UNSPECIFIED": case 0: message.bufferCompression = 0; @@ -725,7 +731,7 @@ if (options.defaults) object.bufferCompression = options.enums === String ? "COMPRESSION_UNSPECIFIED" : 0; if (message.bufferCompression != null && message.hasOwnProperty("bufferCompression")) - object.bufferCompression = options.enums === String ? $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.CompressionCodec[message.bufferCompression] : message.bufferCompression; + object.bufferCompression = options.enums === String ? $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.CompressionCodec[message.bufferCompression] === undefined ? message.bufferCompression : $root.google.cloud.bigquery.storage.v1.ArrowSerializationOptions.CompressionCodec[message.bufferCompression] : message.bufferCompression; return object; }; @@ -5631,6 +5637,7 @@ * @memberof google.cloud.bigquery.storage.v1 * @interface IGetWriteStreamRequest * @property {string|null} [name] GetWriteStreamRequest name + * @property {google.cloud.bigquery.storage.v1.WriteStreamView|null} [view] GetWriteStreamRequest view */ /** @@ -5656,6 +5663,14 @@ */ GetWriteStreamRequest.prototype.name = ""; + /** + * GetWriteStreamRequest view. + * @member {google.cloud.bigquery.storage.v1.WriteStreamView} view + * @memberof google.cloud.bigquery.storage.v1.GetWriteStreamRequest + * @instance + */ + GetWriteStreamRequest.prototype.view = 0; + /** * Creates a new GetWriteStreamRequest instance using the specified properties. * @function create @@ -5682,6 +5697,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.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.view); return writer; }; @@ -5720,6 +5737,10 @@ message.name = reader.string(); break; } + case 3: { + message.view = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -5758,6 +5779,15 @@ if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -5775,6 +5805,26 @@ var message = new $root.google.cloud.bigquery.storage.v1.GetWriteStreamRequest(); if (object.name != null) message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "WRITE_STREAM_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } return message; }; @@ -5791,10 +5841,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.view = options.enums === String ? "WRITE_STREAM_VIEW_UNSPECIFIED" : 0; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.bigquery.storage.v1.WriteStreamView[message.view] === undefined ? message.view : $root.google.cloud.bigquery.storage.v1.WriteStreamView[message.view] : message.view; return object; }; @@ -7391,6 +7445,12 @@ return object; var message = new $root.google.cloud.bigquery.storage.v1.StorageError(); switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.code; + break; + } + break; case "STORAGE_ERROR_CODE_UNSPECIFIED": case 0: message.code = 0; @@ -7458,7 +7518,7 @@ object.errorMessage = ""; } if (message.code != null && message.hasOwnProperty("code")) - object.code = options.enums === String ? $root.google.cloud.bigquery.storage.v1.StorageError.StorageErrorCode[message.code] : message.code; + object.code = options.enums === String ? $root.google.cloud.bigquery.storage.v1.StorageError.StorageErrorCode[message.code] === undefined ? message.code : $root.google.cloud.bigquery.storage.v1.StorageError.StorageErrorCode[message.code] : message.code; if (message.entity != null && message.hasOwnProperty("entity")) object.entity = message.entity; if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) @@ -7725,6 +7785,12 @@ else if (typeof object.index === "object") message.index = new $util.LongBits(object.index.low >>> 0, object.index.high >>> 0).toNumber(); switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.code; + break; + } + break; case "ROW_ERROR_CODE_UNSPECIFIED": case 0: message.code = 0; @@ -7767,7 +7833,7 @@ else object.index = options.longs === String ? $util.Long.prototype.toString.call(message.index) : options.longs === Number ? new $util.LongBits(message.index.low >>> 0, message.index.high >>> 0).toNumber() : message.index; if (message.code != null && message.hasOwnProperty("code")) - object.code = options.enums === String ? $root.google.cloud.bigquery.storage.v1.RowError.RowErrorCode[message.code] : message.code; + object.code = options.enums === String ? $root.google.cloud.bigquery.storage.v1.RowError.RowErrorCode[message.code] === undefined ? message.code : $root.google.cloud.bigquery.storage.v1.RowError.RowErrorCode[message.code] : message.code; if (message.message != null && message.hasOwnProperty("message")) object.message = message.message; return object; @@ -8218,6 +8284,12 @@ message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); } switch (object.dataFormat) { + default: + if (typeof object.dataFormat === "number") { + message.dataFormat = object.dataFormat; + break; + } + break; case "DATA_FORMAT_UNSPECIFIED": case 0: message.dataFormat = 0; @@ -8311,7 +8383,7 @@ if (message.expireTime != null && message.hasOwnProperty("expireTime")) object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); if (message.dataFormat != null && message.hasOwnProperty("dataFormat")) - object.dataFormat = options.enums === String ? $root.google.cloud.bigquery.storage.v1.DataFormat[message.dataFormat] : message.dataFormat; + object.dataFormat = options.enums === String ? $root.google.cloud.bigquery.storage.v1.DataFormat[message.dataFormat] === undefined ? message.dataFormat : $root.google.cloud.bigquery.storage.v1.DataFormat[message.dataFormat] : message.dataFormat; if (message.avroSchema != null && message.hasOwnProperty("avroSchema")) { object.avroSchema = $root.google.cloud.bigquery.storage.v1.AvroSchema.toObject(message.avroSchema, options); if (options.oneofs) @@ -9109,6 +9181,22 @@ return ReadStream; })(); + /** + * WriteStreamView enum. + * @name google.cloud.bigquery.storage.v1.WriteStreamView + * @enum {number} + * @property {number} WRITE_STREAM_VIEW_UNSPECIFIED=0 WRITE_STREAM_VIEW_UNSPECIFIED value + * @property {number} BASIC=1 BASIC value + * @property {number} FULL=2 FULL value + */ + v1.WriteStreamView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WRITE_STREAM_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASIC"] = 1; + values[valuesById[2] = "FULL"] = 2; + return values; + })(); + v1.WriteStream = (function() { /** @@ -9121,6 +9209,7 @@ * @property {google.protobuf.ITimestamp|null} [commitTime] WriteStream commitTime * @property {google.cloud.bigquery.storage.v1.ITableSchema|null} [tableSchema] WriteStream tableSchema * @property {google.cloud.bigquery.storage.v1.WriteStream.WriteMode|null} [writeMode] WriteStream writeMode + * @property {string|null} [location] WriteStream location */ /** @@ -9186,6 +9275,14 @@ */ WriteStream.prototype.writeMode = 0; + /** + * WriteStream location. + * @member {string} location + * @memberof google.cloud.bigquery.storage.v1.WriteStream + * @instance + */ + WriteStream.prototype.location = ""; + /** * Creates a new WriteStream instance using the specified properties. * @function create @@ -9222,6 +9319,8 @@ $root.google.cloud.bigquery.storage.v1.TableSchema.encode(message.tableSchema, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.writeMode != null && Object.hasOwnProperty.call(message, "writeMode")) writer.uint32(/* id 7, wireType 0 =*/56).int32(message.writeMode); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.location); return writer; }; @@ -9280,6 +9379,10 @@ message.writeMode = reader.int32(); break; } + case 8: { + message.location = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -9351,6 +9454,9 @@ case 1: break; } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; return null; }; @@ -9369,6 +9475,12 @@ if (object.name != null) message.name = String(object.name); switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "TYPE_UNSPECIFIED": case 0: message.type = 0; @@ -9402,6 +9514,12 @@ message.tableSchema = $root.google.cloud.bigquery.storage.v1.TableSchema.fromObject(object.tableSchema); } switch (object.writeMode) { + default: + if (typeof object.writeMode === "number") { + message.writeMode = object.writeMode; + break; + } + break; case "WRITE_MODE_UNSPECIFIED": case 0: message.writeMode = 0; @@ -9411,6 +9529,8 @@ message.writeMode = 1; break; } + if (object.location != null) + message.location = String(object.location); return message; }; @@ -9434,11 +9554,12 @@ object.commitTime = null; object.tableSchema = null; object.writeMode = options.enums === String ? "WRITE_MODE_UNSPECIFIED" : 0; + object.location = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.bigquery.storage.v1.WriteStream.Type[message.type] : message.type; + object.type = options.enums === String ? $root.google.cloud.bigquery.storage.v1.WriteStream.Type[message.type] === undefined ? message.type : $root.google.cloud.bigquery.storage.v1.WriteStream.Type[message.type] : message.type; if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.commitTime != null && message.hasOwnProperty("commitTime")) @@ -9446,7 +9567,9 @@ if (message.tableSchema != null && message.hasOwnProperty("tableSchema")) object.tableSchema = $root.google.cloud.bigquery.storage.v1.TableSchema.toObject(message.tableSchema, options); if (message.writeMode != null && message.hasOwnProperty("writeMode")) - object.writeMode = options.enums === String ? $root.google.cloud.bigquery.storage.v1.WriteStream.WriteMode[message.writeMode] : message.writeMode; + object.writeMode = options.enums === String ? $root.google.cloud.bigquery.storage.v1.WriteStream.WriteMode[message.writeMode] === undefined ? message.writeMode : $root.google.cloud.bigquery.storage.v1.WriteStream.WriteMode[message.writeMode] : message.writeMode; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; return object; }; @@ -10049,6 +10172,12 @@ if (object.name != null) message.name = String(object.name); switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "TYPE_UNSPECIFIED": case 0: message.type = 0; @@ -10115,6 +10244,12 @@ break; } switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; case "MODE_UNSPECIFIED": case 0: message.mode = 0; @@ -10213,9 +10348,9 @@ if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.bigquery.storage.v1.TableFieldSchema.Type[message.type] : message.type; + object.type = options.enums === String ? $root.google.cloud.bigquery.storage.v1.TableFieldSchema.Type[message.type] === undefined ? message.type : $root.google.cloud.bigquery.storage.v1.TableFieldSchema.Type[message.type] : message.type; if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.cloud.bigquery.storage.v1.TableFieldSchema.Mode[message.mode] : message.mode; + object.mode = options.enums === String ? $root.google.cloud.bigquery.storage.v1.TableFieldSchema.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.bigquery.storage.v1.TableFieldSchema.Mode[message.mode] : message.mode; if (message.fields && message.fields.length) { object.fields = []; for (var j = 0; j < message.fields.length; ++j) @@ -12511,6 +12646,12 @@ message.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.fromObject(object.tableModifiers); } switch (object.shardingStrategy) { + default: + if (typeof object.shardingStrategy === "number") { + message.shardingStrategy = object.shardingStrategy; + break; + } + break; case "SHARDING_STRATEGY_UNSPECIFIED": case 0: message.shardingStrategy = 0; @@ -12573,7 +12714,7 @@ if (message.tableModifiers != null && message.hasOwnProperty("tableModifiers")) object.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.toObject(message.tableModifiers, options); if (message.shardingStrategy != null && message.hasOwnProperty("shardingStrategy")) - object.shardingStrategy = options.enums === String ? $root.google.cloud.bigquery.storage.v1beta1.ShardingStrategy[message.shardingStrategy] : message.shardingStrategy; + object.shardingStrategy = options.enums === String ? $root.google.cloud.bigquery.storage.v1beta1.ShardingStrategy[message.shardingStrategy] === undefined ? message.shardingStrategy : $root.google.cloud.bigquery.storage.v1beta1.ShardingStrategy[message.shardingStrategy] : message.shardingStrategy; return object; }; @@ -12901,6 +13042,12 @@ message.readOptions = $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions.fromObject(object.readOptions); } switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; case "DATA_FORMAT_UNSPECIFIED": case 0: message.format = 0; @@ -12915,6 +13062,12 @@ break; } switch (object.shardingStrategy) { + default: + if (typeof object.shardingStrategy === "number") { + message.shardingStrategy = object.shardingStrategy; + break; + } + break; case "SHARDING_STRATEGY_UNSPECIFIED": case 0: message.shardingStrategy = 0; @@ -12962,11 +13115,11 @@ if (message.readOptions != null && message.hasOwnProperty("readOptions")) object.readOptions = $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions.toObject(message.readOptions, options); if (message.format != null && message.hasOwnProperty("format")) - object.format = options.enums === String ? $root.google.cloud.bigquery.storage.v1beta1.DataFormat[message.format] : message.format; + object.format = options.enums === String ? $root.google.cloud.bigquery.storage.v1beta1.DataFormat[message.format] === undefined ? message.format : $root.google.cloud.bigquery.storage.v1beta1.DataFormat[message.format] : message.format; if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.shardingStrategy != null && message.hasOwnProperty("shardingStrategy")) - object.shardingStrategy = options.enums === String ? $root.google.cloud.bigquery.storage.v1beta1.ShardingStrategy[message.shardingStrategy] : message.shardingStrategy; + object.shardingStrategy = options.enums === String ? $root.google.cloud.bigquery.storage.v1beta1.ShardingStrategy[message.shardingStrategy] === undefined ? message.shardingStrategy : $root.google.cloud.bigquery.storage.v1beta1.ShardingStrategy[message.shardingStrategy] : message.shardingStrategy; return object; }; @@ -18438,6 +18591,12 @@ if (object.number != null) message.number = object.number | 0; switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; case "LABEL_OPTIONAL": case 1: message.label = 1; @@ -18452,6 +18611,12 @@ break; } switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "TYPE_DOUBLE": case 1: message.type = 1; @@ -18578,9 +18743,9 @@ if (message.number != null && message.hasOwnProperty("number")) object.number = message.number; if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; if (message.typeName != null && message.hasOwnProperty("typeName")) object.typeName = message.typeName; if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) @@ -20927,6 +21092,12 @@ if (object.javaStringCheckUtf8 != null) message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; case "SPEED": case 1: message.optimizeFor = 1; @@ -21035,7 +21206,7 @@ if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) object.javaOuterClassname = message.javaOuterClassname; if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) object.javaMultipleFiles = message.javaMultipleFiles; if (message.goPackage != null && message.hasOwnProperty("goPackage")) @@ -21488,6 +21659,7 @@ * @property {boolean|null} [deprecated] FieldOptions deprecated * @property {boolean|null} [weak] FieldOptions weak * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {string|null} [".google.cloud.bigquery.storage.v1.columnName"] FieldOptions .google.cloud.bigquery.storage.v1.columnName * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference */ @@ -21573,6 +21745,14 @@ */ FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * FieldOptions .google.cloud.bigquery.storage.v1.columnName. + * @member {string} .google.cloud.bigquery.storage.v1.columnName + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.cloud.bigquery.storage.v1.columnName"] = null; + /** * FieldOptions .google.api.fieldBehavior. * @member {Array.} .google.api.fieldBehavior @@ -21638,6 +21818,8 @@ } 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(); + if (message[".google.cloud.bigquery.storage.v1.columnName"] != null && Object.hasOwnProperty.call(message, ".google.cloud.bigquery.storage.v1.columnName")) + writer.uint32(/* id 454943157, wireType 2 =*/3639545258).string(message[".google.cloud.bigquery.storage.v1.columnName"]); return writer; }; @@ -21706,6 +21888,10 @@ message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; } + case 454943157: { + message[".google.cloud.bigquery.storage.v1.columnName"] = reader.string(); + break; + } case 1052: { if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) message[".google.api.fieldBehavior"] = []; @@ -21798,6 +21984,9 @@ return "uninterpretedOption." + error; } } + if (message[".google.cloud.bigquery.storage.v1.columnName"] != null && message.hasOwnProperty(".google.cloud.bigquery.storage.v1.columnName")) + if (!$util.isString(message[".google.cloud.bigquery.storage.v1.columnName"])) + return ".google.cloud.bigquery.storage.v1.columnName: string expected"; if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { if (!Array.isArray(message[".google.api.fieldBehavior"])) return ".google.api.fieldBehavior: array expected"; @@ -21837,6 +22026,12 @@ return object; var message = new $root.google.protobuf.FieldOptions(); switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; case "STRING": case 0: message.ctype = 0; @@ -21853,6 +22048,12 @@ if (object.packed != null) message.packed = Boolean(object.packed); switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; case "JS_NORMAL": case 0: message.jstype = 0; @@ -21884,6 +22085,8 @@ message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } + if (object[".google.cloud.bigquery.storage.v1.columnName"] != null) + message[".google.cloud.bigquery.storage.v1.columnName"] = String(object[".google.cloud.bigquery.storage.v1.columnName"]); if (object[".google.api.fieldBehavior"]) { if (!Array.isArray(object[".google.api.fieldBehavior"])) throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); @@ -21891,6 +22094,10 @@ for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) switch (object[".google.api.fieldBehavior"][i]) { default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } case "FIELD_BEHAVIOR_UNSPECIFIED": case 0: message[".google.api.fieldBehavior"][i] = 0; @@ -21959,9 +22166,10 @@ object.weak = false; object.unverifiedLazy = false; object[".google.api.resourceReference"] = null; + object[".google.cloud.bigquery.storage.v1.columnName"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; if (message.packed != null && message.hasOwnProperty("packed")) object.packed = message.packed; if (message.deprecated != null && message.hasOwnProperty("deprecated")) @@ -21969,7 +22177,7 @@ if (message.lazy != null && message.hasOwnProperty("lazy")) object.lazy = message.lazy; if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; if (message.weak != null && message.hasOwnProperty("weak")) object.weak = message.weak; if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) @@ -21982,10 +22190,12 @@ if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { object[".google.api.fieldBehavior"] = []; for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; } if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + if (message[".google.cloud.bigquery.storage.v1.columnName"] != null && message.hasOwnProperty(".google.cloud.bigquery.storage.v1.columnName")) + object[".google.cloud.bigquery.storage.v1.columnName"] = message[".google.cloud.bigquery.storage.v1.columnName"]; return object; }; @@ -23339,6 +23549,12 @@ if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; case "IDEMPOTENCY_UNKNOWN": case 0: message.idempotencyLevel = 0; @@ -23402,7 +23618,7 @@ if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -25155,6 +25371,12 @@ if (object.end != null) message.end = object.end | 0; switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; case "NONE": case 0: message.semantic = 0; @@ -25204,7 +25426,7 @@ if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; return object; }; @@ -29077,6 +29299,12 @@ if (object.nameField != null) message.nameField = String(object.nameField); switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; case "HISTORY_UNSPECIFIED": case 0: message.history = 0; @@ -29101,6 +29329,10 @@ for (var i = 0; i < object.style.length; ++i) switch (object.style[i]) { default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } case "STYLE_UNSPECIFIED": case 0: message.style[i] = 0; @@ -29148,7 +29380,7 @@ if (message.nameField != null && message.hasOwnProperty("nameField")) object.nameField = message.nameField; if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; if (message.plural != null && message.hasOwnProperty("plural")) object.plural = message.plural; if (message.singular != null && message.hasOwnProperty("singular")) @@ -29156,7 +29388,7 @@ if (message.style && message.style.length) { object.style = []; for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; } return object; }; diff --git a/packages/google-cloud-bigquery-storage/protos/protos.json b/packages/google-cloud-bigquery-storage/protos/protos.json index e2fa6466986..e8388095ced 100644 --- a/packages/google-cloud-bigquery-storage/protos/protos.json +++ b/packages/google-cloud-bigquery-storage/protos/protos.json @@ -12,14 +12,27 @@ "options": { "csharp_namespace": "Google.Cloud.BigQuery.Storage.V1", "go_package": "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1;storage", + "java_package": "com.google.cloud.bigquery.storage.v1", "java_multiple_files": true, "java_outer_classname": "TableProto", - "java_package": "com.google.cloud.bigquery.storage.v1", "php_namespace": "Google\\Cloud\\BigQuery\\Storage\\V1", "(google.api.resource_definition).type": "bigquery.googleapis.com/Table", "(google.api.resource_definition).pattern": "projects/{project}/datasets/{dataset}/tables/{table}" }, "nested": { + "_columnName": { + "oneof": [ + "columnName" + ] + }, + "columnName": { + "type": "string", + "id": 454943157, + "extend": "google.protobuf.FieldOptions", + "options": { + "proto3_optional": true + } + }, "ArrowSchema": { "fields": { "serializedSchema": { @@ -566,6 +579,10 @@ "(google.api.field_behavior)": "REQUIRED", "(google.api.resource_reference).type": "bigquerystorage.googleapis.com/WriteStream" } + }, + "view": { + "type": "WriteStreamView", + "id": 3 } } }, @@ -864,6 +881,13 @@ } } }, + "WriteStreamView": { + "values": { + "WRITE_STREAM_VIEW_UNSPECIFIED": 0, + "BASIC": 1, + "FULL": 2 + } + }, "WriteStream": { "options": { "(google.api.resource).type": "bigquerystorage.googleapis.com/WriteStream", @@ -911,6 +935,13 @@ "options": { "(google.api.field_behavior)": "IMMUTABLE" } + }, + "location": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } } }, "nested": { diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.get_write_stream.js b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.get_write_stream.js index 2d83ddbe23b..79b10927e9b 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.get_write_stream.js +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/big_query_write.get_write_stream.js @@ -33,6 +33,11 @@ function main(name) { * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. */ // const name = 'abc123' + /** + * Indicates whether to get full or partial view of the WriteStream. If + * not set, view returned will be basic. + */ + // const view = {} // Imports the Storage library const {BigQueryWriteClient} = require('@google-cloud/bigquery-storage').v1; diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json b/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json index 6ff22b675bd..2e0e3c58628 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json @@ -258,7 +258,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 59, "type": "FULL" } ], @@ -270,6 +270,10 @@ { "name": "name", "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.bigquery.storage.v1.WriteStreamView" } ], "resultType": ".google.cloud.bigquery.storage.v1.WriteStream", diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts index 7ba3e1e633e..1a78d38a741 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_client.ts @@ -485,7 +485,7 @@ export class BigQueryReadClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'read_session.table': request.readSession!.table || '', + 'read_session.table': request.readSession!.table ?? '', }); this.initialize(); return this.innerApiCalls.createReadSession(request, options, callback); @@ -601,7 +601,7 @@ export class BigQueryReadClient { 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.splitReadStream(request, options, callback); @@ -644,7 +644,7 @@ export class BigQueryReadClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - read_stream: request.readStream || '', + read_stream: request.readStream ?? '', }); this.initialize(); return this.innerApiCalls.readRows(request, options); diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_proto_list.json b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_proto_list.json index f0274ac3660..d730716117c 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_read_proto_list.json +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_read_proto_list.json @@ -1,4 +1,5 @@ [ + "../../protos/google/cloud/bigquery/storage/v1/annotations.proto", "../../protos/google/cloud/bigquery/storage/v1/arrow.proto", "../../protos/google/cloud/bigquery/storage/v1/avro.proto", "../../protos/google/cloud/bigquery/storage/v1/protobuf.proto", diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts index 10a5b597c6f..77b988cef24 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts @@ -459,7 +459,7 @@ export class BigQueryWriteClient { 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.createWriteStream(request, options, callback); @@ -472,6 +472,9 @@ export class BigQueryWriteClient { * @param {string} request.name * Required. Name of the stream to get, in the form of * `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. + * @param {google.cloud.bigquery.storage.v1.WriteStreamView} request.view + * Indicates whether to get full or partial view of the WriteStream. If + * not set, view returned will be basic. * @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. @@ -557,7 +560,7 @@ export class BigQueryWriteClient { 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.getWriteStream(request, options, callback); @@ -656,7 +659,7 @@ export class BigQueryWriteClient { 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.finalizeWriteStream(request, options, callback); @@ -761,7 +764,7 @@ export class BigQueryWriteClient { 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.batchCommitWriteStreams( @@ -866,7 +869,7 @@ export class BigQueryWriteClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - write_stream: request.writeStream || '', + write_stream: request.writeStream ?? '', }); this.initialize(); return this.innerApiCalls.flushRows(request, options, callback); diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_proto_list.json b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_proto_list.json index f0274ac3660..d730716117c 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_proto_list.json +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_proto_list.json @@ -1,4 +1,5 @@ [ + "../../protos/google/cloud/bigquery/storage/v1/annotations.proto", "../../protos/google/cloud/bigquery/storage/v1/arrow.proto", "../../protos/google/cloud/bigquery/storage/v1/avro.proto", "../../protos/google/cloud/bigquery/storage/v1/protobuf.proto", diff --git a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts index 9b545b1af42..19120696d61 100644 --- a/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1beta1/big_query_storage_client.ts @@ -473,8 +473,8 @@ export class BigQueryStorageClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'table_reference.project_id': request.tableReference!.projectId || '', - 'table_reference.dataset_id': request.tableReference!.datasetId || '', + 'table_reference.project_id': request.tableReference!.projectId ?? '', + 'table_reference.dataset_id': request.tableReference!.datasetId ?? '', }); this.initialize(); return this.innerApiCalls.createReadSession(request, options, callback); @@ -578,7 +578,7 @@ export class BigQueryStorageClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'session.name': request.session!.name || '', + 'session.name': request.session!.name ?? '', }); this.initialize(); return this.innerApiCalls.batchCreateReadSessionStreams( @@ -692,7 +692,7 @@ export class BigQueryStorageClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'stream.name': request.stream!.name || '', + 'stream.name': request.stream!.name ?? '', }); this.initialize(); return this.innerApiCalls.finalizeStream(request, options, callback); @@ -809,7 +809,7 @@ export class BigQueryStorageClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'original_stream.name': request.originalStream!.name || '', + 'original_stream.name': request.originalStream!.name ?? '', }); this.initialize(); return this.innerApiCalls.splitReadStream(request, options, callback); @@ -852,7 +852,7 @@ export class BigQueryStorageClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'read_position.stream.name': request.readPosition!.stream!.name || '', + 'read_position.stream.name': request.readPosition!.stream!.name ?? '', }); this.initialize(); return this.innerApiCalls.readRows(request, options); diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts index 18113a85423..cd2a50bb2c1 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_v1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_read_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 @@ -180,27 +195,27 @@ describe('v1.BigQueryReadClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.CreateReadSessionRequest() ); - request.readSession = {}; - request.readSession.table = ''; - const expectedHeaderRequestParams = 'read_session.table='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.readSession ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.CreateReadSessionRequest', + ['readSession', 'table'] + ); + request.readSession.table = defaultValue1; + const expectedHeaderRequestParams = `read_session.table=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.ReadSession() ); client.innerApiCalls.createReadSession = stubSimpleCall(expectedResponse); const [response] = await client.createReadSession(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createReadSession as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createReadSession as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createReadSession as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createReadSession without error using callback', async () => { @@ -212,16 +227,13 @@ describe('v1.BigQueryReadClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.CreateReadSessionRequest() ); - request.readSession = {}; - request.readSession.table = ''; - const expectedHeaderRequestParams = 'read_session.table='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.readSession ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.CreateReadSessionRequest', + ['readSession', 'table'] + ); + request.readSession.table = defaultValue1; + const expectedHeaderRequestParams = `read_session.table=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.ReadSession() ); @@ -244,11 +256,14 @@ describe('v1.BigQueryReadClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createReadSession as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createReadSession as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createReadSession as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createReadSession with error', async () => { @@ -260,27 +275,27 @@ describe('v1.BigQueryReadClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.CreateReadSessionRequest() ); - request.readSession = {}; - request.readSession.table = ''; - const expectedHeaderRequestParams = 'read_session.table='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.readSession ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.CreateReadSessionRequest', + ['readSession', 'table'] + ); + request.readSession.table = defaultValue1; + const expectedHeaderRequestParams = `read_session.table=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createReadSession = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.createReadSession(request), expectedError); - assert( - (client.innerApiCalls.createReadSession as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createReadSession as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createReadSession as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createReadSession with closed client', async () => { @@ -292,8 +307,12 @@ describe('v1.BigQueryReadClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.CreateReadSessionRequest() ); - request.readSession = {}; - request.readSession.table = ''; + request.readSession ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.CreateReadSessionRequest', + ['readSession', 'table'] + ); + request.readSession.table = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createReadSession(request), expectedError); @@ -310,26 +329,26 @@ describe('v1.BigQueryReadClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.SplitReadStreamRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.SplitReadStreamRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.SplitReadStreamResponse() ); client.innerApiCalls.splitReadStream = stubSimpleCall(expectedResponse); const [response] = await client.splitReadStream(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.splitReadStream as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.splitReadStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.splitReadStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes splitReadStream without error using callback', async () => { @@ -341,15 +360,12 @@ describe('v1.BigQueryReadClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.SplitReadStreamRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.SplitReadStreamRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.SplitReadStreamResponse() ); @@ -372,11 +388,14 @@ describe('v1.BigQueryReadClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.splitReadStream as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.splitReadStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.splitReadStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes splitReadStream with error', async () => { @@ -388,26 +407,26 @@ describe('v1.BigQueryReadClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.SplitReadStreamRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.SplitReadStreamRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.splitReadStream = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.splitReadStream(request), expectedError); - assert( - (client.innerApiCalls.splitReadStream as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.splitReadStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.splitReadStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes splitReadStream with closed client', async () => { @@ -419,7 +438,11 @@ describe('v1.BigQueryReadClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.SplitReadStreamRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.SplitReadStreamRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.splitReadStream(request), expectedError); @@ -436,15 +459,12 @@ describe('v1.BigQueryReadClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.ReadRowsRequest() ); - request.readStream = ''; - const expectedHeaderRequestParams = 'read_stream='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.ReadRowsRequest', + ['readStream'] + ); + request.readStream = defaultValue1; + const expectedHeaderRequestParams = `read_stream=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.ReadRowsResponse() ); @@ -465,11 +485,14 @@ describe('v1.BigQueryReadClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.readRows as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions) - ); + const actualRequest = ( + client.innerApiCalls.readRows as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readRows as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes readRows with error', async () => { @@ -481,15 +504,12 @@ describe('v1.BigQueryReadClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.ReadRowsRequest() ); - request.readStream = ''; - const expectedHeaderRequestParams = 'read_stream='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.ReadRowsRequest', + ['readStream'] + ); + request.readStream = defaultValue1; + const expectedHeaderRequestParams = `read_stream=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.readRows = stubServerStreamingCall( undefined, @@ -510,11 +530,14 @@ describe('v1.BigQueryReadClient', () => { }); }); await assert.rejects(promise, expectedError); - assert( - (client.innerApiCalls.readRows as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions) - ); + const actualRequest = ( + client.innerApiCalls.readRows as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readRows as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes readRows with closed client', async () => { @@ -526,7 +549,11 @@ describe('v1.BigQueryReadClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.ReadRowsRequest() ); - request.readStream = ''; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.ReadRowsRequest', + ['readStream'] + ); + request.readStream = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); const stream = client.readRows(request); diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts index 7e38e445bce..3623068f487 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_storage_v1beta1.ts @@ -27,6 +27,21 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -182,30 +197,33 @@ describe('v1beta1.BigQueryStorageClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest() ); - request.tableReference = {}; - request.tableReference.projectId = ''; - request.tableReference = {}; - request.tableReference.datasetId = ''; - const expectedHeaderRequestParams = - 'table_reference.project_id=&table_reference.dataset_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.tableReference ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest', + ['tableReference', 'projectId'] + ); + request.tableReference.projectId = defaultValue1; + request.tableReference ??= {}; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest', + ['tableReference', 'datasetId'] + ); + request.tableReference.datasetId = defaultValue2; + const expectedHeaderRequestParams = `table_reference.project_id=${defaultValue1}&table_reference.dataset_id=${defaultValue2}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.ReadSession() ); client.innerApiCalls.createReadSession = stubSimpleCall(expectedResponse); const [response] = await client.createReadSession(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createReadSession as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createReadSession as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createReadSession as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createReadSession without error using callback', async () => { @@ -217,19 +235,19 @@ describe('v1beta1.BigQueryStorageClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest() ); - request.tableReference = {}; - request.tableReference.projectId = ''; - request.tableReference = {}; - request.tableReference.datasetId = ''; - const expectedHeaderRequestParams = - 'table_reference.project_id=&table_reference.dataset_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.tableReference ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest', + ['tableReference', 'projectId'] + ); + request.tableReference.projectId = defaultValue1; + request.tableReference ??= {}; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest', + ['tableReference', 'datasetId'] + ); + request.tableReference.datasetId = defaultValue2; + const expectedHeaderRequestParams = `table_reference.project_id=${defaultValue1}&table_reference.dataset_id=${defaultValue2}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.ReadSession() ); @@ -252,11 +270,14 @@ describe('v1beta1.BigQueryStorageClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createReadSession as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createReadSession as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createReadSession as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createReadSession with error', async () => { @@ -268,30 +289,33 @@ describe('v1beta1.BigQueryStorageClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest() ); - request.tableReference = {}; - request.tableReference.projectId = ''; - request.tableReference = {}; - request.tableReference.datasetId = ''; - const expectedHeaderRequestParams = - 'table_reference.project_id=&table_reference.dataset_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.tableReference ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest', + ['tableReference', 'projectId'] + ); + request.tableReference.projectId = defaultValue1; + request.tableReference ??= {}; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest', + ['tableReference', 'datasetId'] + ); + request.tableReference.datasetId = defaultValue2; + const expectedHeaderRequestParams = `table_reference.project_id=${defaultValue1}&table_reference.dataset_id=${defaultValue2}`; const expectedError = new Error('expected'); client.innerApiCalls.createReadSession = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.createReadSession(request), expectedError); - assert( - (client.innerApiCalls.createReadSession as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createReadSession as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createReadSession as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createReadSession with closed client', async () => { @@ -303,10 +327,18 @@ describe('v1beta1.BigQueryStorageClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest() ); - request.tableReference = {}; - request.tableReference.projectId = ''; - request.tableReference = {}; - request.tableReference.datasetId = ''; + request.tableReference ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest', + ['tableReference', 'projectId'] + ); + request.tableReference.projectId = defaultValue1; + request.tableReference ??= {}; + const defaultValue2 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest', + ['tableReference', 'datasetId'] + ); + request.tableReference.datasetId = defaultValue2; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createReadSession(request), expectedError); @@ -323,16 +355,13 @@ describe('v1beta1.BigQueryStorageClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest() ); - request.session = {}; - request.session.name = ''; - const expectedHeaderRequestParams = 'session.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.session ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest', + ['session', 'name'] + ); + request.session.name = defaultValue1; + const expectedHeaderRequestParams = `session.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse() ); @@ -340,11 +369,14 @@ describe('v1beta1.BigQueryStorageClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.batchCreateReadSessionStreams(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchCreateReadSessionStreams as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchCreateReadSessionStreams as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateReadSessionStreams as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCreateReadSessionStreams without error using callback', async () => { @@ -356,16 +388,13 @@ describe('v1beta1.BigQueryStorageClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest() ); - request.session = {}; - request.session.name = ''; - const expectedHeaderRequestParams = 'session.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.session ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest', + ['session', 'name'] + ); + request.session.name = defaultValue1; + const expectedHeaderRequestParams = `session.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse() ); @@ -388,11 +417,14 @@ describe('v1beta1.BigQueryStorageClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchCreateReadSessionStreams as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.batchCreateReadSessionStreams as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateReadSessionStreams as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCreateReadSessionStreams with error', async () => { @@ -404,16 +436,13 @@ describe('v1beta1.BigQueryStorageClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest() ); - request.session = {}; - request.session.name = ''; - const expectedHeaderRequestParams = 'session.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.session ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest', + ['session', 'name'] + ); + request.session.name = defaultValue1; + const expectedHeaderRequestParams = `session.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateReadSessionStreams = stubSimpleCall( undefined, @@ -423,11 +452,14 @@ describe('v1beta1.BigQueryStorageClient', () => { client.batchCreateReadSessionStreams(request), expectedError ); - assert( - (client.innerApiCalls.batchCreateReadSessionStreams as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchCreateReadSessionStreams as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateReadSessionStreams as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCreateReadSessionStreams with closed client', async () => { @@ -439,8 +471,12 @@ describe('v1beta1.BigQueryStorageClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest() ); - request.session = {}; - request.session.name = ''; + request.session ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest', + ['session', 'name'] + ); + request.session.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -460,27 +496,27 @@ describe('v1beta1.BigQueryStorageClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest() ); - request.stream = {}; - request.stream.name = ''; - const expectedHeaderRequestParams = 'stream.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.stream ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest', + ['stream', 'name'] + ); + request.stream.name = defaultValue1; + const expectedHeaderRequestParams = `stream.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); client.innerApiCalls.finalizeStream = stubSimpleCall(expectedResponse); const [response] = await client.finalizeStream(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.finalizeStream as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.finalizeStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.finalizeStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes finalizeStream without error using callback', async () => { @@ -492,16 +528,13 @@ describe('v1beta1.BigQueryStorageClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest() ); - request.stream = {}; - request.stream.name = ''; - const expectedHeaderRequestParams = 'stream.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.stream ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest', + ['stream', 'name'] + ); + request.stream.name = defaultValue1; + const expectedHeaderRequestParams = `stream.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -524,11 +557,14 @@ describe('v1beta1.BigQueryStorageClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.finalizeStream as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.finalizeStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.finalizeStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes finalizeStream with error', async () => { @@ -540,27 +576,27 @@ describe('v1beta1.BigQueryStorageClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest() ); - request.stream = {}; - request.stream.name = ''; - const expectedHeaderRequestParams = 'stream.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.stream ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest', + ['stream', 'name'] + ); + request.stream.name = defaultValue1; + const expectedHeaderRequestParams = `stream.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.finalizeStream = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.finalizeStream(request), expectedError); - assert( - (client.innerApiCalls.finalizeStream as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.finalizeStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.finalizeStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes finalizeStream with closed client', async () => { @@ -572,8 +608,12 @@ describe('v1beta1.BigQueryStorageClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest() ); - request.stream = {}; - request.stream.name = ''; + request.stream ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest', + ['stream', 'name'] + ); + request.stream.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.finalizeStream(request), expectedError); @@ -590,27 +630,27 @@ describe('v1beta1.BigQueryStorageClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest() ); - request.originalStream = {}; - request.originalStream.name = ''; - const expectedHeaderRequestParams = 'original_stream.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.originalStream ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest', + ['originalStream', 'name'] + ); + request.originalStream.name = defaultValue1; + const expectedHeaderRequestParams = `original_stream.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse() ); client.innerApiCalls.splitReadStream = stubSimpleCall(expectedResponse); const [response] = await client.splitReadStream(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.splitReadStream as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.splitReadStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.splitReadStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes splitReadStream without error using callback', async () => { @@ -622,16 +662,13 @@ describe('v1beta1.BigQueryStorageClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest() ); - request.originalStream = {}; - request.originalStream.name = ''; - const expectedHeaderRequestParams = 'original_stream.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.originalStream ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest', + ['originalStream', 'name'] + ); + request.originalStream.name = defaultValue1; + const expectedHeaderRequestParams = `original_stream.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse() ); @@ -654,11 +691,14 @@ describe('v1beta1.BigQueryStorageClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.splitReadStream as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.splitReadStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.splitReadStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes splitReadStream with error', async () => { @@ -670,27 +710,27 @@ describe('v1beta1.BigQueryStorageClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest() ); - request.originalStream = {}; - request.originalStream.name = ''; - const expectedHeaderRequestParams = 'original_stream.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.originalStream ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest', + ['originalStream', 'name'] + ); + request.originalStream.name = defaultValue1; + const expectedHeaderRequestParams = `original_stream.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.splitReadStream = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.splitReadStream(request), expectedError); - assert( - (client.innerApiCalls.splitReadStream as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.splitReadStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.splitReadStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes splitReadStream with closed client', async () => { @@ -702,8 +742,12 @@ describe('v1beta1.BigQueryStorageClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest() ); - request.originalStream = {}; - request.originalStream.name = ''; + request.originalStream ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest', + ['originalStream', 'name'] + ); + request.originalStream.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.splitReadStream(request), expectedError); @@ -720,17 +764,14 @@ describe('v1beta1.BigQueryStorageClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest() ); - request.readPosition = {}; - request.readPosition.stream = {}; - request.readPosition.stream.name = ''; - const expectedHeaderRequestParams = 'read_position.stream.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.readPosition ??= {}; + request.readPosition.stream ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest', + ['readPosition', 'stream', 'name'] + ); + request.readPosition.stream.name = defaultValue1; + const expectedHeaderRequestParams = `read_position.stream.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.ReadRowsResponse() ); @@ -751,11 +792,14 @@ describe('v1beta1.BigQueryStorageClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.readRows as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions) - ); + const actualRequest = ( + client.innerApiCalls.readRows as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readRows as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes readRows with error', async () => { @@ -767,17 +811,14 @@ describe('v1beta1.BigQueryStorageClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest() ); - request.readPosition = {}; - request.readPosition.stream = {}; - request.readPosition.stream.name = ''; - const expectedHeaderRequestParams = 'read_position.stream.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.readPosition ??= {}; + request.readPosition.stream ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest', + ['readPosition', 'stream', 'name'] + ); + request.readPosition.stream.name = defaultValue1; + const expectedHeaderRequestParams = `read_position.stream.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.readRows = stubServerStreamingCall( undefined, @@ -798,11 +839,14 @@ describe('v1beta1.BigQueryStorageClient', () => { }); }); await assert.rejects(promise, expectedError); - assert( - (client.innerApiCalls.readRows as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions) - ); + const actualRequest = ( + client.innerApiCalls.readRows as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readRows as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes readRows with closed client', async () => { @@ -814,9 +858,13 @@ describe('v1beta1.BigQueryStorageClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest() ); - request.readPosition = {}; - request.readPosition.stream = {}; - request.readPosition.stream.name = ''; + request.readPosition ??= {}; + request.readPosition.stream ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest', + ['readPosition', 'stream', 'name'] + ); + request.readPosition.stream.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); const stream = client.readRows(request); diff --git a/packages/google-cloud-bigquery-storage/test/gapic_big_query_write_v1.ts b/packages/google-cloud-bigquery-storage/test/gapic_big_query_write_v1.ts index c27c4dfd91f..830e18a06bb 100644 --- a/packages/google-cloud-bigquery-storage/test/gapic_big_query_write_v1.ts +++ b/packages/google-cloud-bigquery-storage/test/gapic_big_query_write_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 @@ -175,26 +190,26 @@ describe('v1.BigQueryWriteClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.CreateWriteStreamRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.CreateWriteStreamRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.WriteStream() ); client.innerApiCalls.createWriteStream = stubSimpleCall(expectedResponse); const [response] = await client.createWriteStream(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createWriteStream as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createWriteStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWriteStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createWriteStream without error using callback', async () => { @@ -206,15 +221,12 @@ describe('v1.BigQueryWriteClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.CreateWriteStreamRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.CreateWriteStreamRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.WriteStream() ); @@ -237,11 +249,14 @@ describe('v1.BigQueryWriteClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createWriteStream as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createWriteStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWriteStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createWriteStream with error', async () => { @@ -253,26 +268,26 @@ describe('v1.BigQueryWriteClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.CreateWriteStreamRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.CreateWriteStreamRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createWriteStream = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.createWriteStream(request), expectedError); - assert( - (client.innerApiCalls.createWriteStream as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createWriteStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWriteStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createWriteStream with closed client', async () => { @@ -284,7 +299,11 @@ describe('v1.BigQueryWriteClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.CreateWriteStreamRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.CreateWriteStreamRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createWriteStream(request), expectedError); @@ -301,26 +320,26 @@ describe('v1.BigQueryWriteClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.GetWriteStreamRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.GetWriteStreamRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.WriteStream() ); client.innerApiCalls.getWriteStream = stubSimpleCall(expectedResponse); const [response] = await client.getWriteStream(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getWriteStream as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getWriteStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWriteStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getWriteStream without error using callback', async () => { @@ -332,15 +351,12 @@ describe('v1.BigQueryWriteClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.GetWriteStreamRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.GetWriteStreamRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.WriteStream() ); @@ -363,11 +379,14 @@ describe('v1.BigQueryWriteClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getWriteStream as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getWriteStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWriteStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getWriteStream with error', async () => { @@ -379,26 +398,26 @@ describe('v1.BigQueryWriteClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.GetWriteStreamRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.GetWriteStreamRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getWriteStream = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.getWriteStream(request), expectedError); - assert( - (client.innerApiCalls.getWriteStream as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getWriteStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWriteStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getWriteStream with closed client', async () => { @@ -410,7 +429,11 @@ describe('v1.BigQueryWriteClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.GetWriteStreamRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.GetWriteStreamRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getWriteStream(request), expectedError); @@ -427,15 +450,12 @@ describe('v1.BigQueryWriteClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse() ); @@ -443,11 +463,14 @@ describe('v1.BigQueryWriteClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.finalizeWriteStream(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.finalizeWriteStream as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.finalizeWriteStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.finalizeWriteStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes finalizeWriteStream without error using callback', async () => { @@ -459,15 +482,12 @@ describe('v1.BigQueryWriteClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse() ); @@ -490,11 +510,14 @@ describe('v1.BigQueryWriteClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.finalizeWriteStream as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.finalizeWriteStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.finalizeWriteStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes finalizeWriteStream with error', async () => { @@ -506,26 +529,26 @@ describe('v1.BigQueryWriteClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.finalizeWriteStream = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.finalizeWriteStream(request), expectedError); - assert( - (client.innerApiCalls.finalizeWriteStream as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.finalizeWriteStream as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.finalizeWriteStream as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes finalizeWriteStream with closed client', async () => { @@ -537,7 +560,11 @@ describe('v1.BigQueryWriteClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.FinalizeWriteStreamRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.finalizeWriteStream(request), expectedError); @@ -554,15 +581,12 @@ describe('v1.BigQueryWriteClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse() ); @@ -570,11 +594,14 @@ describe('v1.BigQueryWriteClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.batchCommitWriteStreams(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchCommitWriteStreams as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchCommitWriteStreams as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCommitWriteStreams as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCommitWriteStreams without error using callback', async () => { @@ -586,15 +613,12 @@ describe('v1.BigQueryWriteClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse() ); @@ -617,11 +641,14 @@ describe('v1.BigQueryWriteClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchCommitWriteStreams as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.batchCommitWriteStreams as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCommitWriteStreams as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCommitWriteStreams with error', async () => { @@ -633,15 +660,12 @@ describe('v1.BigQueryWriteClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCommitWriteStreams = stubSimpleCall( undefined, @@ -651,11 +675,14 @@ describe('v1.BigQueryWriteClient', () => { client.batchCommitWriteStreams(request), expectedError ); - assert( - (client.innerApiCalls.batchCommitWriteStreams as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchCommitWriteStreams as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCommitWriteStreams as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCommitWriteStreams with closed client', async () => { @@ -667,7 +694,11 @@ describe('v1.BigQueryWriteClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -687,26 +718,26 @@ describe('v1.BigQueryWriteClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.FlushRowsRequest() ); - request.writeStream = ''; - const expectedHeaderRequestParams = 'write_stream='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.FlushRowsRequest', + ['writeStream'] + ); + request.writeStream = defaultValue1; + const expectedHeaderRequestParams = `write_stream=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.FlushRowsResponse() ); client.innerApiCalls.flushRows = stubSimpleCall(expectedResponse); const [response] = await client.flushRows(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.flushRows as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.flushRows as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.flushRows as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes flushRows without error using callback', async () => { @@ -718,15 +749,12 @@ describe('v1.BigQueryWriteClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.FlushRowsRequest() ); - request.writeStream = ''; - const expectedHeaderRequestParams = 'write_stream='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.FlushRowsRequest', + ['writeStream'] + ); + request.writeStream = defaultValue1; + const expectedHeaderRequestParams = `write_stream=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.FlushRowsResponse() ); @@ -749,11 +777,14 @@ describe('v1.BigQueryWriteClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.flushRows as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.flushRows as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.flushRows as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes flushRows with error', async () => { @@ -765,23 +796,23 @@ describe('v1.BigQueryWriteClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.FlushRowsRequest() ); - request.writeStream = ''; - const expectedHeaderRequestParams = 'write_stream='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.FlushRowsRequest', + ['writeStream'] + ); + request.writeStream = defaultValue1; + const expectedHeaderRequestParams = `write_stream=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.flushRows = stubSimpleCall(undefined, expectedError); await assert.rejects(client.flushRows(request), expectedError); - assert( - (client.innerApiCalls.flushRows as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.flushRows as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.flushRows as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes flushRows with closed client', async () => { @@ -793,7 +824,11 @@ describe('v1.BigQueryWriteClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.FlushRowsRequest() ); - request.writeStream = ''; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.bigquery.storage.v1.FlushRowsRequest', + ['writeStream'] + ); + request.writeStream = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.flushRows(request), expectedError); @@ -810,6 +845,7 @@ describe('v1.BigQueryWriteClient', () => { const request = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.AppendRowsRequest() ); + const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.storage.v1.AppendRowsResponse() ); From 71fac4cc4b6184f3a6a582209aaf9d122ef665a1 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Nov 2022 01:40:38 +0000 Subject: [PATCH 179/182] docs: remove stale header guidance for AppendRows (#299) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 485941276 Source-Link: https://togithub.com/googleapis/googleapis/commit/a5f5928e736ea88c03e48c506a19fa632b43de9e Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/61ebfaa325101bc9b29ee34900b45b2f0d23981e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjFlYmZhYTMyNTEwMWJjOWIyOWVlMzQ5MDBiNDViMmYwZDIzOTgxZSJ9 BEGIN_NESTED_COMMIT chore: override API mixins when needed PiperOrigin-RevId: 477248447 Source-Link: https://togithub.com/googleapis/googleapis/commit/4689c7380444972caf11fd1b96e7ec1f864b7dfb Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/c4059786a5cd805a0151d95b477fbc486bcbcedc Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzQwNTk3ODZhNWNkODA1YTAxNTFkOTViNDc3ZmJjNDg2YmNiY2VkYyJ9 END_NESTED_COMMIT --- .../protos/google/cloud/bigquery/storage/v1/storage.proto | 7 ------- .../snippet_metadata.google.cloud.bigquery.storage.v1.json | 2 +- .../src/v1/big_query_write_client.ts | 7 ------- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto index a49e1a389c2..df602135b9d 100644 --- a/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto +++ b/packages/google-cloud-bigquery-storage/protos/google/cloud/bigquery/storage/v1/storage.proto @@ -167,13 +167,6 @@ service BigQueryWrite { // * For PENDING streams, data is not made visible until the stream itself is // finalized (via the `FinalizeWriteStream` rpc), and the stream is explicitly // committed via the `BatchCommitWriteStreams` rpc. - // - // Note: For users coding against the gRPC api directly, it may be - // necessary to supply the x-goog-request-params system parameter - // with `write_stream=`. - // - // More information about system parameters: - // https://cloud.google.com/apis/docs/system-parameters rpc AppendRows(stream AppendRowsRequest) returns (stream AppendRowsResponse) { option (google.api.http) = { post: "/v1/{write_stream=projects/*/datasets/*/tables/*/streams/*}" diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json b/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json index 2e0e3c58628..a2be29a2776 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json @@ -199,7 +199,7 @@ "regionTag": "bigquerystorage_v1_generated_BigQueryWrite_AppendRows_async", "title": "BigQueryRead appendRows Sample", "origin": "API_DEFINITION", - "description": " Appends data to the given stream. If `offset` is specified, the `offset` is checked against the end of stream. The server returns `OUT_OF_RANGE` in `AppendRowsResponse` if an attempt is made to append to an offset beyond the current end of the stream or `ALREADY_EXISTS` if user provides an `offset` that has already been written to. User can retry with adjusted offset within the same RPC connection. If `offset` is not specified, append happens at the end of the stream. The response contains an optional offset at which the append happened. No offset information will be returned for appends to a default stream. Responses are received in the same order in which requests are sent. There will be one response for each successful inserted request. Responses may optionally embed error information if the originating AppendRequest was not successfully processed. The specifics of when successfully appended data is made visible to the table are governed by the type of stream: * For COMMITTED streams (which includes the default stream), data is visible immediately upon successful append. * For BUFFERED streams, data is made visible via a subsequent `FlushRows` rpc which advances a cursor to a newer offset in the stream. * For PENDING streams, data is not made visible until the stream itself is finalized (via the `FinalizeWriteStream` rpc), and the stream is explicitly committed via the `BatchCommitWriteStreams` rpc. Note: For users coding against the gRPC api directly, it may be necessary to supply the x-goog-request-params system parameter with `write_stream=`. More information about system parameters: https://cloud.google.com/apis/docs/system-parameters", + "description": " Appends data to the given stream. If `offset` is specified, the `offset` is checked against the end of stream. The server returns `OUT_OF_RANGE` in `AppendRowsResponse` if an attempt is made to append to an offset beyond the current end of the stream or `ALREADY_EXISTS` if user provides an `offset` that has already been written to. User can retry with adjusted offset within the same RPC connection. If `offset` is not specified, append happens at the end of the stream. The response contains an optional offset at which the append happened. No offset information will be returned for appends to a default stream. Responses are received in the same order in which requests are sent. There will be one response for each successful inserted request. Responses may optionally embed error information if the originating AppendRequest was not successfully processed. The specifics of when successfully appended data is made visible to the table are governed by the type of stream: * For COMMITTED streams (which includes the default stream), data is visible immediately upon successful append. * For BUFFERED streams, data is made visible via a subsequent `FlushRows` rpc which advances a cursor to a newer offset in the stream. * For PENDING streams, data is not made visible until the stream itself is finalized (via the `FinalizeWriteStream` rpc), and the stream is explicitly committed via the `BatchCommitWriteStreams` rpc.", "canonical": true, "file": "big_query_write.append_rows.js", "language": "JAVASCRIPT", diff --git a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts index 77b988cef24..6e002a67e7c 100644 --- a/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts +++ b/packages/google-cloud-bigquery-storage/src/v1/big_query_write_client.ts @@ -908,13 +908,6 @@ export class BigQueryWriteClient { * finalized (via the `FinalizeWriteStream` rpc), and the stream is explicitly * committed via the `BatchCommitWriteStreams` rpc. * - * Note: For users coding against the gRPC api directly, it may be - * necessary to supply the x-goog-request-params system parameter - * with `write_stream=`. - * - * More information about system parameters: - * https://cloud.google.com/apis/docs/system-parameters - * * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} From 30f25b54649d52268127238a6bf1efd3dd8bb74c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 11 Nov 2022 02:48:17 +0100 Subject: [PATCH 180/182] chore(deps): update dependency jsdoc to v4 (#302) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [jsdoc](https://togithub.com/jsdoc/jsdoc) | [`^3.6.3` -> `^4.0.0`](https://renovatebot.com/diffs/npm/jsdoc/3.6.11/4.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/compatibility-slim/3.6.11)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/confidence-slim/3.6.11)](https://docs.renovatebot.com/merge-confidence/) | --- ### 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**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-bigquery-storage). --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index a74cc2991f9..477b77d3bd8 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -35,7 +35,7 @@ "@types/sinon": "^10.0.0", "c8": "^7.1.0", "gts": "^3.1.0", - "jsdoc": "^3.6.3", + "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "linkinator": "^4.0.0", From 3111b0a679a78a005bd52b2941b7519ca5d1a5f6 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 11 Nov 2022 10:34:13 +0100 Subject: [PATCH 181/182] chore(deps): update dependency @types/node to v18 (#301) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node) ([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped)) | [`^16.0.0` -> `^18.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/16.18.3/18.11.9) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/compatibility-slim/16.18.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/confidence-slim/16.18.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-bigquery-storage). --- packages/google-cloud-bigquery-storage/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 477b77d3bd8..4662fb96c9d 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -31,7 +31,7 @@ }, "devDependencies": { "@types/mocha": "^9.0.0", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "@types/sinon": "^10.0.0", "c8": "^7.1.0", "gts": "^3.1.0", From 46744adc69c50d54110f76c0a0a77bd07913fc47 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 11 Nov 2022 10:04:13 +0000 Subject: [PATCH 182/182] chore(main): release 3.2.0 (#298) :robot: I have created a release *beep* *boop* --- ## [3.2.0](https://togithub.com/googleapis/nodejs-bigquery-storage/compare/v3.1.1...v3.2.0) (2022-11-11) ### Features * Add location to WriteStream and add WriteStreamView support ([#295](https://togithub.com/googleapis/nodejs-bigquery-storage/issues/295)) ([ba3c5ef](https://togithub.com/googleapis/nodejs-bigquery-storage/commit/ba3c5ef05366b1e9a542b9b13fc0c7a25118b2a3)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- packages/google-cloud-bigquery-storage/CHANGELOG.md | 7 +++++++ packages/google-cloud-bigquery-storage/package.json | 2 +- .../snippet_metadata.google.cloud.bigquery.storage.v1.json | 2 +- ...pet_metadata.google.cloud.bigquery.storage.v1beta1.json | 2 +- .../google-cloud-bigquery-storage/samples/package.json | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-bigquery-storage/CHANGELOG.md b/packages/google-cloud-bigquery-storage/CHANGELOG.md index 33229aabf90..eeb46ea09fd 100644 --- a/packages/google-cloud-bigquery-storage/CHANGELOG.md +++ b/packages/google-cloud-bigquery-storage/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.2.0](https://github.com/googleapis/nodejs-bigquery-storage/compare/v3.1.1...v3.2.0) (2022-11-11) + + +### Features + +* Add location to WriteStream and add WriteStreamView support ([#295](https://github.com/googleapis/nodejs-bigquery-storage/issues/295)) ([ba3c5ef](https://github.com/googleapis/nodejs-bigquery-storage/commit/ba3c5ef05366b1e9a542b9b13fc0c7a25118b2a3)) + ## [3.1.1](https://github.com/googleapis/nodejs-bigquery-storage/compare/v3.1.0...v3.1.1) (2022-09-01) diff --git a/packages/google-cloud-bigquery-storage/package.json b/packages/google-cloud-bigquery-storage/package.json index 4662fb96c9d..2d6e2462757 100644 --- a/packages/google-cloud-bigquery-storage/package.json +++ b/packages/google-cloud-bigquery-storage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-storage", - "version": "3.1.1", + "version": "3.2.0", "description": "Client for the BigQuery Storage API", "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json b/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json index a2be29a2776..94f815441aa 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1/snippet_metadata.google.cloud.bigquery.storage.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-storage", - "version": "3.1.1", + "version": "3.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json index 3e4305f2828..0f8c9365858 100644 --- a/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json +++ b/packages/google-cloud-bigquery-storage/samples/generated/v1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-storage", - "version": "3.1.1", + "version": "3.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-bigquery-storage/samples/package.json b/packages/google-cloud-bigquery-storage/samples/package.json index baf43987c43..caf3fc634fc 100644 --- a/packages/google-cloud-bigquery-storage/samples/package.json +++ b/packages/google-cloud-bigquery-storage/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^3.1.1", + "@google-cloud/bigquery-storage": "^3.2.0", "avsc": "^5.4.18", "google-protobuf": "^3.19.1", "snappy": "^7.0.0"