From 0fe3567b17709ab4944efea9f4a961f7c2f64c14 Mon Sep 17 00:00:00 2001 From: steffnay Date: Wed, 8 Jan 2020 11:29:58 -0800 Subject: [PATCH 01/12] initial generation --- .eslintignore | 5 + .eslintrc.yml | 15 + .github/ISSUE_TEMPLATE/bug_report.md | 33 + .github/ISSUE_TEMPLATE/feature_request.md | 18 + .github/ISSUE_TEMPLATE/support_request.md | 7 + .github/PULL_REQUEST_TEMPLATE.md | 7 + .github/release-please.yml | 1 + .gitignore | 14 + .jsdoc.js | 48 + .kokoro/common.cfg | 24 + .kokoro/continuous/node10/common.cfg | 34 + .kokoro/continuous/node10/docs.cfg | 4 + .kokoro/continuous/node10/lint.cfg | 4 + .kokoro/continuous/node10/samples-test.cfg | 7 + .kokoro/continuous/node10/system-test.cfg | 7 + .kokoro/continuous/node10/test.cfg | 9 + .kokoro/continuous/node12/common.cfg | 24 + .kokoro/continuous/node12/test.cfg | 0 .kokoro/continuous/node8/common.cfg | 24 + .kokoro/continuous/node8/test.cfg | 0 .kokoro/docs.sh | 25 + .kokoro/lint.sh | 33 + .kokoro/presubmit/node10/common.cfg | 34 + .kokoro/presubmit/node10/docs.cfg | 4 + .kokoro/presubmit/node10/lint.cfg | 4 + .kokoro/presubmit/node10/samples-test.cfg | 7 + .kokoro/presubmit/node10/system-test.cfg | 7 + .kokoro/presubmit/node10/test.cfg | 0 .kokoro/presubmit/node12/common.cfg | 24 + .kokoro/presubmit/node12/test.cfg | 0 .kokoro/presubmit/node8/common.cfg | 24 + .kokoro/presubmit/node8/test.cfg | 0 .kokoro/presubmit/windows/common.cfg | 2 + .kokoro/presubmit/windows/test.cfg | 2 + .kokoro/publish.sh | 31 + .kokoro/release/docs.cfg | 26 + .kokoro/release/docs.sh | 50 + .kokoro/release/publish.cfg | 74 + .kokoro/samples-test.sh | 57 + .kokoro/system-test.sh | 49 + .kokoro/test.bat | 35 + .kokoro/test.sh | 37 + .kokoro/trampoline.sh | 27 + .nycrc | 24 + .prettierignore | 3 + .prettierrc | 8 + codecov.yaml | 4 + linkinator.config.json | 7 + package.json | 49 + .../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 ++ renovate.json | 19 + src/index.ts | 24 + src/v1beta1/big_query_storage_client.ts | 707 + .../big_query_storage_client_config.json | 54 + src/v1beta1/big_query_storage_proto_list.json | 7 + src/v1beta1/index.ts | 19 + synth.metadata | 31 + 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 | 364 + tsconfig.json | 19 + tslint.json | 3 + webpack.config.js | 64 + 71 files changed, 26420 insertions(+) create mode 100644 .eslintignore create mode 100644 .eslintrc.yml create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/support_request.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/release-please.yml create mode 100644 .gitignore create mode 100644 .jsdoc.js create mode 100644 .kokoro/common.cfg create mode 100644 .kokoro/continuous/node10/common.cfg create mode 100644 .kokoro/continuous/node10/docs.cfg create mode 100644 .kokoro/continuous/node10/lint.cfg create mode 100644 .kokoro/continuous/node10/samples-test.cfg create mode 100644 .kokoro/continuous/node10/system-test.cfg create mode 100644 .kokoro/continuous/node10/test.cfg create mode 100644 .kokoro/continuous/node12/common.cfg create mode 100644 .kokoro/continuous/node12/test.cfg create mode 100644 .kokoro/continuous/node8/common.cfg create mode 100644 .kokoro/continuous/node8/test.cfg create mode 100755 .kokoro/docs.sh create mode 100755 .kokoro/lint.sh create mode 100644 .kokoro/presubmit/node10/common.cfg create mode 100644 .kokoro/presubmit/node10/docs.cfg create mode 100644 .kokoro/presubmit/node10/lint.cfg create mode 100644 .kokoro/presubmit/node10/samples-test.cfg create mode 100644 .kokoro/presubmit/node10/system-test.cfg create mode 100644 .kokoro/presubmit/node10/test.cfg create mode 100644 .kokoro/presubmit/node12/common.cfg create mode 100644 .kokoro/presubmit/node12/test.cfg create mode 100644 .kokoro/presubmit/node8/common.cfg create mode 100644 .kokoro/presubmit/node8/test.cfg create mode 100644 .kokoro/presubmit/windows/common.cfg create mode 100644 .kokoro/presubmit/windows/test.cfg create mode 100755 .kokoro/publish.sh create mode 100644 .kokoro/release/docs.cfg create mode 100755 .kokoro/release/docs.sh create mode 100644 .kokoro/release/publish.cfg create mode 100755 .kokoro/samples-test.sh create mode 100755 .kokoro/system-test.sh create mode 100644 .kokoro/test.bat create mode 100755 .kokoro/test.sh create mode 100755 .kokoro/trampoline.sh create mode 100644 .nycrc create mode 100644 .prettierignore create mode 100644 .prettierrc create mode 100644 codecov.yaml create mode 100644 linkinator.config.json create mode 100644 package.json create mode 100644 protos/google/cloud/bigquery/storage/v1beta1/arrow.proto create mode 100644 protos/google/cloud/bigquery/storage/v1beta1/avro.proto create mode 100644 protos/google/cloud/bigquery/storage/v1beta1/read_options.proto create mode 100644 protos/google/cloud/bigquery/storage/v1beta1/storage.proto create mode 100644 protos/google/cloud/bigquery/storage/v1beta1/table_reference.proto create mode 100644 protos/protos.d.ts create mode 100644 protos/protos.js create mode 100644 protos/protos.json create mode 100644 renovate.json create mode 100644 src/index.ts create mode 100644 src/v1beta1/big_query_storage_client.ts create mode 100644 src/v1beta1/big_query_storage_client_config.json create mode 100644 src/v1beta1/big_query_storage_proto_list.json create mode 100644 src/v1beta1/index.ts create mode 100644 synth.metadata create mode 100644 system-test/fixtures/sample/src/index.js create mode 100644 system-test/fixtures/sample/src/index.ts create mode 100644 system-test/install.ts create mode 100644 test/gapic-big_query_storage-v1beta1.ts create mode 100644 tsconfig.json create mode 100644 tslint.json create mode 100644 webpack.config.js diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..09b31fe7 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,5 @@ +**/node_modules +src/**/doc/* +build/ +docs/ +protos/ diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 00000000..73eeec27 --- /dev/null +++ b/.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/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..2e31ed8d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,33 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. + +Please run down the following list and make sure you've tried the usual "quick fixes": + + - Search the issues already opened: https://github.com/googleapis/nodejs-storage/issues + - Search the issues on our "catch-all" repository: https://github.com/googleapis/google-cloud-node + - Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js + +If you are still having issues, please be sure to include as much information as possible: + +#### Environment details + + - OS: + - Node.js version: + - npm version: + - `@google-cloud/bigquery-storage` version: + +#### Steps to reproduce + + 1. ? + 2. ? + +Making sure to follow these steps will guarantee the quickest resolution possible. + +Thanks! diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..6365857f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,18 @@ +--- +name: Feature request +about: Suggest an idea for this library + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. + + **Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + **Describe the solution you'd like** +A clear and concise description of what you want to happen. + **Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + **Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/support_request.md b/.github/ISSUE_TEMPLATE/support_request.md new file mode 100644 index 00000000..99586903 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/support_request.md @@ -0,0 +1,7 @@ +--- +name: Support request +about: If you have a support contract with Google, please create an issue in the Google Cloud Support console. + +--- + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..ff0961bf --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,7 @@ +Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: +- [ ] Make sure to open an issue as a [bug/issue](https://github.com//issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea +- [ ] Ensure the tests and linter pass +- [ ] Code coverage does not decrease (if any source code was changed) +- [ ] Appropriate docs were updated (if necessary) + +Fixes # 🦕 diff --git a/.github/release-please.yml b/.github/release-please.yml new file mode 100644 index 00000000..85344b92 --- /dev/null +++ b/.github/release-please.yml @@ -0,0 +1 @@ +releaseType: node diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..baab5550 --- /dev/null +++ b/.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__ \ No newline at end of file diff --git a/.jsdoc.js b/.jsdoc.js new file mode 100644 index 00000000..719a77bf --- /dev/null +++ b/.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/.kokoro/common.cfg b/.kokoro/common.cfg new file mode 100644 index 00000000..9eca1bec --- /dev/null +++ b/.kokoro/common.cfg @@ -0,0 +1,24 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "nodejs-storage/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" +} +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-storage/.kokoro/test.sh" +} diff --git a/.kokoro/continuous/node10/common.cfg b/.kokoro/continuous/node10/common.cfg new file mode 100644 index 00000000..8ce0e4f1 --- /dev/null +++ b/.kokoro/continuous/node10/common.cfg @@ -0,0 +1,34 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Bring in codecov.io master token into the build as $KOKORO_KEYSTORE_DIR/73713_dpebot_codecov_token +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "dpebot_codecov_token" + } + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "nodejs-storage/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" +} +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-storage/.kokoro/test.sh" +} diff --git a/.kokoro/continuous/node10/docs.cfg b/.kokoro/continuous/node10/docs.cfg new file mode 100644 index 00000000..dd810b79 --- /dev/null +++ b/.kokoro/continuous/node10/docs.cfg @@ -0,0 +1,4 @@ +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-storage/.kokoro/docs.sh" +} diff --git a/.kokoro/continuous/node10/lint.cfg b/.kokoro/continuous/node10/lint.cfg new file mode 100644 index 00000000..72c4ad24 --- /dev/null +++ b/.kokoro/continuous/node10/lint.cfg @@ -0,0 +1,4 @@ +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-storage/.kokoro/lint.sh" +} diff --git a/.kokoro/continuous/node10/samples-test.cfg b/.kokoro/continuous/node10/samples-test.cfg new file mode 100644 index 00000000..7757bbb5 --- /dev/null +++ b/.kokoro/continuous/node10/samples-test.cfg @@ -0,0 +1,7 @@ +# Download resources for system tests (service account key, etc.) +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-storage/.kokoro/samples-test.sh" +} diff --git a/.kokoro/continuous/node10/system-test.cfg b/.kokoro/continuous/node10/system-test.cfg new file mode 100644 index 00000000..57fbd1f3 --- /dev/null +++ b/.kokoro/continuous/node10/system-test.cfg @@ -0,0 +1,7 @@ +# Download resources for system tests (service account key, etc.) +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-storage/.kokoro/system-test.sh" +} diff --git a/.kokoro/continuous/node10/test.cfg b/.kokoro/continuous/node10/test.cfg new file mode 100644 index 00000000..468b8c71 --- /dev/null +++ b/.kokoro/continuous/node10/test.cfg @@ -0,0 +1,9 @@ +# Bring in codecov.io master token into the build as $KOKORO_KEYSTORE_DIR/73713_dpebot_codecov_token +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "dpebot_codecov_token" + } + } +} diff --git a/.kokoro/continuous/node12/common.cfg b/.kokoro/continuous/node12/common.cfg new file mode 100644 index 00000000..8d874a0b --- /dev/null +++ b/.kokoro/continuous/node12/common.cfg @@ -0,0 +1,24 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "nodejs-storage/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:12-user" +} +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-storage/.kokoro/test.sh" +} diff --git a/.kokoro/continuous/node12/test.cfg b/.kokoro/continuous/node12/test.cfg new file mode 100644 index 00000000..e69de29b diff --git a/.kokoro/continuous/node8/common.cfg b/.kokoro/continuous/node8/common.cfg new file mode 100644 index 00000000..6a5bb734 --- /dev/null +++ b/.kokoro/continuous/node8/common.cfg @@ -0,0 +1,24 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "nodejs-storage/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:8-user" +} +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-storage/.kokoro/test.sh" +} diff --git a/.kokoro/continuous/node8/test.cfg b/.kokoro/continuous/node8/test.cfg new file mode 100644 index 00000000..e69de29b diff --git a/.kokoro/docs.sh b/.kokoro/docs.sh new file mode 100755 index 00000000..952403fa --- /dev/null +++ b/.kokoro/docs.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +export NPM_CONFIG_PREFIX=/home/node/.npm-global + +cd $(dirname $0)/.. + +npm install + +npm run docs-test diff --git a/.kokoro/lint.sh b/.kokoro/lint.sh new file mode 100755 index 00000000..b03cb043 --- /dev/null +++ b/.kokoro/lint.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +export NPM_CONFIG_PREFIX=/home/node/.npm-global + +cd $(dirname $0)/.. + +npm install + +# Install and link samples +if [ -f samples/package.json ]; then + cd samples/ + npm link ../ + npm install + cd .. +fi + +npm run lint diff --git a/.kokoro/presubmit/node10/common.cfg b/.kokoro/presubmit/node10/common.cfg new file mode 100644 index 00000000..8ce0e4f1 --- /dev/null +++ b/.kokoro/presubmit/node10/common.cfg @@ -0,0 +1,34 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Bring in codecov.io master token into the build as $KOKORO_KEYSTORE_DIR/73713_dpebot_codecov_token +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "dpebot_codecov_token" + } + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "nodejs-storage/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" +} +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-storage/.kokoro/test.sh" +} diff --git a/.kokoro/presubmit/node10/docs.cfg b/.kokoro/presubmit/node10/docs.cfg new file mode 100644 index 00000000..dd810b79 --- /dev/null +++ b/.kokoro/presubmit/node10/docs.cfg @@ -0,0 +1,4 @@ +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-storage/.kokoro/docs.sh" +} diff --git a/.kokoro/presubmit/node10/lint.cfg b/.kokoro/presubmit/node10/lint.cfg new file mode 100644 index 00000000..72c4ad24 --- /dev/null +++ b/.kokoro/presubmit/node10/lint.cfg @@ -0,0 +1,4 @@ +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-storage/.kokoro/lint.sh" +} diff --git a/.kokoro/presubmit/node10/samples-test.cfg b/.kokoro/presubmit/node10/samples-test.cfg new file mode 100644 index 00000000..7757bbb5 --- /dev/null +++ b/.kokoro/presubmit/node10/samples-test.cfg @@ -0,0 +1,7 @@ +# Download resources for system tests (service account key, etc.) +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-storage/.kokoro/samples-test.sh" +} diff --git a/.kokoro/presubmit/node10/system-test.cfg b/.kokoro/presubmit/node10/system-test.cfg new file mode 100644 index 00000000..57fbd1f3 --- /dev/null +++ b/.kokoro/presubmit/node10/system-test.cfg @@ -0,0 +1,7 @@ +# Download resources for system tests (service account key, etc.) +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-storage/.kokoro/system-test.sh" +} diff --git a/.kokoro/presubmit/node10/test.cfg b/.kokoro/presubmit/node10/test.cfg new file mode 100644 index 00000000..e69de29b diff --git a/.kokoro/presubmit/node12/common.cfg b/.kokoro/presubmit/node12/common.cfg new file mode 100644 index 00000000..8d874a0b --- /dev/null +++ b/.kokoro/presubmit/node12/common.cfg @@ -0,0 +1,24 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "nodejs-storage/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:12-user" +} +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-storage/.kokoro/test.sh" +} diff --git a/.kokoro/presubmit/node12/test.cfg b/.kokoro/presubmit/node12/test.cfg new file mode 100644 index 00000000..e69de29b diff --git a/.kokoro/presubmit/node8/common.cfg b/.kokoro/presubmit/node8/common.cfg new file mode 100644 index 00000000..6a5bb734 --- /dev/null +++ b/.kokoro/presubmit/node8/common.cfg @@ -0,0 +1,24 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "nodejs-storage/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:8-user" +} +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-storage/.kokoro/test.sh" +} diff --git a/.kokoro/presubmit/node8/test.cfg b/.kokoro/presubmit/node8/test.cfg new file mode 100644 index 00000000..e69de29b diff --git a/.kokoro/presubmit/windows/common.cfg b/.kokoro/presubmit/windows/common.cfg new file mode 100644 index 00000000..d6e25e0b --- /dev/null +++ b/.kokoro/presubmit/windows/common.cfg @@ -0,0 +1,2 @@ +# Format: //devtools/kokoro/config/proto/build.proto + diff --git a/.kokoro/presubmit/windows/test.cfg b/.kokoro/presubmit/windows/test.cfg new file mode 100644 index 00000000..1ff4b4bf --- /dev/null +++ b/.kokoro/presubmit/windows/test.cfg @@ -0,0 +1,2 @@ +# Use the test file directly +build_file: "nodejs-storage/.kokoro/test.bat" diff --git a/.kokoro/publish.sh b/.kokoro/publish.sh new file mode 100755 index 00000000..ff9c2622 --- /dev/null +++ b/.kokoro/publish.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +export NPM_CONFIG_PREFIX=/home/node/.npm-global + +# Start the releasetool reporter +python3 -m pip install gcp-releasetool +python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script + +cd $(dirname $0)/.. + +NPM_TOKEN=$(cat $KOKORO_KEYSTORE_DIR/73713_google-cloud-bigquery-storage-npm-token) +echo "//wombat-dressing-room.appspot.com/:_authToken=${NPM_TOKEN}" > ~/.npmrc + +npm install +npm publish --access=public --registry=https://wombat-dressing-room.appspot.com diff --git a/.kokoro/release/docs.cfg b/.kokoro/release/docs.cfg new file mode 100644 index 00000000..16c16aa6 --- /dev/null +++ b/.kokoro/release/docs.cfg @@ -0,0 +1,26 @@ +# service account used to publish up-to-date docs. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} + +# doc publications use a Python image. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "nodejs-storage/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-storage/.kokoro/release/docs.sh" +} diff --git a/.kokoro/release/docs.sh b/.kokoro/release/docs.sh new file mode 100755 index 00000000..4d3a0868 --- /dev/null +++ b/.kokoro/release/docs.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +# 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. + +set -eo pipefail + +# build jsdocs (Python is installed on the Node 10 docker image). +if [[ -z "$CREDENTIALS" ]]; then + # if CREDENTIALS are explicitly set, assume we're testing locally + # and don't set NPM_CONFIG_PREFIX. + export NPM_CONFIG_PREFIX=/home/node/.npm-global + export PATH="$PATH:/home/node/.npm-global/bin" + cd $(dirname $0)/../.. +fi +npm install +npm run docs + +# create docs.metadata, based on package.json and .repo-metadata.json. +npm i json@9.0.6 -g +python3 -m pip install --user gcp-docuploader +python3 -m docuploader create-metadata \ + --name=$(cat .repo-metadata.json | json name) \ + --version=$(cat package.json | json version) \ + --language=$(cat .repo-metadata.json | json language) \ + --distribution-name=$(cat .repo-metadata.json | json distribution_name) \ + --product-page=$(cat .repo-metadata.json | json product_documentation) \ + --github-repository=$(cat .repo-metadata.json | json repo) \ + --issue-tracker=$(cat .repo-metadata.json | json issue_tracker) +cp docs.metadata ./docs/docs.metadata + +# deploy the docs. +if [[ -z "$CREDENTIALS" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +fi +if [[ -z "$BUCKET" ]]; then + BUCKET=docs-staging +fi +python3 -m docuploader upload ./docs --credentials $CREDENTIALS --staging-bucket $BUCKET diff --git a/.kokoro/release/publish.cfg b/.kokoro/release/publish.cfg new file mode 100644 index 00000000..6e0e8847 --- /dev/null +++ b/.kokoro/release/publish.cfg @@ -0,0 +1,74 @@ +# Get npm token from Keystore +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "google_cloud_npm_token" + backend_type: FASTCONFIGPUSH + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "yoshi-automation-github-key" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} + +# Fetch magictoken to use with Magic Github Proxy +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "releasetool-magictoken" + } + } +} + +# Fetch api key to use with Magic Github Proxy +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "magic-github-proxy-api-key" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "google-cloud-bigquery-storage-npm-token" + } + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "nodejs-storage/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:8-user" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/nodejs-storage/.kokoro/publish.sh" +} diff --git a/.kokoro/samples-test.sh b/.kokoro/samples-test.sh new file mode 100755 index 00000000..20e3241c --- /dev/null +++ b/.kokoro/samples-test.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +export NPM_CONFIG_PREFIX=/home/node/.npm-global + +# Setup service account credentials. +export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json +export GCLOUD_PROJECT=long-door-651 + +cd $(dirname $0)/.. + +# Run a pre-test hook, if a pre-samples-test.sh is in the project +if [ -f .kokoro/pre-samples-test.sh ]; then + set +x + . .kokoro/pre-samples-test.sh + set -x +fi + +if [ -f samples/package.json ]; then + npm install + + # Install and link samples + cd samples/ + npm link ../ + npm install + cd .. + + npm run samples-test +fi + +# codecov combines coverage across integration and unit tests. Include +# the logic below for any environment you wish to collect coverage for: +COVERAGE_NODE=10 +if npx check-node-version@3.3.0 --silent --node $COVERAGE_NODE; then + NYC_BIN=./node_modules/nyc/bin/nyc.js + if [ -f "$NYC_BIN" ]; then + $NYC_BIN report || true + fi + bash $KOKORO_GFILE_DIR/codecov.sh +else + echo "coverage is only reported for Node $COVERAGE_NODE" +fi diff --git a/.kokoro/system-test.sh b/.kokoro/system-test.sh new file mode 100755 index 00000000..fc5824e6 --- /dev/null +++ b/.kokoro/system-test.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +export NPM_CONFIG_PREFIX=/home/node/.npm-global + +# Setup service account credentials. +export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json +export GCLOUD_PROJECT=long-door-651 + +cd $(dirname $0)/.. + +# Run a pre-test hook, if a pre-system-test.sh is in the project +if [ -f .kokoro/pre-system-test.sh ]; then + set +x + . .kokoro/pre-system-test.sh + set -x +fi + +npm install + +npm run system-test + +# codecov combines coverage across integration and unit tests. Include +# the logic below for any environment you wish to collect coverage for: +COVERAGE_NODE=10 +if npx check-node-version@3.3.0 --silent --node $COVERAGE_NODE; then + NYC_BIN=./node_modules/nyc/bin/nyc.js + if [ -f "$NYC_BIN" ]; then + $NYC_BIN report || true + fi + bash $KOKORO_GFILE_DIR/codecov.sh +else + echo "coverage is only reported for Node $COVERAGE_NODE" +fi diff --git a/.kokoro/test.bat b/.kokoro/test.bat new file mode 100644 index 00000000..fddff757 --- /dev/null +++ b/.kokoro/test.bat @@ -0,0 +1,35 @@ +@rem Copyright 2018 Google LLC. All rights reserved. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. + +@echo "Starting Windows build" + +cd /d %~dp0 +cd .. + +@rem The image we're currently running has a broken version of Node.js enabled +@rem by nvm (v10.15.3), which has no npm bin. This hack uses the functional +@rem Node v8.9.1 to install npm@latest, it then uses this version of npm to +@rem install npm for v10.15.3. +call nvm use v8.9.1 || goto :error +call node C:\Users\kbuilder\AppData\Roaming\nvm-ps\versions\v8.9.1\node_modules\npm-bootstrap\bin\npm-cli.js i npm -g || goto :error +call nvm use v10.15.3 || goto :error +call node C:\Users\kbuilder\AppData\Roaming\nvm-ps\versions\v8.9.1\node_modules\npm\bin\npm-cli.js i npm -g || goto :error + +call npm install || goto :error +call npm run test || goto :error + +goto :EOF + +:error +exit /b 1 diff --git a/.kokoro/test.sh b/.kokoro/test.sh new file mode 100755 index 00000000..9db11bb0 --- /dev/null +++ b/.kokoro/test.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +export NPM_CONFIG_PREFIX=/home/node/.npm-global + +cd $(dirname $0)/.. + +npm install +npm test + +# codecov combines coverage across integration and unit tests. Include +# the logic below for any environment you wish to collect coverage for: +COVERAGE_NODE=10 +if npx check-node-version@3.3.0 --silent --node $COVERAGE_NODE; then + NYC_BIN=./node_modules/nyc/bin/nyc.js + if [ -f "$NYC_BIN" ]; then + $NYC_BIN report || true + fi + bash $KOKORO_GFILE_DIR/codecov.sh +else + echo "coverage is only reported for Node $COVERAGE_NODE" +fi diff --git a/.kokoro/trampoline.sh b/.kokoro/trampoline.sh new file mode 100755 index 00000000..9bd4905c --- /dev/null +++ b/.kokoro/trampoline.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Copyright 2017 Google Inc. +# +# Licensed under the Apache License, Version 2.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. + +set -eo pipefail + +# Always run the cleanup script, regardless of the success of bouncing into +# the container. +function cleanup() { + chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + echo "cleanup"; +} +trap cleanup EXIT + +python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/.nycrc b/.nycrc new file mode 100644 index 00000000..b18d5472 --- /dev/null +++ b/.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/.prettierignore b/.prettierignore new file mode 100644 index 00000000..f6fac98b --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +node_modules/* +samples/node_modules/* +src/**/doc/* diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..df6eac07 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,8 @@ +--- +bracketSpacing: false +printWidth: 80 +semi: true +singleQuote: true +tabWidth: 2 +trailingComma: es5 +useTabs: false diff --git a/codecov.yaml b/codecov.yaml new file mode 100644 index 00000000..5724ea94 --- /dev/null +++ b/codecov.yaml @@ -0,0 +1,4 @@ +--- +codecov: + ci: + - source.cloud.google.com diff --git a/linkinator.config.json b/linkinator.config.json new file mode 100644 index 00000000..d780d6bf --- /dev/null +++ b/linkinator.config.json @@ -0,0 +1,7 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com" + ] +} diff --git a/package.json b/package.json new file mode 100644 index 00000000..89fc39ea --- /dev/null +++ b/package.json @@ -0,0 +1,49 @@ +{ + "name": "@google-cloud/bigquery-storage", + "version": "0.1.0", + "description": "Storage client for Node.js", + "repository": "googleapis/nodejs-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", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "predocs-test": "npm run docs", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^1.12.0" + }, + "devDependencies": { + "@types/mocha": "^5.2.5", + "@types/node": "^12.0.0", + "c8": "^6.0.0", + "gts": "^1.0.0", + "jsdoc": "^3.5.5", + "jsdoc-fresh": "^1.0.1", + "jsdoc-region-tag": "^1.0.2", + "linkinator": "^1.5.0", + "mocha": "^6.0.0", + "pack-n-play": "^1.0.0-2", + "null-loader": "^3.0.0", + "ts-loader": "^6.2.1", + "typescript": "~3.6.4", + "webpack": "^4.41.2", + "webpack-cli": "^3.3.10" + }, + "engines": { + "node": ">=8.13.0" + } +} diff --git a/protos/google/cloud/bigquery/storage/v1beta1/arrow.proto b/protos/google/cloud/bigquery/storage/v1beta1/arrow.proto new file mode 100644 index 00000000..3003de44 --- /dev/null +++ b/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/protos/google/cloud/bigquery/storage/v1beta1/avro.proto b/protos/google/cloud/bigquery/storage/v1beta1/avro.proto new file mode 100644 index 00000000..021d8e44 --- /dev/null +++ b/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/protos/google/cloud/bigquery/storage/v1beta1/read_options.proto b/protos/google/cloud/bigquery/storage/v1beta1/read_options.proto new file mode 100644 index 00000000..9591deba --- /dev/null +++ b/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/protos/google/cloud/bigquery/storage/v1beta1/storage.proto b/protos/google/cloud/bigquery/storage/v1beta1/storage.proto new file mode 100644 index 00000000..22f742fb --- /dev/null +++ b/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/protos/google/cloud/bigquery/storage/v1beta1/table_reference.proto b/protos/google/cloud/bigquery/storage/v1beta1/table_reference.proto new file mode 100644 index 00000000..a55dc48e --- /dev/null +++ b/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/protos/protos.d.ts b/protos/protos.d.ts new file mode 100644 index 00000000..63cabcc0 --- /dev/null +++ b/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|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; + + /** + * 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|null); + + /** ArrowRecordBatch rowCount */ + rowCount?: (number|Long|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; + + /** ArrowRecordBatch rowCount. */ + public rowCount: (number|Long); + + /** + * 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 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 }; + } + + /** 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|null); + + /** AvroRows rowCount */ + rowCount?: (number|Long|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; + + /** AvroRows rowCount. */ + public rowCount: (number|Long); + + /** + * 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|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); + + /** + * 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|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; + + /** 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|null); + + /** CreateReadSessionRequest shardingStrategy */ + shardingStrategy?: (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; + + /** CreateReadSessionRequest shardingStrategy. */ + public shardingStrategy: 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|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); + + /** 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|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); + + /** 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 }; + } + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|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; + + /** 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 }; + } + + /** 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 + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: google.protobuf.FieldDescriptorProto.Label; + + /** FieldDescriptorProto type. */ + public type: google.protobuf.FieldDescriptorProto.Type; + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** 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; + + /** 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|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: google.protobuf.FieldOptions.CType; + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: google.protobuf.FieldOptions.JSType; + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: google.protobuf.MethodOptions.IdempotencyLevel; + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: Uint8Array; + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of 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/protos/protos.js b/protos/protos.js new file mode 100644 index 00000000..52f329ef --- /dev/null +++ b/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.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; + })(); + + 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; + })(); + + return v1beta1; + })(); + + return storage; + })(); + + return bigquery; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + 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; + })(); + + 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; + })(); + + 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 {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + */ + + /** + * 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.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && message.hasOwnProperty("ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && message.hasOwnProperty("packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && message.hasOwnProperty("lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && message.hasOwnProperty("jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && message.hasOwnProperty("weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + 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 1055: + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + case 1052: + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + 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; + 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.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + 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; + } + } + 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.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + 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; + } + } + 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/protos/protos.json b/protos/protos.json new file mode 100644 index 00000000..3c1f08aa --- /dev/null +++ b/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": "AvroProto", + "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 + } + } + }, + "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 + } + } + }, + "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 + } + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "FieldBehaviorProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI" + }, + "nested": { + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "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 + } + } + } + }, + "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/renovate.json b/renovate.json new file mode 100644 index 00000000..9518bf36 --- /dev/null +++ b/renovate.json @@ -0,0 +1,19 @@ +{ + "extends": [ + "config:base", + "docker:disable" + ], + "pinVersions": false, + "rebaseStalePrs": true, + "schedule": [ + "after 9am and before 3pm" + ], + "gitAuthor": null, + "packageRules": [ + { + "extends": "packages:linters", + "groupName": "linters" + } + ], + "ignoreDeps": ["typescript"] +} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 00000000..544140db --- /dev/null +++ b/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/src/v1beta1/big_query_storage_client.ts b/src/v1beta1/big_query_storage_client.ts new file mode 100644 index 00000000..f1c2b5d1 --- /dev/null +++ b/src/v1beta1/big_query_storage_client.ts @@ -0,0 +1,707 @@ +// 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 _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 + ); + + // 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!.project_id || '', + }); + 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 || {}; + return this._innerApiCalls.readRows(request, options); + } + + /** + * 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/src/v1beta1/big_query_storage_client_config.json b/src/v1beta1/big_query_storage_client_config.json new file mode 100644 index 00000000..003cb084 --- /dev/null +++ b/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/src/v1beta1/big_query_storage_proto_list.json b/src/v1beta1/big_query_storage_proto_list.json new file mode 100644 index 00000000..d8525444 --- /dev/null +++ b/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/table_reference.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" +] diff --git a/src/v1beta1/index.ts b/src/v1beta1/index.ts new file mode 100644 index 00000000..7346292b --- /dev/null +++ b/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/synth.metadata b/synth.metadata new file mode 100644 index 00000000..6416d294 --- /dev/null +++ b/synth.metadata @@ -0,0 +1,31 @@ +{ + "updateTime": "2020-01-08T19:27:27.740059Z", + "sources": [ + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "5ef42bcd363ba0440f0ee65b3c80b499e9067ede", + "internalRef": "288713066" + } + }, + { + "template": { + "name": "node_library", + "origin": "synthtool.gcp", + "version": "2019.10.17" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "bigquerystorage", + "apiVersion": "v1beta1", + "language": "typescript", + "generator": "gapic-generator-typescript" + } + } + ] +} \ No newline at end of file diff --git a/system-test/fixtures/sample/src/index.js b/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000..e1637d52 --- /dev/null +++ b/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/system-test/fixtures/sample/src/index.ts b/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000..f0ce2eb8 --- /dev/null +++ b/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/system-test/install.ts b/system-test/install.ts new file mode 100644 index 00000000..c9aa74ec --- /dev/null +++ b/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/test/gapic-big_query_storage-v1beta1.ts b/test/gapic-big_query_storage-v1beta1.ts new file mode 100644 index 00000000..d93239ba --- /dev/null +++ b/test/gapic-big_query_storage-v1beta1.ts @@ -0,0 +1,364 @@ +// 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.project_id = ''; + // 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.project_id = ''; + // 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 = {}; + // 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 = {}; + // 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/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..613d3559 --- /dev/null +++ b/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/tslint.json b/tslint.json new file mode 100644 index 00000000..617dc975 --- /dev/null +++ b/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "gts/tslint.json" +} diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 00000000..ad9db41c --- /dev/null +++ b/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 40f893d73cfff45f9b9664a0662e066995da5c2c Mon Sep 17 00:00:00 2001 From: steffnay Date: Thu, 23 Jan 2020 15:55:08 -0800 Subject: [PATCH 02/12] feat: add initial functionality --- package.json | 16 +++++--- samples/package.json | 23 +++++++++++ samples/quickstart.js | 53 +++++++++++++++++++++++++ samples/test/quickstart.js | 33 +++++++++++++++ src/v1beta1/big_query_storage_client.ts | 8 ++-- synth.metadata | 6 +-- synth.py | 2 +- test/gapic-big_query_storage-v1beta1.ts | 4 +- 8 files changed, 130 insertions(+), 15 deletions(-) create mode 100644 samples/package.json create mode 100644 samples/quickstart.js create mode 100644 samples/test/quickstart.js diff --git a/package.json b/package.json index 89fc39ea..ee7ae45f 100644 --- a/package.json +++ b/package.json @@ -15,13 +15,14 @@ "compile": "tsc -p . && cp -r protos build/", "compile-protos": "compileProtos src", "docs": "jsdoc -c .jsdoc.js", - "docs-test": "linkinator docs", - "fix": "gts fix", - "lint": "gts check", "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix && eslint samples --fix", + "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" + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm test && cd ../" }, "dependencies": { "google-gax": "^1.12.0" @@ -41,7 +42,12 @@ "ts-loader": "^6.2.1", "typescript": "~3.6.4", "webpack": "^4.41.2", - "webpack-cli": "^3.3.10" + "webpack-cli": "^3.3.10", + "eslint": "^6.0.0", + "eslint-config-prettier": "^6.0.0", + "eslint-plugin-node": "^10.0.0", + "eslint-plugin-prettier": "^3.0.1", + "prettier": "^1.17.0" }, "engines": { "node": ">=8.13.0" diff --git a/samples/package.json b/samples/package.json new file mode 100644 index 00000000..706848af --- /dev/null +++ b/samples/package.json @@ -0,0 +1,23 @@ +{ + "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": "^1.0.1" + }, + "devDependencies": { + "c8": "^5.0.1", + "chai": "^4.2.0", + "mocha": "^6.2.2" + } +} diff --git a/samples/quickstart.js b/samples/quickstart.js new file mode 100644 index 00000000..19718c7f --- /dev/null +++ b/samples/quickstart.js @@ -0,0 +1,53 @@ +/** + * 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. + */ + +'use strict'; + +/** + * DESCRIBE WHAT THIS SAMPLE DOES. + * @param {string} LIST EXPECTED ARGUMENTS. + */ +async function main() { + // [START bigquery_storage_quickstart] + const bqStorage = require('@google-cloud/bigquery-storage').v1beta1.BigQueryStorageClient; + const client = new bqStorage(); + + + // This example reads baby name data from the public datasets. + const projectId = 'projects/bigquery-public-data' + const datasetId = 'usa_names' + const tableId = "usa_1910_current" + + const tableReference = { + projectId, + datasetId, + tableId + } + + const parent = 'projects/mastodon-dataset' + + const request = { + tableReference, + parent, + } + + await client.createReadSession(request) + // [END bigquery_storage_quickstart] +} + +main(...process.argv.slice(2)).catch(err => { + console.error(err); + process.exitCode = 1; +}); diff --git a/samples/test/quickstart.js b/samples/test/quickstart.js new file mode 100644 index 00000000..bae5de4c --- /dev/null +++ b/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 path = require('path'); +const {assert} = require('chai'); +const cp = require('child_process'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +describe('Quickstart', () => { + it('should run quickstart', async () => { + const stdout = execSync(`node ../samples/quickstart.js`, {cwd}); + }); +}); \ No newline at end of file diff --git a/src/v1beta1/big_query_storage_client.ts b/src/v1beta1/big_query_storage_client.ts index f1c2b5d1..1088b7e9 100644 --- a/src/v1beta1/big_query_storage_client.ts +++ b/src/v1beta1/big_query_storage_client.ts @@ -370,7 +370,7 @@ export class BigQueryStorageClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - table_reference_project_id: request.tableReference!.project_id || '', + 'table_reference.project_id': request.tableReference!.projectId || '', }); return this._innerApiCalls.createReadSession(request, options, callback); } @@ -457,7 +457,7 @@ export class BigQueryStorageClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - session_name: request.session!.name || '', + 'session.name': request.session!.name || '', }); return this._innerApiCalls.batchCreateReadSessionStreams( request, @@ -554,7 +554,7 @@ export class BigQueryStorageClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - stream_name: request.stream!.name || '', + 'stream.name': request.stream!.name || '', }); return this._innerApiCalls.finalizeStream(request, options, callback); } @@ -654,7 +654,7 @@ export class BigQueryStorageClient { options.otherArgs.headers[ 'x-goog-request-params' ] = gax.routingHeader.fromParams({ - original_stream_name: request.originalStream!.name || '', + 'original_stream.name': request.originalStream!.name || '', }); return this._innerApiCalls.splitReadStream(request, options, callback); } diff --git a/synth.metadata b/synth.metadata index 6416d294..53e8122a 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,12 +1,12 @@ { - "updateTime": "2020-01-08T19:27:27.740059Z", + "updateTime": "2020-01-14T20:03:58.287210Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5ef42bcd363ba0440f0ee65b3c80b499e9067ede", - "internalRef": "288713066" + "sha": "2fa8d48165cc48e35b0c62e6f7bdade12229326c", + "internalRef": "289619243" } }, { diff --git a/synth.py b/synth.py index f9620996..ec0cb3d4 100644 --- a/synth.py +++ b/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/test/gapic-big_query_storage-v1beta1.ts b/test/gapic-big_query_storage-v1beta1.ts index d93239ba..a5dbad98 100644 --- a/test/gapic-big_query_storage-v1beta1.ts +++ b/test/gapic-big_query_storage-v1beta1.ts @@ -114,7 +114,7 @@ describe('v1beta1.BigQueryStorageClient', () => { // Mock request const request: protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest = {}; request.tableReference = {}; - request.tableReference.project_id = ''; + request.tableReference.projectId = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -138,7 +138,7 @@ describe('v1beta1.BigQueryStorageClient', () => { // Mock request const request: protosTypes.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest = {}; request.tableReference = {}; - request.tableReference.project_id = ''; + request.tableReference.projectId = ''; // Mock response const expectedResponse = {}; // Mock gRPC layer From ff56f71865cbabaa7d46de02574183f46845c0b9 Mon Sep 17 00:00:00 2001 From: steffnay Date: Thu, 23 Jan 2020 16:03:17 -0800 Subject: [PATCH 03/12] update quickstart --- samples/quickstart.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/samples/quickstart.js b/samples/quickstart.js index 19718c7f..31af210a 100644 --- a/samples/quickstart.js +++ b/samples/quickstart.js @@ -24,19 +24,22 @@ async function main() { const bqStorage = require('@google-cloud/bigquery-storage').v1beta1.BigQueryStorageClient; const client = new bqStorage(); + const myProjectId = 'my-project-id' + // This example reads baby name data from the public datasets. - const projectId = 'projects/bigquery-public-data' + const projectId = 'bigquery-public-data' const datasetId = 'usa_names' - const tableId = "usa_1910_current" + const tableId = 'usa_1910_current' const tableReference = { projectId, datasetId, tableId } + - const parent = 'projects/mastodon-dataset' + const parent = `projects/${myProjectId}` const request = { tableReference, From 8730ac019e6284c257b9f608f0f392737be0059b Mon Sep 17 00:00:00 2001 From: steffnay Date: Wed, 5 Feb 2020 10:10:57 -0800 Subject: [PATCH 04/12] quickstart --- protos/protos.d.ts | 790 +- protos/protos.js | 6470 ++++++++--------- protos/protos.json | 188 +- samples/quickstart.js | 50 +- samples/test/quickstart.js | 2 +- src/v1beta1/big_query_storage_client.ts | 119 + src/v1beta1/big_query_storage_proto_list.json | 4 +- synth.metadata | 6 +- test/gapic-big_query_storage-v1beta1.ts | 4 + 9 files changed, 3893 insertions(+), 3740 deletions(-) diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 63cabcc0..de6c3d8e 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -215,198 +215,6 @@ export namespace google { 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 }; - } - /** Properties of an AvroSchema. */ interface IAvroSchema { @@ -2247,239 +2055,205 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } - } - } - } - } - - /** Namespace api. */ - namespace api { - - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { - /** ResourceDescriptor type */ - type?: (string|null); + /** Properties of a TableReference. */ + interface ITableReference { - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); + /** TableReference projectId */ + projectId?: (string|null); - /** ResourceDescriptor nameField */ - nameField?: (string|null); + /** TableReference datasetId */ + datasetId?: (string|null); - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|null); + /** TableReference tableId */ + tableId?: (string|null); + } - /** ResourceDescriptor plural */ - plural?: (string|null); + /** Represents a TableReference. */ + class TableReference implements ITableReference { - /** ResourceDescriptor singular */ - singular?: (string|null); - } + /** + * Constructs a new TableReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.ITableReference); - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { + /** TableReference projectId. */ + public projectId: string; - /** - * Constructs a new ResourceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceDescriptor); + /** TableReference datasetId. */ + public datasetId: string; - /** ResourceDescriptor type. */ - public type: string; + /** TableReference tableId. */ + public tableId: string; - /** ResourceDescriptor pattern. */ - public pattern: 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; - /** ResourceDescriptor nameField. */ - public nameField: string; - - /** ResourceDescriptor history. */ - public history: google.api.ResourceDescriptor.History; - - /** ResourceDescriptor plural. */ - public plural: string; - - /** ResourceDescriptor singular. */ - public singular: string; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @param [properties] Properties to set - * @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); + /** + * 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; - /** - * 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; + /** + * 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; - /** - * 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 }; + /** + * 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; - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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; - namespace ResourceDescriptor { + /** + * 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); - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - } + /** + * 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; - /** Properties of a ResourceReference. */ - interface IResourceReference { + /** + * 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 }; - /** ResourceReference type */ - type?: (string|null); + /** + * Converts this TableReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ResourceReference childType */ - childType?: (string|null); - } + /** Properties of a TableModifiers. */ + interface ITableModifiers { - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { + /** TableModifiers snapshotTime */ + snapshotTime?: (google.protobuf.ITimestamp|null); + } - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); + /** Represents a TableModifiers. */ + class TableModifiers implements ITableModifiers { - /** ResourceReference type. */ - public type: string; + /** + * Constructs a new TableModifiers. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.storage.v1beta1.ITableModifiers); - /** ResourceReference childType. */ - public childType: string; + /** TableModifiers snapshotTime. */ + public snapshotTime?: (google.protobuf.ITimestamp|null); - /** - * Creates a new ResourceReference instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceReference instance - */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + /** + * Creates a 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 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 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 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; + /** + * 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 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 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 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; + /** + * 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 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); + /** + * 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 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 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 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 }; + /** + * 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 ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [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 { @@ -2829,6 +2603,232 @@ export namespace google { INPUT_ONLY = 4, IMMUTABLE = 5 } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|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; + + /** 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. */ @@ -4688,11 +4688,11 @@ export namespace google { /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - /** FieldOptions .google.api.fieldBehavior */ ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); } /** Represents a FieldOptions. */ diff --git a/protos/protos.js b/protos/protos.js index 52f329ef..8da21884 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -504,26 +504,24 @@ return ArrowRecordBatch; })(); - v1beta1.TableReference = (function() { + v1beta1.AvroSchema = (function() { /** - * Properties of a TableReference. + * Properties of an AvroSchema. * @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 IAvroSchema + * @property {string|null} [schema] AvroSchema schema */ /** - * Constructs a new TableReference. + * Constructs a new AvroSchema. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a TableReference. - * @implements ITableReference + * @classdesc Represents an AvroSchema. + * @implements IAvroSchema * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.ITableReference=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.IAvroSchema=} [properties] Properties to set */ - function TableReference(properties) { + function AvroSchema(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -531,101 +529,75 @@ } /** - * 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 + * AvroSchema schema. + * @member {string} schema + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema * @instance */ - TableReference.prototype.tableId = ""; + AvroSchema.prototype.schema = ""; /** - * Creates a new TableReference instance using the specified properties. + * Creates a new AvroSchema instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema * @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.IAvroSchema=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.AvroSchema} AvroSchema instance */ - TableReference.create = function create(properties) { - return new TableReference(properties); + AvroSchema.create = function create(properties) { + return new AvroSchema(properties); }; /** - * Encodes the specified TableReference message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableReference.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.TableReference + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema * @static - * @param {google.cloud.bigquery.storage.v1beta1.ITableReference} message TableReference 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 */ - TableReference.encode = function encode(message, writer) { + AvroSchema.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); + if (message.schema != null && message.hasOwnProperty("schema")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.schema); 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 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.TableReference + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema * @static - * @param {google.cloud.bigquery.storage.v1beta1.ITableReference} message TableReference 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 */ - TableReference.encodeDelimited = function encodeDelimited(message, writer) { + AvroSchema.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TableReference 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.TableReference + * @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.TableReference} TableReference + * @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 */ - TableReference.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.TableReference(); + 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.projectId = reader.string(); - break; - case 2: - message.datasetId = reader.string(); - break; - case 3: - message.tableId = reader.string(); + message.schema = reader.string(); break; default: reader.skipType(tag & 7); @@ -636,124 +608,108 @@ }; /** - * Decodes a TableReference 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.TableReference + * @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.TableReference} TableReference + * @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 */ - TableReference.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 TableReference message. + * Verifies an AvroSchema message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * @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 */ - TableReference.verify = function verify(message) { + AvroSchema.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.schema != null && message.hasOwnProperty("schema")) + if (!$util.isString(message.schema)) + return "schema: string expected"; return null; }; /** - * Creates a TableReference 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.TableReference + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.TableReference} TableReference + * @returns {google.cloud.bigquery.storage.v1beta1.AvroSchema} AvroSchema */ - TableReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.TableReference) + 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.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.AvroSchema(); + if (object.schema != null) + message.schema = String(object.schema); return message; }; /** - * Creates a plain object from a TableReference 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.TableReference + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema * @static - * @param {google.cloud.bigquery.storage.v1beta1.TableReference} message TableReference + * @param {google.cloud.bigquery.storage.v1beta1.AvroSchema} message AvroSchema * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TableReference.toObject = function toObject(message, options) { + AvroSchema.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; + if (options.defaults) + object.schema = ""; + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = message.schema; return object; }; /** - * Converts this TableReference to JSON. + * Converts this AvroSchema to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.TableReference + * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema * @instance * @returns {Object.} JSON object */ - TableReference.prototype.toJSON = function toJSON() { + AvroSchema.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TableReference; + return AvroSchema; })(); - v1beta1.TableModifiers = (function() { + v1beta1.AvroRows = (function() { /** - * Properties of a TableModifiers. + * Properties of an AvroRows. * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface ITableModifiers - * @property {google.protobuf.ITimestamp|null} [snapshotTime] TableModifiers snapshotTime + * @interface IAvroRows + * @property {Uint8Array|null} [serializedBinaryRows] AvroRows serializedBinaryRows + * @property {number|Long|null} [rowCount] AvroRows rowCount */ /** - * Constructs a new TableModifiers. + * Constructs a new AvroRows. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a TableModifiers. - * @implements ITableModifiers + * @classdesc Represents an AvroRows. + * @implements IAvroRows * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.ITableModifiers=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.IAvroRows=} [properties] Properties to set */ - function TableModifiers(properties) { + function AvroRows(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -761,75 +717,88 @@ } /** - * TableModifiers snapshotTime. - * @member {google.protobuf.ITimestamp|null|undefined} snapshotTime - * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * AvroRows serializedBinaryRows. + * @member {Uint8Array} serializedBinaryRows + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows * @instance */ - TableModifiers.prototype.snapshotTime = null; + AvroRows.prototype.serializedBinaryRows = $util.newBuffer([]); /** - * Creates a new TableModifiers instance using the specified properties. + * 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.TableModifiers + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows * @static - * @param {google.cloud.bigquery.storage.v1beta1.ITableModifiers=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.TableModifiers} TableModifiers instance + * @param {google.cloud.bigquery.storage.v1beta1.IAvroRows=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.AvroRows} AvroRows instance */ - TableModifiers.create = function create(properties) { - return new TableModifiers(properties); + AvroRows.create = function create(properties) { + return new AvroRows(properties); }; /** - * Encodes the specified TableModifiers message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableModifiers.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.TableModifiers + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows * @static - * @param {google.cloud.bigquery.storage.v1beta1.ITableModifiers} message TableModifiers 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 */ - TableModifiers.encode = function encode(message, writer) { + AvroRows.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(); + 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 TableModifiers message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableModifiers.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.TableModifiers + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows * @static - * @param {google.cloud.bigquery.storage.v1beta1.ITableModifiers} message TableModifiers 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 */ - TableModifiers.encodeDelimited = function encodeDelimited(message, writer) { + AvroRows.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TableModifiers 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.TableModifiers + * @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.TableModifiers} TableModifiers + * @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 */ - TableModifiers.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.TableModifiers(); + 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.snapshotTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.serializedBinaryRows = reader.bytes(); + break; + case 2: + message.rowCount = reader.int64(); break; default: reader.skipType(tag & 7); @@ -840,112 +809,141 @@ }; /** - * Decodes a TableModifiers 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.TableModifiers + * @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.TableModifiers} TableModifiers + * @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 */ - TableModifiers.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 TableModifiers message. + * Verifies an AvroRows message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * @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 */ - TableModifiers.verify = function verify(message) { + AvroRows.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; - } + 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 TableModifiers 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.TableModifiers + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.TableModifiers} TableModifiers + * @returns {google.cloud.bigquery.storage.v1beta1.AvroRows} AvroRows */ - TableModifiers.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.TableModifiers) + 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.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); - } + 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 TableModifiers 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.TableModifiers + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows * @static - * @param {google.cloud.bigquery.storage.v1beta1.TableModifiers} message TableModifiers + * @param {google.cloud.bigquery.storage.v1beta1.AvroRows} message AvroRows * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TableModifiers.toObject = function toObject(message, options) { + AvroRows.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) { + 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 TableModifiers to JSON. + * Converts this AvroRows to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers + * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows * @instance * @returns {Object.} JSON object */ - TableModifiers.prototype.toJSON = function toJSON() { + AvroRows.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TableModifiers; + return AvroRows; })(); - v1beta1.AvroSchema = (function() { + v1beta1.TableReadOptions = (function() { /** - * Properties of an AvroSchema. + * Properties of a TableReadOptions. * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface IAvroSchema - * @property {string|null} [schema] AvroSchema schema + * @interface ITableReadOptions + * @property {Array.|null} [selectedFields] TableReadOptions selectedFields + * @property {string|null} [rowRestriction] TableReadOptions rowRestriction */ /** - * Constructs a new AvroSchema. + * Constructs a new TableReadOptions. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents an AvroSchema. - * @implements IAvroSchema + * @classdesc Represents a TableReadOptions. + * @implements ITableReadOptions * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IAvroSchema=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.ITableReadOptions=} [properties] Properties to set */ - function AvroSchema(properties) { + function TableReadOptions(properties) { + this.selectedFields = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -953,75 +951,91 @@ } /** - * AvroSchema schema. - * @member {string} schema - * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema + * TableReadOptions selectedFields. + * @member {Array.} selectedFields + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions * @instance */ - AvroSchema.prototype.schema = ""; + TableReadOptions.prototype.selectedFields = $util.emptyArray; /** - * Creates a new AvroSchema 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.AvroSchema + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions * @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.v1beta1.ITableReadOptions=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.TableReadOptions} TableReadOptions instance */ - AvroSchema.create = function create(properties) { - return new AvroSchema(properties); + TableReadOptions.create = function create(properties) { + return new TableReadOptions(properties); }; /** - * Encodes the specified AvroSchema message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroSchema.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.AvroSchema + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions * @static - * @param {google.cloud.bigquery.storage.v1beta1.IAvroSchema} message AvroSchema 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 */ - AvroSchema.encode = function encode(message, writer) { + TableReadOptions.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); + 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 AvroSchema message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroSchema.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.AvroSchema + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions * @static - * @param {google.cloud.bigquery.storage.v1beta1.IAvroSchema} message AvroSchema 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 */ - AvroSchema.encodeDelimited = function encodeDelimited(message, writer) { + TableReadOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AvroSchema 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.AvroSchema + * @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.AvroSchema} AvroSchema + * @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 */ - AvroSchema.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.AvroSchema(); + 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: - message.schema = reader.string(); + 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); @@ -1032,108 +1046,328 @@ }; /** - * Decodes an AvroSchema 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.AvroSchema + * @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.AvroSchema} AvroSchema + * @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 */ - AvroSchema.decodeDelimited = function decodeDelimited(reader) { + TableReadOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AvroSchema message. + * Verifies a TableReadOptions message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.AvroSchema + * @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 */ - AvroSchema.verify = function verify(message) { + TableReadOptions.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.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 an AvroSchema 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.AvroSchema + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.AvroSchema} AvroSchema + * @returns {google.cloud.bigquery.storage.v1beta1.TableReadOptions} TableReadOptions */ - AvroSchema.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.AvroSchema) + 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.AvroSchema(); - if (object.schema != null) - message.schema = String(object.schema); + 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 an AvroSchema 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.AvroSchema + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions * @static - * @param {google.cloud.bigquery.storage.v1beta1.AvroSchema} message AvroSchema + * @param {google.cloud.bigquery.storage.v1beta1.TableReadOptions} message TableReadOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AvroSchema.toObject = function toObject(message, options) { + TableReadOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.selectedFields = []; if (options.defaults) - object.schema = ""; - if (message.schema != null && message.hasOwnProperty("schema")) - object.schema = message.schema; - return object; - }; - - /** - * Converts this AvroSchema to JSON. + 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.AvroSchema + * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions * @instance * @returns {Object.} JSON object */ - AvroSchema.prototype.toJSON = function toJSON() { + TableReadOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AvroSchema; + return TableReadOptions; })(); - v1beta1.AvroRows = (function() { + v1beta1.BigQueryStorage = (function() { /** - * Properties of an AvroRows. + * Constructs a new BigQueryStorage service. * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface IAvroRows - * @property {Uint8Array|null} [serializedBinaryRows] AvroRows serializedBinaryRows - * @property {number|Long|null} [rowCount] AvroRows rowCount + * @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; /** - * Constructs a new AvroRows. + * 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 - * @classdesc Represents an AvroRows. - * @implements IAvroRows + * @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.IAvroRows=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.IStream=} [properties] Properties to set */ - function AvroRows(properties) { + function Stream(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1141,88 +1375,75 @@ } /** - * 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 + * Stream name. + * @member {string} name + * @memberof google.cloud.bigquery.storage.v1beta1.Stream * @instance */ - AvroRows.prototype.rowCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Stream.prototype.name = ""; /** - * Creates a new AvroRows instance using the specified properties. + * Creates a new Stream instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @memberof google.cloud.bigquery.storage.v1beta1.Stream * @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.v1beta1.IStream=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.Stream} Stream instance */ - AvroRows.create = function create(properties) { - return new AvroRows(properties); + Stream.create = function create(properties) { + return new Stream(properties); }; /** - * Encodes the specified AvroRows message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.AvroRows.verify|verify} messages. + * 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.AvroRows + * @memberof google.cloud.bigquery.storage.v1beta1.Stream * @static - * @param {google.cloud.bigquery.storage.v1beta1.IAvroRows} message AvroRows 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 */ - AvroRows.encode = function encode(message, writer) { + Stream.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); + if (message.name != null && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); 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 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.AvroRows + * @memberof google.cloud.bigquery.storage.v1beta1.Stream * @static - * @param {google.cloud.bigquery.storage.v1beta1.IAvroRows} message AvroRows 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 */ - AvroRows.encodeDelimited = function encodeDelimited(message, writer) { + Stream.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AvroRows 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.AvroRows + * @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.AvroRows} AvroRows + * @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 */ - AvroRows.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.AvroRows(); + 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.serializedBinaryRows = reader.bytes(); - break; - case 2: - message.rowCount = reader.int64(); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -1233,141 +1454,108 @@ }; /** - * Decodes an AvroRows 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.AvroRows + * @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.AvroRows} AvroRows + * @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 */ - AvroRows.decodeDelimited = function decodeDelimited(reader) { + Stream.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AvroRows message. + * Verifies a Stream message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @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 - */ - 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"; + * @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 an AvroRows 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.AvroRows + * @memberof google.cloud.bigquery.storage.v1beta1.Stream * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.AvroRows} AvroRows + * @returns {google.cloud.bigquery.storage.v1beta1.Stream} Stream */ - AvroRows.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.AvroRows) + 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.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(); + 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 an AvroRows 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.AvroRows + * @memberof google.cloud.bigquery.storage.v1beta1.Stream * @static - * @param {google.cloud.bigquery.storage.v1beta1.AvroRows} message AvroRows + * @param {google.cloud.bigquery.storage.v1beta1.Stream} message Stream * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AvroRows.toObject = function toObject(message, options) { + Stream.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; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this AvroRows to JSON. + * Converts this Stream to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.AvroRows + * @memberof google.cloud.bigquery.storage.v1beta1.Stream * @instance * @returns {Object.} JSON object */ - AvroRows.prototype.toJSON = function toJSON() { + Stream.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AvroRows; + return Stream; })(); - v1beta1.TableReadOptions = (function() { + v1beta1.StreamPosition = (function() { /** - * Properties of a TableReadOptions. + * Properties of a StreamPosition. * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface ITableReadOptions - * @property {Array.|null} [selectedFields] TableReadOptions selectedFields - * @property {string|null} [rowRestriction] TableReadOptions rowRestriction + * @interface IStreamPosition + * @property {google.cloud.bigquery.storage.v1beta1.IStream|null} [stream] StreamPosition stream + * @property {number|Long|null} [offset] StreamPosition offset */ /** - * Constructs a new TableReadOptions. + * Constructs a new StreamPosition. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a TableReadOptions. - * @implements ITableReadOptions + * @classdesc Represents a StreamPosition. + * @implements IStreamPosition * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.ITableReadOptions=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.IStreamPosition=} [properties] Properties to set */ - function TableReadOptions(properties) { - this.selectedFields = []; + function StreamPosition(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1375,91 +1563,88 @@ } /** - * TableReadOptions selectedFields. - * @member {Array.} selectedFields - * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * StreamPosition stream. + * @member {google.cloud.bigquery.storage.v1beta1.IStream|null|undefined} stream + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition * @instance */ - TableReadOptions.prototype.selectedFields = $util.emptyArray; + StreamPosition.prototype.stream = null; /** - * TableReadOptions rowRestriction. - * @member {string} rowRestriction - * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * StreamPosition offset. + * @member {number|Long} offset + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition * @instance */ - TableReadOptions.prototype.rowRestriction = ""; + StreamPosition.prototype.offset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new TableReadOptions instance using the specified properties. + * Creates a new StreamPosition instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition * @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.v1beta1.IStreamPosition=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.StreamPosition} StreamPosition instance */ - TableReadOptions.create = function create(properties) { - return new TableReadOptions(properties); + StreamPosition.create = function create(properties) { + return new StreamPosition(properties); }; /** - * Encodes the specified TableReadOptions message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableReadOptions.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.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition * @static - * @param {google.cloud.bigquery.storage.v1beta1.ITableReadOptions} message TableReadOptions 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 */ - TableReadOptions.encode = function encode(message, writer) { + StreamPosition.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); + 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 TableReadOptions message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.TableReadOptions.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.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition * @static - * @param {google.cloud.bigquery.storage.v1beta1.ITableReadOptions} message TableReadOptions 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 */ - TableReadOptions.encodeDelimited = function encodeDelimited(message, writer) { + StreamPosition.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TableReadOptions 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.TableReadOptions + * @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.TableReadOptions} TableReadOptions + * @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 */ - TableReadOptions.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.TableReadOptions(); + 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: - if (!(message.selectedFields && message.selectedFields.length)) - message.selectedFields = []; - message.selectedFields.push(reader.string()); + message.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); break; case 2: - message.rowRestriction = reader.string(); + message.offset = reader.int64(); break; default: reader.skipType(tag & 7); @@ -1470,405 +1655,328 @@ }; /** - * Decodes a TableReadOptions 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.TableReadOptions + * @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.TableReadOptions} TableReadOptions + * @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 */ - TableReadOptions.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 TableReadOptions message. + * Verifies a StreamPosition message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @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 */ - TableReadOptions.verify = function verify(message) { + StreamPosition.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.stream != null && message.hasOwnProperty("stream")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.stream); + if (error) + return "stream." + error; } - if (message.rowRestriction != null && message.hasOwnProperty("rowRestriction")) - if (!$util.isString(message.rowRestriction)) - return "rowRestriction: 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 TableReadOptions 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.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.TableReadOptions} TableReadOptions + * @returns {google.cloud.bigquery.storage.v1beta1.StreamPosition} StreamPosition */ - TableReadOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.TableReadOptions) + 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.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.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.rowRestriction != null) - message.rowRestriction = String(object.rowRestriction); + 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 TableReadOptions 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.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition * @static - * @param {google.cloud.bigquery.storage.v1beta1.TableReadOptions} message TableReadOptions + * @param {google.cloud.bigquery.storage.v1beta1.StreamPosition} message StreamPosition * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TableReadOptions.toObject = function toObject(message, options) { + StreamPosition.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 (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 TableReadOptions to JSON. + * Converts this StreamPosition to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.TableReadOptions + * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition * @instance * @returns {Object.} JSON object */ - TableReadOptions.prototype.toJSON = function toJSON() { + StreamPosition.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TableReadOptions; + return StreamPosition; })(); - v1beta1.BigQueryStorage = (function() { + v1beta1.ReadSession = (function() { /** - * Constructs a new BigQueryStorage service. + * Properties of a ReadSession. * @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 + * @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 */ /** - * 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 + * 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 */ - 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" }); + 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]]; + } /** - * Calls ReadRows. - * @function readRows - * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * ReadSession name. + * @member {string} name + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @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 */ + ReadSession.prototype.name = ""; /** - * Calls BatchCreateReadSessionStreams. - * @function batchCreateReadSessionStreams - * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * ReadSession expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @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" }); + ReadSession.prototype.expireTime = null; /** - * Calls BatchCreateReadSessionStreams. - * @function batchCreateReadSessionStreams - * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * ReadSession avroSchema. + * @member {google.cloud.bigquery.storage.v1beta1.IAvroSchema|null|undefined} avroSchema + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @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 */ + ReadSession.prototype.avroSchema = null; /** - * Calls FinalizeStream. - * @function finalizeStream - * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * ReadSession arrowSchema. + * @member {google.cloud.bigquery.storage.v1beta1.IArrowSchema|null|undefined} arrowSchema + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @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" }); + ReadSession.prototype.arrowSchema = null; /** - * Calls FinalizeStream. - * @function finalizeStream - * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * ReadSession streams. + * @member {Array.} streams + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @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 */ + ReadSession.prototype.streams = $util.emptyArray; /** - * Calls SplitReadStream. - * @function splitReadStream - * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * ReadSession tableReference. + * @member {google.cloud.bigquery.storage.v1beta1.ITableReference|null|undefined} tableReference + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @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" }); + ReadSession.prototype.tableReference = null; /** - * Calls SplitReadStream. - * @function splitReadStream - * @memberof google.cloud.bigquery.storage.v1beta1.BigQueryStorage + * ReadSession tableModifiers. + * @member {google.cloud.bigquery.storage.v1beta1.ITableModifiers|null|undefined} tableModifiers + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @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 */ + ReadSession.prototype.tableModifiers = null; /** - * 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]]; - } + * 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; /** - * Stream name. - * @member {string} name - * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * ReadSession schema. + * @member {"avroSchema"|"arrowSchema"|undefined} schema + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @instance */ - Stream.prototype.name = ""; + Object.defineProperty(ReadSession.prototype, "schema", { + get: $util.oneOfGetter($oneOfFields = ["avroSchema", "arrowSchema"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new Stream instance using the specified properties. + * Creates a new ReadSession instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @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.v1beta1.IReadSession=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.ReadSession} ReadSession instance */ - Stream.create = function create(properties) { - return new Stream(properties); + ReadSession.create = function create(properties) { + return new ReadSession(properties); }; /** - * Encodes the specified Stream message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Stream.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.Stream + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @static - * @param {google.cloud.bigquery.storage.v1beta1.IStream} message Stream 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 */ - Stream.encode = function encode(message, 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 Stream message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Stream.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.Stream + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @static - * @param {google.cloud.bigquery.storage.v1beta1.IStream} message Stream 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 */ - Stream.encodeDelimited = function encodeDelimited(message, writer) { + ReadSession.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Stream 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.Stream + * @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.Stream} Stream + * @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 */ - Stream.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.Stream(); + 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; @@ -1878,108 +1986,244 @@ }; /** - * Decodes a Stream 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.Stream + * @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.Stream} Stream + * @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 */ - Stream.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 Stream message. + * Verifies a ReadSession message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @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 */ - Stream.verify = function verify(message) { + 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 Stream 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.Stream + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.Stream} Stream + * @returns {google.cloud.bigquery.storage.v1beta1.ReadSession} ReadSession */ - Stream.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.Stream) + 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.Stream(); + 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 Stream 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.Stream + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @static - * @param {google.cloud.bigquery.storage.v1beta1.Stream} message Stream + * @param {google.cloud.bigquery.storage.v1beta1.ReadSession} message ReadSession * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Stream.toObject = function toObject(message, options) { + ReadSession.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + 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 Stream to JSON. + * Converts this ReadSession to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.Stream + * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession * @instance * @returns {Object.} JSON object */ - Stream.prototype.toJSON = function toJSON() { + ReadSession.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Stream; + return ReadSession; })(); - v1beta1.StreamPosition = (function() { + v1beta1.CreateReadSessionRequest = (function() { /** - * Properties of a StreamPosition. + * Properties of a CreateReadSessionRequest. * @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 + * @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 StreamPosition. + * Constructs a new CreateReadSessionRequest. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a StreamPosition. - * @implements IStreamPosition + * @classdesc Represents a CreateReadSessionRequest. + * @implements ICreateReadSessionRequest * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IStreamPosition=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest=} [properties] Properties to set */ - function StreamPosition(properties) { + function CreateReadSessionRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1987,88 +2231,153 @@ } /** - * StreamPosition stream. - * @member {google.cloud.bigquery.storage.v1beta1.IStream|null|undefined} stream - * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * CreateReadSessionRequest tableReference. + * @member {google.cloud.bigquery.storage.v1beta1.ITableReference|null|undefined} tableReference + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest * @instance */ - StreamPosition.prototype.stream = null; + CreateReadSessionRequest.prototype.tableReference = null; /** - * StreamPosition offset. - * @member {number|Long} offset - * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * CreateReadSessionRequest parent. + * @member {string} parent + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest * @instance */ - StreamPosition.prototype.offset = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + CreateReadSessionRequest.prototype.parent = ""; /** - * Creates a new StreamPosition instance using the specified properties. + * 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.StreamPosition + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.IStreamPosition=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.StreamPosition} StreamPosition instance + * @param {google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest} CreateReadSessionRequest instance */ - StreamPosition.create = function create(properties) { - return new StreamPosition(properties); + CreateReadSessionRequest.create = function create(properties) { + return new CreateReadSessionRequest(properties); }; /** - * Encodes the specified StreamPosition message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamPosition.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.StreamPosition + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.IStreamPosition} message StreamPosition 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 */ - StreamPosition.encode = function encode(message, writer) { + CreateReadSessionRequest.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); + 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 StreamPosition message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamPosition.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.StreamPosition + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.IStreamPosition} message StreamPosition 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 */ - StreamPosition.encodeDelimited = function encodeDelimited(message, writer) { + CreateReadSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a StreamPosition 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.StreamPosition + * @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.StreamPosition} StreamPosition + * @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 */ - StreamPosition.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.StreamPosition(); + 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.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); + message.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.decode(reader, reader.uint32()); + break; + case 6: + message.parent = reader.string(); break; case 2: - message.offset = reader.int64(); + 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); @@ -2079,143 +2388,239 @@ }; /** - * Decodes a StreamPosition 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.StreamPosition + * @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.StreamPosition} StreamPosition + * @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 */ - StreamPosition.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 StreamPosition message. + * Verifies a CreateReadSessionRequest message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * @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 */ - StreamPosition.verify = function verify(message) { + CreateReadSessionRequest.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 (message.tableReference != null && message.hasOwnProperty("tableReference")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.TableReference.verify(message.tableReference); if (error) - return "stream." + 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); } - 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); + 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; } - 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. + * Creates a plain object from a CreateReadSessionRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.StreamPosition} message StreamPosition + * @param {google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest} message CreateReadSessionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StreamPosition.toObject = function toObject(message, options) { + CreateReadSessionRequest.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; + 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.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; + 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 StreamPosition to JSON. + * Converts this CreateReadSessionRequest to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.StreamPosition + * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest * @instance * @returns {Object.} JSON object */ - StreamPosition.prototype.toJSON = function toJSON() { + CreateReadSessionRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return StreamPosition; + return CreateReadSessionRequest; })(); - v1beta1.ReadSession = (function() { + /** + * 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 ReadSession. + * Properties of a ReadRowsRequest. * @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 + * @interface IReadRowsRequest + * @property {google.cloud.bigquery.storage.v1beta1.IStreamPosition|null} [readPosition] ReadRowsRequest readPosition */ /** - * Constructs a new ReadSession. + * Constructs a new ReadRowsRequest. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a ReadSession. - * @implements IReadSession + * @classdesc Represents a ReadRowsRequest. + * @implements IReadRowsRequest * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IReadSession=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsRequest=} [properties] Properties to set */ - function ReadSession(properties) { - this.streams = []; + function ReadRowsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2223,183 +2628,75 @@ } /** - * 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 + * ReadRowsRequest readPosition. + * @member {google.cloud.bigquery.storage.v1beta1.IStreamPosition|null|undefined} readPosition + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest * @instance */ - Object.defineProperty(ReadSession.prototype, "schema", { - get: $util.oneOfGetter($oneOfFields = ["avroSchema", "arrowSchema"]), - set: $util.oneOfSetter($oneOfFields) - }); + ReadRowsRequest.prototype.readPosition = null; /** - * Creates a new ReadSession instance using the specified properties. + * Creates a new ReadRowsRequest instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest * @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); + * @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 ReadSession message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadSession.verify|verify} messages. + * 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.ReadSession + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.IReadSession} message ReadSession message or plain object to encode + * @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 */ - ReadSession.encode = function encode(message, writer) { + ReadRowsRequest.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); + 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 ReadSession message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadSession.verify|verify} messages. + * 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.ReadSession + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.IReadSession} message ReadSession message or plain object to encode + * @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 */ - ReadSession.encodeDelimited = function encodeDelimited(message, writer) { + ReadRowsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReadSession message from the specified reader or buffer. + * Decodes a ReadRowsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @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.ReadSession} ReadSession + * @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 */ - ReadSession.decode = function decode(reader, length) { + 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.ReadSession(); + 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.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(); + message.readPosition = $root.google.cloud.bigquery.storage.v1beta1.StreamPosition.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2410,244 +2707,115 @@ }; /** - * Decodes a ReadSession message from the specified reader or buffer, length delimited. + * Decodes a ReadRowsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @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.ReadSession} ReadSession + * @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 */ - ReadSession.decodeDelimited = function decodeDelimited(reader) { + ReadRowsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReadSession message. + * Verifies a ReadRowsRequest message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @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 */ - ReadSession.verify = function verify(message) { + ReadRowsRequest.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 (message.readPosition != null && message.hasOwnProperty("readPosition")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.StreamPosition.verify(message.readPosition); if (error) - return "tableModifiers." + error; + return "readPosition." + 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. + * Creates a ReadRowsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.ReadSession} ReadSession + * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsRequest} ReadRowsRequest */ - ReadSession.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.ReadSession) + 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.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; + 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 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; + /** + * 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 ReadSession to JSON. + * Converts this ReadRowsRequest to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.ReadSession + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest * @instance * @returns {Object.} JSON object */ - ReadSession.prototype.toJSON = function toJSON() { + ReadRowsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ReadSession; + return ReadRowsRequest; })(); - v1beta1.CreateReadSessionRequest = (function() { + v1beta1.StreamStatus = (function() { /** - * Properties of a CreateReadSessionRequest. + * Properties of a StreamStatus. * @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 + * @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 CreateReadSessionRequest. + * Constructs a new StreamStatus. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a CreateReadSessionRequest. - * @implements ICreateReadSessionRequest + * @classdesc Represents a StreamStatus. + * @implements IStreamStatus * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.IStreamStatus=} [properties] Properties to set */ - function CreateReadSessionRequest(properties) { + function StreamStatus(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2655,396 +2823,270 @@ } /** - * 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 + * StreamStatus estimatedRowCount. + * @member {number|Long} estimatedRowCount + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus * @instance */ - CreateReadSessionRequest.prototype.requestedStreams = 0; + StreamStatus.prototype.estimatedRowCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * CreateReadSessionRequest readOptions. - * @member {google.cloud.bigquery.storage.v1beta1.ITableReadOptions|null|undefined} readOptions - * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * StreamStatus fractionConsumed. + * @member {number} fractionConsumed + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus * @instance */ - CreateReadSessionRequest.prototype.readOptions = null; + StreamStatus.prototype.fractionConsumed = 0; /** - * CreateReadSessionRequest format. - * @member {google.cloud.bigquery.storage.v1beta1.DataFormat} format - * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * StreamStatus progress. + * @member {google.cloud.bigquery.storage.v1beta1.IProgress|null|undefined} progress + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus * @instance */ - CreateReadSessionRequest.prototype.format = 0; + StreamStatus.prototype.progress = null; /** - * CreateReadSessionRequest shardingStrategy. - * @member {google.cloud.bigquery.storage.v1beta1.ShardingStrategy} shardingStrategy - * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * StreamStatus isSplittable. + * @member {boolean} isSplittable + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus * @instance */ - CreateReadSessionRequest.prototype.shardingStrategy = 0; + StreamStatus.prototype.isSplittable = false; /** - * Creates a new CreateReadSessionRequest instance using the specified properties. + * Creates a new StreamStatus instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus * @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.v1beta1.IStreamStatus=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.StreamStatus} StreamStatus instance */ - CreateReadSessionRequest.create = function create(properties) { - return new CreateReadSessionRequest(properties); + StreamStatus.create = function create(properties) { + return new StreamStatus(properties); }; /** - * Encodes the specified CreateReadSessionRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest.verify|verify} messages. + * 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.CreateReadSessionRequest + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus * @static - * @param {google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest} message CreateReadSessionRequest message or plain object to encode + * @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 */ - CreateReadSessionRequest.encode = function encode(message, writer) { + StreamStatus.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); + 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 CreateReadSessionRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest.verify|verify} messages. + * 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.CreateReadSessionRequest + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus * @static - * @param {google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest} message CreateReadSessionRequest message or plain object to encode + * @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 */ - CreateReadSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { + StreamStatus.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateReadSessionRequest message from the specified reader or buffer. + * Decodes a StreamStatus message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @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.CreateReadSessionRequest} CreateReadSessionRequest + * @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 */ - CreateReadSessionRequest.decode = function decode(reader, length) { + 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.CreateReadSessionRequest(); + 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.tableReference = $root.google.cloud.bigquery.storage.v1beta1.TableReference.decode(reader, reader.uint32()); - break; - case 6: - message.parent = reader.string(); + message.estimatedRowCount = reader.int64(); break; case 2: - message.tableModifiers = $root.google.cloud.bigquery.storage.v1beta1.TableModifiers.decode(reader, reader.uint32()); - break; - case 3: - message.requestedStreams = reader.int32(); + message.fractionConsumed = reader.float(); 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); + message.progress = $root.google.cloud.bigquery.storage.v1beta1.Progress.decode(reader, reader.uint32()); 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: + message.isSplittable = reader.bool(); break; - } - if (message.shardingStrategy != null && message.hasOwnProperty("shardingStrategy")) - switch (message.shardingStrategy) { default: - return "shardingStrategy: enum value expected"; - case 0: - case 1: - case 2: + 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 CreateReadSessionRequest message from a plain object. Also converts values to their respective internal types. + * Creates a StreamStatus 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.v1beta1.StreamStatus * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest} CreateReadSessionRequest + * @returns {google.cloud.bigquery.storage.v1beta1.StreamStatus} StreamStatus */ - CreateReadSessionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest) + 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.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; + 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 CreateReadSessionRequest message. Also converts values to other types if specified. + * Creates a plain object from a StreamStatus message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus * @static - * @param {google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest} message CreateReadSessionRequest + * @param {google.cloud.bigquery.storage.v1beta1.StreamStatus} message StreamStatus * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateReadSessionRequest.toObject = function toObject(message, options) { + StreamStatus.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 ($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.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.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 CreateReadSessionRequest to JSON. + * Converts this StreamStatus to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.CreateReadSessionRequest + * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus * @instance * @returns {Object.} JSON object */ - CreateReadSessionRequest.prototype.toJSON = function toJSON() { + StreamStatus.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; + return StreamStatus; })(); - v1beta1.ReadRowsRequest = (function() { + v1beta1.Progress = (function() { /** - * Properties of a ReadRowsRequest. + * Properties of a Progress. * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface IReadRowsRequest - * @property {google.cloud.bigquery.storage.v1beta1.IStreamPosition|null} [readPosition] ReadRowsRequest readPosition + * @interface IProgress + * @property {number|null} [atResponseStart] Progress atResponseStart + * @property {number|null} [atResponseEnd] Progress atResponseEnd */ /** - * Constructs a new ReadRowsRequest. + * Constructs a new Progress. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a ReadRowsRequest. - * @implements IReadRowsRequest + * @classdesc Represents a Progress. + * @implements IProgress * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsRequest=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.IProgress=} [properties] Properties to set */ - function ReadRowsRequest(properties) { + function Progress(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3052,75 +3094,88 @@ } /** - * ReadRowsRequest readPosition. - * @member {google.cloud.bigquery.storage.v1beta1.IStreamPosition|null|undefined} readPosition - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * Progress atResponseStart. + * @member {number} atResponseStart + * @memberof google.cloud.bigquery.storage.v1beta1.Progress * @instance */ - ReadRowsRequest.prototype.readPosition = null; + Progress.prototype.atResponseStart = 0; /** - * Creates a new ReadRowsRequest instance using the specified properties. + * 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.ReadRowsRequest + * @memberof google.cloud.bigquery.storage.v1beta1.Progress * @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.v1beta1.IProgress=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.Progress} Progress instance */ - ReadRowsRequest.create = function create(properties) { - return new ReadRowsRequest(properties); + Progress.create = function create(properties) { + return new Progress(properties); }; /** - * Encodes the specified ReadRowsRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsRequest.verify|verify} messages. + * 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.ReadRowsRequest + * @memberof google.cloud.bigquery.storage.v1beta1.Progress * @static - * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsRequest} message ReadRowsRequest message or plain object to encode + * @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 */ - ReadRowsRequest.encode = function encode(message, writer) { + Progress.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(); + 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 ReadRowsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsRequest.verify|verify} messages. + * 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.ReadRowsRequest + * @memberof google.cloud.bigquery.storage.v1beta1.Progress * @static - * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsRequest} message ReadRowsRequest message or plain object to encode + * @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 */ - ReadRowsRequest.encodeDelimited = function encodeDelimited(message, writer) { + Progress.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReadRowsRequest message from the specified reader or buffer. + * Decodes a Progress message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @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.ReadRowsRequest} ReadRowsRequest + * @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 */ - ReadRowsRequest.decode = function decode(reader, length) { + 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.ReadRowsRequest(); + 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.readPosition = $root.google.cloud.bigquery.storage.v1beta1.StreamPosition.decode(reader, reader.uint32()); + message.atResponseStart = reader.float(); + break; + case 2: + message.atResponseEnd = reader.float(); break; default: reader.skipType(tag & 7); @@ -3131,115 +3186,116 @@ }; /** - * Decodes a ReadRowsRequest message from the specified reader or buffer, length delimited. + * Decodes a Progress message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @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.ReadRowsRequest} ReadRowsRequest + * @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 */ - ReadRowsRequest.decodeDelimited = function decodeDelimited(reader) { + Progress.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReadRowsRequest message. + * Verifies a Progress message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @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 */ - ReadRowsRequest.verify = function verify(message) { + Progress.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.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 ReadRowsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Progress 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.v1beta1.Progress * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsRequest} ReadRowsRequest + * @returns {google.cloud.bigquery.storage.v1beta1.Progress} Progress */ - ReadRowsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest) + 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.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.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 ReadRowsRequest message. Also converts values to other types if specified. + * Creates a plain object from a Progress message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @memberof google.cloud.bigquery.storage.v1beta1.Progress * @static - * @param {google.cloud.bigquery.storage.v1beta1.ReadRowsRequest} message ReadRowsRequest + * @param {google.cloud.bigquery.storage.v1beta1.Progress} message Progress * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadRowsRequest.toObject = function toObject(message, options) { + Progress.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.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 ReadRowsRequest to JSON. + * Converts this Progress to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsRequest + * @memberof google.cloud.bigquery.storage.v1beta1.Progress * @instance * @returns {Object.} JSON object */ - ReadRowsRequest.prototype.toJSON = function toJSON() { + Progress.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ReadRowsRequest; + return Progress; })(); - v1beta1.StreamStatus = (function() { + v1beta1.ThrottleStatus = (function() { /** - * Properties of a StreamStatus. + * Properties of a ThrottleStatus. * @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 + * @interface IThrottleStatus + * @property {number|null} [throttlePercent] ThrottleStatus throttlePercent */ /** - * Constructs a new StreamStatus. + * Constructs a new ThrottleStatus. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a StreamStatus. - * @implements IStreamStatus + * @classdesc Represents a ThrottleStatus. + * @implements IThrottleStatus * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IStreamStatus=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.IThrottleStatus=} [properties] Properties to set */ - function StreamStatus(properties) { + function ThrottleStatus(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3247,114 +3303,75 @@ } /** - * 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 + * ThrottleStatus throttlePercent. + * @member {number} throttlePercent + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus * @instance */ - StreamStatus.prototype.isSplittable = false; + ThrottleStatus.prototype.throttlePercent = 0; /** - * Creates a new StreamStatus instance using the specified properties. + * Creates a new ThrottleStatus instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus * @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.v1beta1.IThrottleStatus=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.ThrottleStatus} ThrottleStatus instance */ - StreamStatus.create = function create(properties) { - return new StreamStatus(properties); + ThrottleStatus.create = function create(properties) { + return new ThrottleStatus(properties); }; /** - * Encodes the specified StreamStatus message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.StreamStatus.verify|verify} messages. + * 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.StreamStatus + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus * @static - * @param {google.cloud.bigquery.storage.v1beta1.IStreamStatus} message StreamStatus message or plain object to encode + * @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 */ - StreamStatus.encode = function encode(message, writer) { + ThrottleStatus.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(); + if (message.throttlePercent != null && message.hasOwnProperty("throttlePercent")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.throttlePercent); 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 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.StreamStatus + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus * @static - * @param {google.cloud.bigquery.storage.v1beta1.IStreamStatus} message StreamStatus message or plain object to encode + * @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 */ - StreamStatus.encodeDelimited = function encodeDelimited(message, writer) { + ThrottleStatus.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a StreamStatus message from the specified reader or buffer. + * Decodes a ThrottleStatus message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @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.StreamStatus} StreamStatus + * @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 */ - StreamStatus.decode = function decode(reader, length) { + 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.StreamStatus(); + 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.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(); + message.throttlePercent = reader.int32(); break; default: reader.skipType(tag & 7); @@ -3365,152 +3382,111 @@ }; /** - * Decodes a StreamStatus message from the specified reader or buffer, length delimited. + * Decodes a ThrottleStatus message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @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.StreamStatus} StreamStatus + * @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 */ - StreamStatus.decodeDelimited = function decodeDelimited(reader) { + ThrottleStatus.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"; + * 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 StreamStatus message from a plain object. Also converts values to their respective internal types. + * Creates a ThrottleStatus 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.v1beta1.ThrottleStatus * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.StreamStatus} StreamStatus + * @returns {google.cloud.bigquery.storage.v1beta1.ThrottleStatus} ThrottleStatus */ - StreamStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.StreamStatus) + 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.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); + 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 StreamStatus message. Also converts values to other types if specified. + * Creates a plain object from a ThrottleStatus message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus * @static - * @param {google.cloud.bigquery.storage.v1beta1.StreamStatus} message StreamStatus + * @param {google.cloud.bigquery.storage.v1beta1.ThrottleStatus} message ThrottleStatus * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StreamStatus.toObject = function toObject(message, options) { + ThrottleStatus.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); + if (options.defaults) + object.throttlePercent = 0; + if (message.throttlePercent != null && message.hasOwnProperty("throttlePercent")) + object.throttlePercent = message.throttlePercent; return object; }; /** - * Converts this StreamStatus to JSON. + * Converts this ThrottleStatus to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.StreamStatus + * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus * @instance * @returns {Object.} JSON object */ - StreamStatus.prototype.toJSON = function toJSON() { + ThrottleStatus.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return StreamStatus; + return ThrottleStatus; })(); - v1beta1.Progress = (function() { + v1beta1.ReadRowsResponse = (function() { /** - * Properties of a Progress. + * Properties of a ReadRowsResponse. * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface IProgress - * @property {number|null} [atResponseStart] Progress atResponseStart - * @property {number|null} [atResponseEnd] Progress atResponseEnd + * @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 Progress. + * Constructs a new ReadRowsResponse. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a Progress. - * @implements IProgress + * @classdesc Represents a ReadRowsResponse. + * @implements IReadRowsResponse * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IProgress=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsResponse=} [properties] Properties to set */ - function Progress(properties) { + function ReadRowsResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3518,88 +3494,141 @@ } /** - * Progress atResponseStart. - * @member {number} atResponseStart - * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * ReadRowsResponse avroRows. + * @member {google.cloud.bigquery.storage.v1beta1.IAvroRows|null|undefined} avroRows + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse * @instance */ - Progress.prototype.atResponseStart = 0; + ReadRowsResponse.prototype.avroRows = null; /** - * Progress atResponseEnd. - * @member {number} atResponseEnd - * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * ReadRowsResponse arrowRecordBatch. + * @member {google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch|null|undefined} arrowRecordBatch + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse * @instance */ - Progress.prototype.atResponseEnd = 0; + ReadRowsResponse.prototype.arrowRecordBatch = null; /** - * Creates a new Progress instance using the specified properties. + * 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.Progress + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse * @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.IReadRowsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} ReadRowsResponse instance */ - Progress.create = function create(properties) { - return new Progress(properties); + ReadRowsResponse.create = function create(properties) { + return new ReadRowsResponse(properties); }; /** - * Encodes the specified Progress message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Progress.verify|verify} messages. + * 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.Progress + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse * @static - * @param {google.cloud.bigquery.storage.v1beta1.IProgress} message Progress message or plain object to encode + * @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 */ - Progress.encode = function encode(message, writer) { + ReadRowsResponse.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); + 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 Progress message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.Progress.verify|verify} messages. + * 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.Progress + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse * @static - * @param {google.cloud.bigquery.storage.v1beta1.IProgress} message Progress message or plain object to encode + * @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 */ - Progress.encodeDelimited = function encodeDelimited(message, writer) { + ReadRowsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Progress message from the specified reader or buffer. + * Decodes a ReadRowsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @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.Progress} Progress + * @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 */ - Progress.decode = function decode(reader, length) { + 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.Progress(); + 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 1: - message.atResponseStart = reader.float(); + 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.atResponseEnd = reader.float(); + 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); @@ -3610,116 +3639,188 @@ }; /** - * Decodes a Progress message from the specified reader or buffer, length delimited. + * Decodes a ReadRowsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @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.Progress} Progress + * @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 */ - Progress.decodeDelimited = function decodeDelimited(reader) { + ReadRowsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Progress message. + * Verifies a ReadRowsResponse message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @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 */ - Progress.verify = function verify(message) { + ReadRowsResponse.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"; + 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 Progress message from a plain object. Also converts values to their respective internal types. + * Creates a ReadRowsResponse 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.ReadRowsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.Progress} Progress + * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} ReadRowsResponse */ - Progress.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.Progress) + 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.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.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 Progress message. Also converts values to other types if specified. + * Creates a plain object from a ReadRowsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse * @static - * @param {google.cloud.bigquery.storage.v1beta1.Progress} message Progress + * @param {google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} message ReadRowsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Progress.toObject = function toObject(message, options) { + ReadRowsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.atResponseStart = 0; - object.atResponseEnd = 0; + 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.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 (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 Progress to JSON. + * Converts this ReadRowsResponse to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.Progress + * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse * @instance * @returns {Object.} JSON object */ - Progress.prototype.toJSON = function toJSON() { + ReadRowsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Progress; + return ReadRowsResponse; })(); - v1beta1.ThrottleStatus = (function() { + v1beta1.BatchCreateReadSessionStreamsRequest = (function() { /** - * Properties of a ThrottleStatus. + * Properties of a BatchCreateReadSessionStreamsRequest. * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface IThrottleStatus - * @property {number|null} [throttlePercent] ThrottleStatus throttlePercent + * @interface IBatchCreateReadSessionStreamsRequest + * @property {google.cloud.bigquery.storage.v1beta1.IReadSession|null} [session] BatchCreateReadSessionStreamsRequest session + * @property {number|null} [requestedStreams] BatchCreateReadSessionStreamsRequest requestedStreams */ /** - * Constructs a new ThrottleStatus. + * Constructs a new BatchCreateReadSessionStreamsRequest. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a ThrottleStatus. - * @implements IThrottleStatus + * @classdesc Represents a BatchCreateReadSessionStreamsRequest. + * @implements IBatchCreateReadSessionStreamsRequest * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IThrottleStatus=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest=} [properties] Properties to set */ - function ThrottleStatus(properties) { + function BatchCreateReadSessionStreamsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3727,75 +3828,88 @@ } /** - * ThrottleStatus throttlePercent. - * @member {number} throttlePercent - * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * BatchCreateReadSessionStreamsRequest session. + * @member {google.cloud.bigquery.storage.v1beta1.IReadSession|null|undefined} session + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest * @instance */ - ThrottleStatus.prototype.throttlePercent = 0; + BatchCreateReadSessionStreamsRequest.prototype.session = null; /** - * Creates a new ThrottleStatus instance using the specified properties. + * 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.ThrottleStatus + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest * @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.IBatchCreateReadSessionStreamsRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest} BatchCreateReadSessionStreamsRequest instance */ - ThrottleStatus.create = function create(properties) { - return new ThrottleStatus(properties); + BatchCreateReadSessionStreamsRequest.create = function create(properties) { + return new BatchCreateReadSessionStreamsRequest(properties); }; /** - * Encodes the specified ThrottleStatus message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ThrottleStatus.verify|verify} messages. + * 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.ThrottleStatus + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.IThrottleStatus} message ThrottleStatus message or plain object to encode + * @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 */ - ThrottleStatus.encode = function encode(message, writer) { + BatchCreateReadSessionStreamsRequest.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); + 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 ThrottleStatus message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ThrottleStatus.verify|verify} messages. + * 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.ThrottleStatus + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.IThrottleStatus} message ThrottleStatus message or plain object to encode + * @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 */ - ThrottleStatus.encodeDelimited = function encodeDelimited(message, writer) { + BatchCreateReadSessionStreamsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ThrottleStatus message from the specified reader or buffer. + * Decodes a BatchCreateReadSessionStreamsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @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.ThrottleStatus} ThrottleStatus + * @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 */ - ThrottleStatus.decode = function decode(reader, length) { + 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.ThrottleStatus(); + 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.throttlePercent = reader.int32(); + 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); @@ -3806,111 +3920,122 @@ }; /** - * Decodes a ThrottleStatus message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateReadSessionStreamsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @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.ThrottleStatus} ThrottleStatus + * @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 */ - ThrottleStatus.decodeDelimited = function decodeDelimited(reader) { + BatchCreateReadSessionStreamsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ThrottleStatus message. + * Verifies a BatchCreateReadSessionStreamsRequest message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @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 */ - ThrottleStatus.verify = function verify(message) { + BatchCreateReadSessionStreamsRequest.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.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 ThrottleStatus message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateReadSessionStreamsRequest 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.BatchCreateReadSessionStreamsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.ThrottleStatus} ThrottleStatus + * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest} BatchCreateReadSessionStreamsRequest */ - ThrottleStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.ThrottleStatus) + 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.ThrottleStatus(); - if (object.throttlePercent != null) - message.throttlePercent = object.throttlePercent | 0; + 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 ThrottleStatus message. Also converts values to other types if specified. + * Creates a plain object from a BatchCreateReadSessionStreamsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.ThrottleStatus} message ThrottleStatus + * @param {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest} message BatchCreateReadSessionStreamsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ThrottleStatus.toObject = function toObject(message, options) { + BatchCreateReadSessionStreamsRequest.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) { + 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 ThrottleStatus to JSON. + * Converts this BatchCreateReadSessionStreamsRequest to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.ThrottleStatus + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest * @instance * @returns {Object.} JSON object */ - ThrottleStatus.prototype.toJSON = function toJSON() { + BatchCreateReadSessionStreamsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ThrottleStatus; + return BatchCreateReadSessionStreamsRequest; })(); - v1beta1.ReadRowsResponse = (function() { + v1beta1.BatchCreateReadSessionStreamsResponse = (function() { /** - * Properties of a ReadRowsResponse. + * Properties of a BatchCreateReadSessionStreamsResponse. * @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 IBatchCreateReadSessionStreamsResponse + * @property {Array.|null} [streams] BatchCreateReadSessionStreamsResponse streams */ /** - * Constructs a new ReadRowsResponse. + * Constructs a new BatchCreateReadSessionStreamsResponse. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a ReadRowsResponse. - * @implements IReadRowsResponse + * @classdesc Represents a BatchCreateReadSessionStreamsResponse. + * @implements IBatchCreateReadSessionStreamsResponse * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsResponse=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse=} [properties] Properties to set */ - function ReadRowsResponse(properties) { + function BatchCreateReadSessionStreamsResponse(properties) { + this.streams = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3918,141 +4043,78 @@ } /** - * 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 + * BatchCreateReadSessionStreamsResponse streams. + * @member {Array.} streams + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse * @instance */ - Object.defineProperty(ReadRowsResponse.prototype, "rows", { - get: $util.oneOfGetter($oneOfFields = ["avroRows", "arrowRecordBatch"]), - set: $util.oneOfSetter($oneOfFields) - }); + BatchCreateReadSessionStreamsResponse.prototype.streams = $util.emptyArray; /** - * Creates a new ReadRowsResponse instance using the specified properties. + * Creates a new BatchCreateReadSessionStreamsResponse instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse * @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.IBatchCreateReadSessionStreamsResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse} BatchCreateReadSessionStreamsResponse instance */ - ReadRowsResponse.create = function create(properties) { - return new ReadRowsResponse(properties); + BatchCreateReadSessionStreamsResponse.create = function create(properties) { + return new BatchCreateReadSessionStreamsResponse(properties); }; /** - * Encodes the specified ReadRowsResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.verify|verify} messages. + * 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.ReadRowsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse * @static - * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsResponse} message ReadRowsResponse message or plain object to encode + * @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 */ - ReadRowsResponse.encode = function encode(message, writer) { + BatchCreateReadSessionStreamsResponse.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); + 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 ReadRowsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.ReadRowsResponse.verify|verify} messages. + * 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.ReadRowsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse * @static - * @param {google.cloud.bigquery.storage.v1beta1.IReadRowsResponse} message ReadRowsResponse message or plain object to encode + * @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 */ - ReadRowsResponse.encodeDelimited = function encodeDelimited(message, writer) { + BatchCreateReadSessionStreamsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReadRowsResponse message from the specified reader or buffer. + * Decodes a BatchCreateReadSessionStreamsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @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.ReadRowsResponse} ReadRowsResponse + * @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 */ - ReadRowsResponse.decode = function decode(reader, length) { + 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.ReadRowsResponse(); + 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 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: + 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); @@ -4063,188 +4125,124 @@ }; /** - * Decodes a ReadRowsResponse message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateReadSessionStreamsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @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.ReadRowsResponse} ReadRowsResponse + * @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 */ - ReadRowsResponse.decodeDelimited = function decodeDelimited(reader) { + BatchCreateReadSessionStreamsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReadRowsResponse message. + * Verifies a BatchCreateReadSessionStreamsResponse message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @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 */ - ReadRowsResponse.verify = function verify(message) { + BatchCreateReadSessionStreamsResponse.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 (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 "arrowRecordBatch." + error; + return "streams." + 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. + * Creates a BatchCreateReadSessionStreamsResponse 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.BatchCreateReadSessionStreamsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} ReadRowsResponse + * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse} BatchCreateReadSessionStreamsResponse */ - ReadRowsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.ReadRowsResponse) + 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.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.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 ReadRowsResponse message. Also converts values to other types if specified. + * Creates a plain object from a BatchCreateReadSessionStreamsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse * @static - * @param {google.cloud.bigquery.storage.v1beta1.ReadRowsResponse} message ReadRowsResponse + * @param {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse} message BatchCreateReadSessionStreamsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadRowsResponse.toObject = function toObject(message, options) { + BatchCreateReadSessionStreamsResponse.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 (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); } - 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. + * Converts this BatchCreateReadSessionStreamsResponse to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.ReadRowsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse * @instance * @returns {Object.} JSON object */ - ReadRowsResponse.prototype.toJSON = function toJSON() { + BatchCreateReadSessionStreamsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ReadRowsResponse; + return BatchCreateReadSessionStreamsResponse; })(); - v1beta1.BatchCreateReadSessionStreamsRequest = (function() { + v1beta1.FinalizeStreamRequest = (function() { /** - * Properties of a BatchCreateReadSessionStreamsRequest. + * Properties of a FinalizeStreamRequest. * @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 IFinalizeStreamRequest + * @property {google.cloud.bigquery.storage.v1beta1.IStream|null} [stream] FinalizeStreamRequest stream */ /** - * Constructs a new BatchCreateReadSessionStreamsRequest. + * Constructs a new FinalizeStreamRequest. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a BatchCreateReadSessionStreamsRequest. - * @implements IBatchCreateReadSessionStreamsRequest + * @classdesc Represents a FinalizeStreamRequest. + * @implements IFinalizeStreamRequest * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest=} [properties] Properties to set */ - function BatchCreateReadSessionStreamsRequest(properties) { + function FinalizeStreamRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4252,88 +4250,75 @@ } /** - * 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 + * FinalizeStreamRequest stream. + * @member {google.cloud.bigquery.storage.v1beta1.IStream|null|undefined} stream + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest * @instance */ - BatchCreateReadSessionStreamsRequest.prototype.requestedStreams = 0; + FinalizeStreamRequest.prototype.stream = null; /** - * Creates a new BatchCreateReadSessionStreamsRequest instance using the specified properties. + * Creates a new FinalizeStreamRequest instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest * @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.IFinalizeStreamRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest} FinalizeStreamRequest instance */ - BatchCreateReadSessionStreamsRequest.create = function create(properties) { - return new BatchCreateReadSessionStreamsRequest(properties); + FinalizeStreamRequest.create = function create(properties) { + return new FinalizeStreamRequest(properties); }; /** - * Encodes the specified BatchCreateReadSessionStreamsRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest.verify|verify} messages. + * 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.BatchCreateReadSessionStreamsRequest + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest} message BatchCreateReadSessionStreamsRequest message or plain object to encode + * @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 */ - BatchCreateReadSessionStreamsRequest.encode = function encode(message, writer) { + FinalizeStreamRequest.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); + 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 BatchCreateReadSessionStreamsRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest.verify|verify} messages. + * 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.BatchCreateReadSessionStreamsRequest + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest} message BatchCreateReadSessionStreamsRequest message or plain object to encode + * @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 */ - BatchCreateReadSessionStreamsRequest.encodeDelimited = function encodeDelimited(message, writer) { + FinalizeStreamRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateReadSessionStreamsRequest message from the specified reader or buffer. + * Decodes a FinalizeStreamRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @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.BatchCreateReadSessionStreamsRequest} BatchCreateReadSessionStreamsRequest + * @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 */ - BatchCreateReadSessionStreamsRequest.decode = function decode(reader, length) { + 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.BatchCreateReadSessionStreamsRequest(); + 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 1: - message.session = $root.google.cloud.bigquery.storage.v1beta1.ReadSession.decode(reader, reader.uint32()); - break; case 2: - message.requestedStreams = reader.int32(); + message.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4344,122 +4329,113 @@ }; /** - * Decodes a BatchCreateReadSessionStreamsRequest message from the specified reader or buffer, length delimited. + * Decodes a FinalizeStreamRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @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.BatchCreateReadSessionStreamsRequest} BatchCreateReadSessionStreamsRequest + * @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 */ - BatchCreateReadSessionStreamsRequest.decodeDelimited = function decodeDelimited(reader) { + FinalizeStreamRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchCreateReadSessionStreamsRequest message. + * Verifies a FinalizeStreamRequest message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @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 */ - BatchCreateReadSessionStreamsRequest.verify = function verify(message) { + FinalizeStreamRequest.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 (message.stream != null && message.hasOwnProperty("stream")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.stream); if (error) - return "session." + error; + return "stream." + 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. + * Creates a FinalizeStreamRequest 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.FinalizeStreamRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest} BatchCreateReadSessionStreamsRequest + * @returns {google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest} FinalizeStreamRequest */ - BatchCreateReadSessionStreamsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest) + 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.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); + 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); } - 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. + * Creates a plain object from a FinalizeStreamRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest} message BatchCreateReadSessionStreamsRequest + * @param {google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest} message FinalizeStreamRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateReadSessionStreamsRequest.toObject = function toObject(message, options) { + FinalizeStreamRequest.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; + 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 BatchCreateReadSessionStreamsRequest to JSON. + * Converts this FinalizeStreamRequest to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsRequest + * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest * @instance * @returns {Object.} JSON object */ - BatchCreateReadSessionStreamsRequest.prototype.toJSON = function toJSON() { + FinalizeStreamRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchCreateReadSessionStreamsRequest; + return FinalizeStreamRequest; })(); - v1beta1.BatchCreateReadSessionStreamsResponse = (function() { + v1beta1.SplitReadStreamRequest = (function() { /** - * Properties of a BatchCreateReadSessionStreamsResponse. + * Properties of a SplitReadStreamRequest. * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface IBatchCreateReadSessionStreamsResponse - * @property {Array.|null} [streams] BatchCreateReadSessionStreamsResponse streams + * @interface ISplitReadStreamRequest + * @property {google.cloud.bigquery.storage.v1beta1.IStream|null} [originalStream] SplitReadStreamRequest originalStream + * @property {number|null} [fraction] SplitReadStreamRequest fraction */ /** - * Constructs a new BatchCreateReadSessionStreamsResponse. + * Constructs a new SplitReadStreamRequest. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a BatchCreateReadSessionStreamsResponse. - * @implements IBatchCreateReadSessionStreamsResponse + * @classdesc Represents a SplitReadStreamRequest. + * @implements ISplitReadStreamRequest * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest=} [properties] Properties to set */ - function BatchCreateReadSessionStreamsResponse(properties) { - this.streams = []; + function SplitReadStreamRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4467,78 +4443,88 @@ } /** - * BatchCreateReadSessionStreamsResponse streams. - * @member {Array.} streams - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * SplitReadStreamRequest originalStream. + * @member {google.cloud.bigquery.storage.v1beta1.IStream|null|undefined} originalStream + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest * @instance */ - BatchCreateReadSessionStreamsResponse.prototype.streams = $util.emptyArray; + SplitReadStreamRequest.prototype.originalStream = null; /** - * Creates a new BatchCreateReadSessionStreamsResponse instance using the specified properties. + * 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.BatchCreateReadSessionStreamsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest * @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.ISplitReadStreamRequest=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest} SplitReadStreamRequest instance */ - BatchCreateReadSessionStreamsResponse.create = function create(properties) { - return new BatchCreateReadSessionStreamsResponse(properties); + SplitReadStreamRequest.create = function create(properties) { + return new SplitReadStreamRequest(properties); }; /** - * Encodes the specified BatchCreateReadSessionStreamsResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse.verify|verify} messages. + * 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.BatchCreateReadSessionStreamsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse} message BatchCreateReadSessionStreamsResponse message or plain object to encode + * @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 */ - BatchCreateReadSessionStreamsResponse.encode = function encode(message, writer) { + SplitReadStreamRequest.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.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 BatchCreateReadSessionStreamsResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse.verify|verify} messages. + * 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.BatchCreateReadSessionStreamsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse} message BatchCreateReadSessionStreamsResponse message or plain object to encode + * @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 */ - BatchCreateReadSessionStreamsResponse.encodeDelimited = function encodeDelimited(message, writer) { + SplitReadStreamRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateReadSessionStreamsResponse message from the specified reader or buffer. + * Decodes a SplitReadStreamRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @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.BatchCreateReadSessionStreamsResponse} BatchCreateReadSessionStreamsResponse + * @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 */ - BatchCreateReadSessionStreamsResponse.decode = function decode(reader, length) { + 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.BatchCreateReadSessionStreamsResponse(); + 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: - if (!(message.streams && message.streams.length)) - message.streams = []; - message.streams.push($root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32())); + 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); @@ -4549,124 +4535,122 @@ }; /** - * Decodes a BatchCreateReadSessionStreamsResponse message from the specified reader or buffer, length delimited. + * Decodes a SplitReadStreamRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @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.BatchCreateReadSessionStreamsResponse} BatchCreateReadSessionStreamsResponse + * @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 */ - BatchCreateReadSessionStreamsResponse.decodeDelimited = function decodeDelimited(reader) { + SplitReadStreamRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchCreateReadSessionStreamsResponse message. + * Verifies a SplitReadStreamRequest message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @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 */ - BatchCreateReadSessionStreamsResponse.verify = function verify(message) { + SplitReadStreamRequest.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.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 BatchCreateReadSessionStreamsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SplitReadStreamRequest 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.SplitReadStreamRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse} BatchCreateReadSessionStreamsResponse + * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest} SplitReadStreamRequest */ - BatchCreateReadSessionStreamsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse) + 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.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.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 BatchCreateReadSessionStreamsResponse message. Also converts values to other types if specified. + * Creates a plain object from a SplitReadStreamRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest * @static - * @param {google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse} message BatchCreateReadSessionStreamsResponse + * @param {google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest} message SplitReadStreamRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateReadSessionStreamsResponse.toObject = function toObject(message, options) { + SplitReadStreamRequest.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); + 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 BatchCreateReadSessionStreamsResponse to JSON. + * Converts this SplitReadStreamRequest to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.BatchCreateReadSessionStreamsResponse + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest * @instance * @returns {Object.} JSON object */ - BatchCreateReadSessionStreamsResponse.prototype.toJSON = function toJSON() { + SplitReadStreamRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchCreateReadSessionStreamsResponse; + return SplitReadStreamRequest; })(); - v1beta1.FinalizeStreamRequest = (function() { + v1beta1.SplitReadStreamResponse = (function() { /** - * Properties of a FinalizeStreamRequest. + * Properties of a SplitReadStreamResponse. * @memberof google.cloud.bigquery.storage.v1beta1 - * @interface IFinalizeStreamRequest - * @property {google.cloud.bigquery.storage.v1beta1.IStream|null} [stream] FinalizeStreamRequest stream + * @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 FinalizeStreamRequest. + * Constructs a new SplitReadStreamResponse. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a FinalizeStreamRequest. - * @implements IFinalizeStreamRequest + * @classdesc Represents a SplitReadStreamResponse. + * @implements ISplitReadStreamResponse * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse=} [properties] Properties to set */ - function FinalizeStreamRequest(properties) { + function SplitReadStreamResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4674,75 +4658,88 @@ } /** - * FinalizeStreamRequest stream. - * @member {google.cloud.bigquery.storage.v1beta1.IStream|null|undefined} stream - * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * SplitReadStreamResponse primaryStream. + * @member {google.cloud.bigquery.storage.v1beta1.IStream|null|undefined} primaryStream + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse * @instance */ - FinalizeStreamRequest.prototype.stream = null; + SplitReadStreamResponse.prototype.primaryStream = null; /** - * Creates a new FinalizeStreamRequest instance using the specified properties. + * 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.FinalizeStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse * @static - * @param {google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest=} [properties] Properties to set - * @returns {google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest} FinalizeStreamRequest instance + * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse} SplitReadStreamResponse instance */ - FinalizeStreamRequest.create = function create(properties) { - return new FinalizeStreamRequest(properties); + SplitReadStreamResponse.create = function create(properties) { + return new SplitReadStreamResponse(properties); }; /** - * Encodes the specified FinalizeStreamRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest.verify|verify} messages. + * 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.FinalizeStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse * @static - * @param {google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest} message FinalizeStreamRequest message or plain object to encode + * @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 */ - FinalizeStreamRequest.encode = function encode(message, writer) { + SplitReadStreamResponse.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(); + 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 FinalizeStreamRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest.verify|verify} messages. + * 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.FinalizeStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse * @static - * @param {google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest} message FinalizeStreamRequest message or plain object to encode + * @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 */ - FinalizeStreamRequest.encodeDelimited = function encodeDelimited(message, writer) { + SplitReadStreamResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FinalizeStreamRequest message from the specified reader or buffer. + * Decodes a SplitReadStreamResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @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.FinalizeStreamRequest} FinalizeStreamRequest + * @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 */ - FinalizeStreamRequest.decode = function decode(reader, length) { + 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.FinalizeStreamRequest(); + 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.stream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); + message.remainderStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4753,113 +4750,128 @@ }; /** - * Decodes a FinalizeStreamRequest message from the specified reader or buffer, length delimited. + * Decodes a SplitReadStreamResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @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.FinalizeStreamRequest} FinalizeStreamRequest + * @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 */ - FinalizeStreamRequest.decodeDelimited = function decodeDelimited(reader) { + SplitReadStreamResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FinalizeStreamRequest message. + * Verifies a SplitReadStreamResponse message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @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 */ - FinalizeStreamRequest.verify = function verify(message) { + SplitReadStreamResponse.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 (message.primaryStream != null && message.hasOwnProperty("primaryStream")) { + var error = $root.google.cloud.bigquery.storage.v1beta1.Stream.verify(message.primaryStream); if (error) - return "stream." + 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 FinalizeStreamRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SplitReadStreamResponse 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.SplitReadStreamResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest} FinalizeStreamRequest + * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse} SplitReadStreamResponse */ - 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); + 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 FinalizeStreamRequest message. Also converts values to other types if specified. + * Creates a plain object from a SplitReadStreamResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse * @static - * @param {google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest} message FinalizeStreamRequest + * @param {google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse} message SplitReadStreamResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FinalizeStreamRequest.toObject = function toObject(message, options) { + SplitReadStreamResponse.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); + 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 FinalizeStreamRequest to JSON. + * Converts this SplitReadStreamResponse to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.FinalizeStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse * @instance * @returns {Object.} JSON object */ - FinalizeStreamRequest.prototype.toJSON = function toJSON() { + SplitReadStreamResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return FinalizeStreamRequest; + return SplitReadStreamResponse; })(); - v1beta1.SplitReadStreamRequest = (function() { + v1beta1.TableReference = (function() { /** - * Properties of a SplitReadStreamRequest. + * Properties of a TableReference. * @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 ITableReference + * @property {string|null} [projectId] TableReference projectId + * @property {string|null} [datasetId] TableReference datasetId + * @property {string|null} [tableId] TableReference tableId */ /** - * Constructs a new SplitReadStreamRequest. + * Constructs a new TableReference. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a SplitReadStreamRequest. - * @implements ISplitReadStreamRequest + * @classdesc Represents a TableReference. + * @implements ITableReference * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.ITableReference=} [properties] Properties to set */ - function SplitReadStreamRequest(properties) { + function TableReference(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4867,88 +4879,101 @@ } /** - * SplitReadStreamRequest originalStream. - * @member {google.cloud.bigquery.storage.v1beta1.IStream|null|undefined} originalStream - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * TableReference projectId. + * @member {string} projectId + * @memberof google.cloud.bigquery.storage.v1beta1.TableReference * @instance */ - SplitReadStreamRequest.prototype.originalStream = null; + TableReference.prototype.projectId = ""; /** - * SplitReadStreamRequest fraction. - * @member {number} fraction - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * TableReference datasetId. + * @member {string} datasetId + * @memberof google.cloud.bigquery.storage.v1beta1.TableReference * @instance */ - SplitReadStreamRequest.prototype.fraction = 0; + TableReference.prototype.datasetId = ""; /** - * Creates a new SplitReadStreamRequest instance using the specified properties. + * 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.SplitReadStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.TableReference * @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.ITableReference=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.TableReference} TableReference instance */ - SplitReadStreamRequest.create = function create(properties) { - return new SplitReadStreamRequest(properties); + TableReference.create = function create(properties) { + return new TableReference(properties); }; /** - * Encodes the specified SplitReadStreamRequest message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest.verify|verify} messages. + * 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.SplitReadStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.TableReference * @static - * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest} message SplitReadStreamRequest message or plain object to encode + * @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 */ - SplitReadStreamRequest.encode = function encode(message, writer) { + TableReference.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); + 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 SplitReadStreamRequest message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest.verify|verify} messages. + * 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.SplitReadStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.TableReference * @static - * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest} message SplitReadStreamRequest message or plain object to encode + * @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 */ - SplitReadStreamRequest.encodeDelimited = function encodeDelimited(message, writer) { + TableReference.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SplitReadStreamRequest message from the specified reader or buffer. + * Decodes a TableReference message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @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.SplitReadStreamRequest} SplitReadStreamRequest + * @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 */ - SplitReadStreamRequest.decode = function decode(reader, length) { + 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.SplitReadStreamRequest(); + 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.originalStream = $root.google.cloud.bigquery.storage.v1beta1.Stream.decode(reader, reader.uint32()); + message.projectId = reader.string(); break; case 2: - message.fraction = reader.float(); + message.datasetId = reader.string(); + break; + case 3: + message.tableId = reader.string(); break; default: reader.skipType(tag & 7); @@ -4959,122 +4984,124 @@ }; /** - * Decodes a SplitReadStreamRequest message from the specified reader or buffer, length delimited. + * Decodes a TableReference message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @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.SplitReadStreamRequest} SplitReadStreamRequest + * @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 */ - SplitReadStreamRequest.decodeDelimited = function decodeDelimited(reader) { + TableReference.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SplitReadStreamRequest message. + * Verifies a TableReference message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @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 */ - SplitReadStreamRequest.verify = function verify(message) { + TableReference.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"; + 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 SplitReadStreamRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TableReference 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.TableReference * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest} SplitReadStreamRequest + * @returns {google.cloud.bigquery.storage.v1beta1.TableReference} TableReference */ - SplitReadStreamRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest) + 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.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); + 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 SplitReadStreamRequest message. Also converts values to other types if specified. + * Creates a plain object from a TableReference message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.TableReference * @static - * @param {google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest} message SplitReadStreamRequest + * @param {google.cloud.bigquery.storage.v1beta1.TableReference} message TableReference * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SplitReadStreamRequest.toObject = function toObject(message, options) { + TableReference.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.originalStream = null; - object.fraction = 0; + object.projectId = ""; + object.datasetId = ""; + object.tableId = ""; } - 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.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 SplitReadStreamRequest to JSON. + * Converts this TableReference to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamRequest + * @memberof google.cloud.bigquery.storage.v1beta1.TableReference * @instance * @returns {Object.} JSON object */ - SplitReadStreamRequest.prototype.toJSON = function toJSON() { + TableReference.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SplitReadStreamRequest; + return TableReference; })(); - v1beta1.SplitReadStreamResponse = (function() { + v1beta1.TableModifiers = (function() { /** - * Properties of a SplitReadStreamResponse. + * Properties of a TableModifiers. * @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 ITableModifiers + * @property {google.protobuf.ITimestamp|null} [snapshotTime] TableModifiers snapshotTime */ /** - * Constructs a new SplitReadStreamResponse. + * Constructs a new TableModifiers. * @memberof google.cloud.bigquery.storage.v1beta1 - * @classdesc Represents a SplitReadStreamResponse. - * @implements ISplitReadStreamResponse + * @classdesc Represents a TableModifiers. + * @implements ITableModifiers * @constructor - * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse=} [properties] Properties to set + * @param {google.cloud.bigquery.storage.v1beta1.ITableModifiers=} [properties] Properties to set */ - function SplitReadStreamResponse(properties) { + function TableModifiers(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5082,88 +5109,75 @@ } /** - * 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 + * TableModifiers snapshotTime. + * @member {google.protobuf.ITimestamp|null|undefined} snapshotTime + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers * @instance */ - SplitReadStreamResponse.prototype.remainderStream = null; + TableModifiers.prototype.snapshotTime = null; /** - * Creates a new SplitReadStreamResponse instance using the specified properties. + * Creates a new TableModifiers instance using the specified properties. * @function create - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers * @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.ITableModifiers=} [properties] Properties to set + * @returns {google.cloud.bigquery.storage.v1beta1.TableModifiers} TableModifiers instance */ - SplitReadStreamResponse.create = function create(properties) { - return new SplitReadStreamResponse(properties); + TableModifiers.create = function create(properties) { + return new TableModifiers(properties); }; /** - * Encodes the specified SplitReadStreamResponse message. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse.verify|verify} messages. + * 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.SplitReadStreamResponse + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers * @static - * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse} message SplitReadStreamResponse message or plain object to encode + * @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 */ - SplitReadStreamResponse.encode = function encode(message, writer) { + TableModifiers.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(); + 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 SplitReadStreamResponse message, length delimited. Does not implicitly {@link google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse.verify|verify} messages. + * 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.SplitReadStreamResponse + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers * @static - * @param {google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse} message SplitReadStreamResponse message or plain object to encode + * @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 */ - SplitReadStreamResponse.encodeDelimited = function encodeDelimited(message, writer) { + TableModifiers.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SplitReadStreamResponse message from the specified reader or buffer. + * Decodes a TableModifiers message from the specified reader or buffer. * @function decode - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @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.SplitReadStreamResponse} SplitReadStreamResponse + * @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 */ - SplitReadStreamResponse.decode = function decode(reader, length) { + 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.SplitReadStreamResponse(); + 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.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()); + message.snapshotTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -5174,106 +5188,92 @@ }; /** - * Decodes a SplitReadStreamResponse message from the specified reader or buffer, length delimited. + * Decodes a TableModifiers message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @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.SplitReadStreamResponse} SplitReadStreamResponse + * @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 */ - SplitReadStreamResponse.decodeDelimited = function decodeDelimited(reader) { + TableModifiers.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SplitReadStreamResponse message. + * Verifies a TableModifiers message. * @function verify - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @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 */ - SplitReadStreamResponse.verify = function verify(message) { + TableModifiers.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 (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.snapshotTime); if (error) - return "remainderStream." + error; + return "snapshotTime." + error; } return null; }; /** - * Creates a SplitReadStreamResponse message from a plain object. Also converts values to their respective internal types. + * Creates a TableModifiers 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.TableModifiers * @static * @param {Object.} object Plain object - * @returns {google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse} SplitReadStreamResponse + * @returns {google.cloud.bigquery.storage.v1beta1.TableModifiers} TableModifiers */ - SplitReadStreamResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse) + 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.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.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 SplitReadStreamResponse message. Also converts values to other types if specified. + * Creates a plain object from a TableModifiers message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers * @static - * @param {google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse} message SplitReadStreamResponse + * @param {google.cloud.bigquery.storage.v1beta1.TableModifiers} message TableModifiers * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SplitReadStreamResponse.toObject = function toObject(message, options) { + TableModifiers.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); + 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 SplitReadStreamResponse to JSON. + * Converts this TableModifiers to JSON. * @function toJSON - * @memberof google.cloud.bigquery.storage.v1beta1.SplitReadStreamResponse + * @memberof google.cloud.bigquery.storage.v1beta1.TableModifiers * @instance * @returns {Object.} JSON object */ - SplitReadStreamResponse.prototype.toJSON = function toJSON() { + TableModifiers.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SplitReadStreamResponse; + return TableModifiers; })(); return v1beta1; @@ -5297,30 +5297,26 @@ */ var api = {}; - api.ResourceDescriptor = (function() { + api.Http = (function() { /** - * Properties of a ResourceDescriptor. + * Properties of a Http. * @memberof google.api - * @interface IResourceDescriptor - * @property {string|null} [type] ResourceDescriptor type - * @property {Array.|null} [pattern] ResourceDescriptor pattern - * @property {string|null} [nameField] ResourceDescriptor nameField - * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history - * @property {string|null} [plural] ResourceDescriptor plural - * @property {string|null} [singular] ResourceDescriptor singular + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion */ /** - * Constructs a new ResourceDescriptor. + * Constructs a new Http. * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor + * @classdesc Represents a Http. + * @implements IHttp * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @param {google.api.IHttp=} [properties] Properties to set */ - function ResourceDescriptor(properties) { - this.pattern = []; + function Http(properties) { + this.rules = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5328,143 +5324,91 @@ } /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; - - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; - - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; - - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; - - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http * @instance */ - ResourceDescriptor.prototype.plural = ""; + Http.prototype.rules = $util.emptyArray; /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http * @instance */ - ResourceDescriptor.prototype.singular = ""; + Http.prototype.fullyDecodeReservedExpansion = false; /** - * Creates a new ResourceDescriptor instance using the specified properties. + * Creates a new Http instance using the specified properties. * @function create - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); + Http.create = function create(properties) { + return new Http(properties); }; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encode - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encode = function encode(message, writer) { + Http.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.pattern != null && message.pattern.length) - for (var i = 0; i < message.pattern.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && message.hasOwnProperty("nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && message.hasOwnProperty("history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && message.hasOwnProperty("plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && message.hasOwnProperty("singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); return writer; }; /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + Http.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * Decodes a Http message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.api.Http} Http * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceDescriptor.decode = function decode(reader, length) { + Http.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type = reader.string(); + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); break; case 2: - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); - break; - case 3: - message.nameField = reader.string(); - break; - case 4: - message.history = reader.int32(); - break; - case 5: - message.plural = reader.string(); - break; - case 6: - message.singular = reader.string(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -5475,285 +5419,353 @@ }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes a Http message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.api.Http} Http * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + Http.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceDescriptor message. + * Verifies a Http message. * @function verify - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ResourceDescriptor.verify = function verify(message) { + Http.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.pattern != null && message.hasOwnProperty("pattern")) { - if (!Array.isArray(message.pattern)) - return "pattern: array expected"; - for (var i = 0; i < message.pattern.length; ++i) - if (!$util.isString(message.pattern[i])) - return "pattern: string[] expected"; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - if (!$util.isString(message.nameField)) - return "nameField: string expected"; - if (message.history != null && message.hasOwnProperty("history")) - switch (message.history) { - default: - return "history: enum value expected"; - case 0: - case 1: - case 2: - break; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; } - if (message.plural != null && message.hasOwnProperty("plural")) - if (!$util.isString(message.plural)) - return "plural: string expected"; - if (message.singular != null && message.hasOwnProperty("singular")) - if (!$util.isString(message.singular)) - return "singular: string expected"; + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; return null; }; /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a Http message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.api.Http} Http */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) return object; - var message = new $root.google.api.ResourceDescriptor(); - if (object.type != null) - message.type = String(object.type); - if (object.pattern) { - if (!Array.isArray(object.pattern)) - throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); - message.pattern = []; - for (var i = 0; i < object.pattern.length; ++i) - message.pattern[i] = String(object.pattern[i]); - } - if (object.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - case "HISTORY_UNSPECIFIED": - case 0: - message.history = 0; - break; - case "ORIGINALLY_SINGLE_PATTERN": - case 1: - message.history = 1; - break; - case "FUTURE_MULTI_PATTERN": - case 2: - message.history = 2; - break; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); return message; }; /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * Creates a plain object from a Http message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {google.api.Http} message Http * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceDescriptor.toObject = function toObject(message, options) { + Http.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.pattern = []; - if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.pattern && message.pattern.length) { - object.pattern = []; - for (var j = 0; j < message.pattern.length; ++j) - object.pattern[j] = message.pattern[j]; + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); } - if (message.nameField != null && message.hasOwnProperty("nameField")) - object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; return object; }; /** - * Converts this ResourceDescriptor to JSON. + * Converts this Http to JSON. * @function toJSON - * @memberof google.api.ResourceDescriptor + * @memberof google.api.Http * @instance * @returns {Object.} JSON object */ - ResourceDescriptor.prototype.toJSON = function toJSON() { + Http.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + return Http; + })(); + + api.HttpRule = (function() { + /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {string} - * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value - * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value - * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings */ - ResourceDescriptor.History = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; - values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; - return values; - })(); - return ResourceDescriptor; - })(); + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = ""; + + /** + * HttpRule put. + * @member {string} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = ""; + + /** + * HttpRule post. + * @member {string} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = ""; + + /** + * HttpRule delete. + * @member {string} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = ""; + + /** + * HttpRule patch. + * @member {string} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = ""; - api.ResourceReference = (function() { + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance */ + HttpRule.prototype.body = ""; /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference - * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance */ - function ResourceReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + HttpRule.prototype.responseBody = ""; /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule * @instance */ - ResourceReference.prototype.type = ""; + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule * @instance */ - ResourceReference.prototype.childType = ""; + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new ResourceReference instance using the specified properties. + * Creates a new HttpRule instance using the specified properties. * @function create - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); + HttpRule.create = function create(properties) { + return new HttpRule(properties); }; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encode - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encode = function encode(message, writer) { + HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && message.hasOwnProperty("childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + if (message.selector != null && message.hasOwnProperty("selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && message.hasOwnProperty("get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && message.hasOwnProperty("put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && message.hasOwnProperty("post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && message.hasOwnProperty("delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && message.hasOwnProperty("patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && message.hasOwnProperty("body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && message.hasOwnProperty("custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); return writer; }; /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * Decodes a HttpRule message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.api.HttpRule} HttpRule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceReference.decode = function decode(reader, length) { + HttpRule.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type = reader.string(); + message.selector = reader.string(); break; case 2: - message.childType = reader.string(); + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message["delete"] = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.responseBody = reader.string(); + break; + case 11: + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -5764,118 +5776,240 @@ }; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes a HttpRule message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.api.HttpRule} HttpRule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { + HttpRule.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceReference message. + * Verifies a HttpRule message. * @function verify - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ResourceReference.verify = function verify(message) { + HttpRule.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) - if (!$util.isString(message.childType)) - return "childType: string expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } return null; }; /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.api.HttpRule} HttpRule */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) return object; - var message = new $root.google.api.ResourceReference(); - if (object.type != null) - message.type = String(object.type); - if (object.childType != null) - message.childType = String(object.childType); + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } return message; }; /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @static - * @param {google.api.ResourceReference} message ResourceReference + * @param {google.api.HttpRule} message HttpRule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceReference.toObject = function toObject(message, options) { + HttpRule.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; if (options.defaults) { - object.type = ""; - object.childType = ""; + object.selector = ""; + object.body = ""; + object.responseBody = ""; } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; return object; }; /** - * Converts this ResourceReference to JSON. + * Converts this HttpRule to JSON. * @function toJSON - * @memberof google.api.ResourceReference + * @memberof google.api.HttpRule * @instance * @returns {Object.} JSON object */ - ResourceReference.prototype.toJSON = function toJSON() { + HttpRule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ResourceReference; + return HttpRule; })(); - api.Http = (function() { + api.CustomHttpPattern = (function() { /** - * Properties of a Http. + * Properties of a CustomHttpPattern. * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path */ /** - * Constructs a new Http. + * Constructs a new CustomHttpPattern. * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern * @constructor - * @param {google.api.IHttp=} [properties] Properties to set + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set */ - function Http(properties) { - this.rules = []; + function CustomHttpPattern(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5883,91 +6017,88 @@ } /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern * @instance */ - Http.prototype.rules = $util.emptyArray; + CustomHttpPattern.prototype.kind = ""; /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern * @instance */ - Http.prototype.fullyDecodeReservedExpansion = false; + CustomHttpPattern.prototype.path = ""; /** - * Creates a new Http instance using the specified properties. + * Creates a new CustomHttpPattern instance using the specified properties. * @function create - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance */ - Http.create = function create(properties) { - return new Http(properties); + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); }; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encode - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encode = function encode(message, writer) { + CustomHttpPattern.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + if (message.kind != null && message.hasOwnProperty("kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && message.hasOwnProperty("path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); return writer; }; /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encodeDelimited = function encodeDelimited(message, writer) { + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Http message from the specified reader or buffer. + * Decodes a CustomHttpPattern message from the specified reader or buffer. * @function decode - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http + * @returns {google.api.CustomHttpPattern} CustomHttpPattern * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Http.decode = function decode(reader, length) { + CustomHttpPattern.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + message.kind = reader.string(); break; case 2: - message.fullyDecodeReservedExpansion = reader.bool(); + message.path = reader.string(); break; default: reader.skipType(tag & 7); @@ -5978,143 +6109,144 @@ }; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http + * @returns {google.api.CustomHttpPattern} CustomHttpPattern * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Http.decodeDelimited = function decodeDelimited(reader) { + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Http message. + * Verifies a CustomHttpPattern message. * @function verify - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Http.verify = function verify(message) { + CustomHttpPattern.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; return null; }; /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static * @param {Object.} object Plain object - * @returns {google.api.Http} Http + * @returns {google.api.CustomHttpPattern} CustomHttpPattern */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); return message; }; /** - * Creates a plain object from a Http message. Also converts values to other types if specified. + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.Http} message Http + * @param {google.api.CustomHttpPattern} message CustomHttpPattern * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Http.toObject = function toObject(message, options) { + CustomHttpPattern.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + if (options.defaults) { + object.kind = ""; + object.path = ""; } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; return object; }; /** - * Converts this Http to JSON. + * Converts this CustomHttpPattern to JSON. * @function toJSON - * @memberof google.api.Http + * @memberof google.api.CustomHttpPattern * @instance * @returns {Object.} JSON object */ - Http.prototype.toJSON = function toJSON() { + CustomHttpPattern.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Http; + return CustomHttpPattern; })(); - api.HttpRule = (function() { + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {string} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + return values; + })(); + + api.ResourceDescriptor = (function() { /** - * Properties of a HttpRule. + * Properties of a ResourceDescriptor. * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular */ /** - * Constructs a new HttpRule. + * Constructs a new ResourceDescriptor. * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set + * @param {google.api.IResourceDescriptor=} [properties] Properties to set */ - function HttpRule(properties) { - this.additionalBindings = []; + function ResourceDescriptor(properties) { + this.pattern = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6122,209 +6254,143 @@ } /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = ""; - - /** - * HttpRule put. - * @member {string} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = ""; - - /** - * HttpRule post. - * @member {string} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = ""; - - /** - * HttpRule delete. - * @member {string} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = ""; - - /** - * HttpRule patch. - * @member {string} patch - * @memberof google.api.HttpRule + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.patch = ""; + ResourceDescriptor.prototype.type = ""; /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.custom = null; + ResourceDescriptor.prototype.pattern = $util.emptyArray; /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.body = ""; + ResourceDescriptor.prototype.nameField = ""; /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.responseBody = ""; + ResourceDescriptor.prototype.history = 0; /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor * @instance */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ResourceDescriptor.prototype.plural = ""; /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor * @instance */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); + ResourceDescriptor.prototype.singular = ""; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new ResourceDescriptor instance using the specified properties. * @function create - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); }; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encode - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encode = function encode(message, writer) { + ResourceDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selector != null && message.hasOwnProperty("selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && message.hasOwnProperty("get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && message.hasOwnProperty("put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && message.hasOwnProperty("post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && message.hasOwnProperty("delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && message.hasOwnProperty("patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && message.hasOwnProperty("body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && message.hasOwnProperty("custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && message.hasOwnProperty("nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && message.hasOwnProperty("history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && message.hasOwnProperty("plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && message.hasOwnProperty("singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); return writer; }; /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes a ResourceDescriptor message from the specified reader or buffer. * @function decode - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule + * @returns {google.api.ResourceDescriptor} ResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HttpRule.decode = function decode(reader, length) { + ResourceDescriptor.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.selector = reader.string(); + message.type = reader.string(); break; case 2: - message.get = reader.string(); + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); break; case 3: - message.put = reader.string(); + message.nameField = reader.string(); break; case 4: - message.post = reader.string(); + message.history = reader.int32(); break; case 5: - message["delete"] = reader.string(); + message.plural = reader.string(); break; case 6: - message.patch = reader.string(); - break; - case 8: - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - case 7: - message.body = reader.string(); - break; - case 12: - message.responseBody = reader.string(); - break; - case 11: - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + message.singular = reader.string(); break; default: reader.skipType(tag & 7); @@ -6335,240 +6401,196 @@ }; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule + * @returns {google.api.ResourceDescriptor} ResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HttpRule message. + * Verifies a ResourceDescriptor message. * @function verify - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HttpRule.verify = function verify(message) { + ResourceDescriptor.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; } - } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; return null; }; /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule + * @returns {google.api.ResourceDescriptor} ResourceDescriptor */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); return message; }; /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.HttpRule} message HttpRule + * @param {google.api.ResourceDescriptor} message ResourceDescriptor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HttpRule.toObject = function toObject(message, options) { + ResourceDescriptor.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.additionalBindings = []; + object.pattern = []; if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; return object; }; /** - * Converts this HttpRule to JSON. + * Converts this ResourceDescriptor to JSON. * @function toJSON - * @memberof google.api.HttpRule + * @memberof google.api.ResourceDescriptor * @instance * @returns {Object.} JSON object */ - HttpRule.prototype.toJSON = function toJSON() { + ResourceDescriptor.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HttpRule; + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {string} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + return ResourceDescriptor; })(); - api.CustomHttpPattern = (function() { + api.ResourceReference = (function() { /** - * Properties of a CustomHttpPattern. + * Properties of a ResourceReference. * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType */ /** - * Constructs a new CustomHttpPattern. + * Constructs a new ResourceReference. * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern + * @classdesc Represents a ResourceReference. + * @implements IResourceReference * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @param {google.api.IResourceReference=} [properties] Properties to set */ - function CustomHttpPattern(properties) { + function ResourceReference(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6576,88 +6598,88 @@ } /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference * @instance */ - CustomHttpPattern.prototype.kind = ""; + ResourceReference.prototype.type = ""; /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference * @instance */ - CustomHttpPattern.prototype.path = ""; + ResourceReference.prototype.childType = ""; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new ResourceReference instance using the specified properties. * @function create - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); }; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encode - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encode = function encode(message, writer) { + ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && message.hasOwnProperty("kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && message.hasOwnProperty("path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && message.hasOwnProperty("childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); return writer; }; /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * Decodes a ResourceReference message from the specified reader or buffer. * @function decode - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.ResourceReference} ResourceReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CustomHttpPattern.decode = function decode(reader, length) { + ResourceReference.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.kind = reader.string(); + message.type = reader.string(); break; case 2: - message.path = reader.string(); + message.childType = reader.string(); break; default: reader.skipType(tag & 7); @@ -6668,118 +6690,96 @@ }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.ResourceReference} ResourceReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + ResourceReference.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CustomHttpPattern message. + * Verifies a ResourceReference message. * @function verify - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CustomHttpPattern.verify = function verify(message) { + ResourceReference.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; return null; }; /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.ResourceReference} ResourceReference */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); return message; }; /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {google.api.ResourceReference} message ResourceReference * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomHttpPattern.toObject = function toObject(message, options) { + ResourceReference.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.kind = ""; - object.path = ""; + object.type = ""; + object.childType = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; return object; }; /** - * Converts this CustomHttpPattern to JSON. + * Converts this ResourceReference to JSON. * @function toJSON - * @memberof google.api.CustomHttpPattern + * @memberof google.api.ResourceReference * @instance * @returns {Object.} JSON object */ - CustomHttpPattern.prototype.toJSON = function toJSON() { + ResourceReference.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CustomHttpPattern; - })(); - - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {string} - * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value - * @property {number} OPTIONAL=1 OPTIONAL value - * @property {number} REQUIRED=2 REQUIRED value - * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value - * @property {number} INPUT_ONLY=4 INPUT_ONLY value - * @property {number} IMMUTABLE=5 IMMUTABLE value - */ - api.FieldBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPTIONAL"] = 1; - values[valuesById[2] = "REQUIRED"] = 2; - values[valuesById[3] = "OUTPUT_ONLY"] = 3; - values[valuesById[4] = "INPUT_ONLY"] = 4; - values[valuesById[5] = "IMMUTABLE"] = 5; - return values; + return ResourceReference; })(); return api; @@ -11992,8 +11992,8 @@ * @property {boolean|null} [deprecated] FieldOptions deprecated * @property {boolean|null} [weak] FieldOptions weak * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference */ /** @@ -12070,20 +12070,20 @@ FieldOptions.prototype.uninterpretedOption = $util.emptyArray; /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior * @memberof google.protobuf.FieldOptions * @instance */ - FieldOptions.prototype[".google.api.resourceReference"] = null; + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference * @memberof google.protobuf.FieldOptions * @instance */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + FieldOptions.prototype[".google.api.resourceReference"] = null; /** * Creates a new FieldOptions instance using the specified properties. @@ -12189,9 +12189,6 @@ message.uninterpretedOption = []; message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; - case 1055: - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; case 1052: if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) message[".google.api.fieldBehavior"] = []; @@ -12202,6 +12199,9 @@ } else message[".google.api.fieldBehavior"].push(reader.int32()); break; + case 1055: + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -12276,11 +12276,6 @@ return "uninterpretedOption." + error; } } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { if (!Array.isArray(message[".google.api.fieldBehavior"])) return ".google.api.fieldBehavior: array expected"; @@ -12297,6 +12292,11 @@ break; } } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } return null; }; @@ -12358,11 +12358,6 @@ message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } if (object[".google.api.fieldBehavior"]) { if (!Array.isArray(object[".google.api.fieldBehavior"])) throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); @@ -12396,6 +12391,11 @@ break; } } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } return message; }; diff --git a/protos/protos.json b/protos/protos.json index 3c1f08aa..6f3c1689 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -11,7 +11,7 @@ "v1beta1": { "options": { "go_package": "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1beta1;storage", - "java_outer_classname": "AvroProto", + "java_outer_classname": "TableReferenceProto", "java_package": "com.google.cloud.bigquery.storage.v1beta1" }, "nested": { @@ -35,30 +35,6 @@ } } }, - "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 - } - } - }, "AvroSchema": { "fields": { "schema": { @@ -412,6 +388,30 @@ "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 + } + } } } } @@ -423,80 +423,14 @@ }, "api": { "options": { - "cc_enable_arenas": true, "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, - "java_outer_classname": "FieldBehaviorProto", + "java_outer_classname": "ResourceProto", "java_package": "com.google.api", - "objc_class_prefix": "GAPI" + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true }, "nested": { - "resourceReference": { - "type": "google.api.ResourceReference", - "id": 1055, - "extend": "google.protobuf.FieldOptions" - }, - "resourceDefinition": { - "rule": "repeated", - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.FileOptions" - }, - "resource": { - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.MessageOptions" - }, - "ResourceDescriptor": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "pattern": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "nameField": { - "type": "string", - "id": 3 - }, - "history": { - "type": "History", - "id": 4 - }, - "plural": { - "type": "string", - "id": 5 - }, - "singular": { - "type": "string", - "id": 6 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } - }, "http": { "type": "HttpRule", "id": 72295728, @@ -615,6 +549,72 @@ "INPUT_ONLY": 4, "IMMUTABLE": 5 } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } } } }, diff --git a/samples/quickstart.js b/samples/quickstart.js index 31af210a..b5352e89 100644 --- a/samples/quickstart.js +++ b/samples/quickstart.js @@ -21,32 +21,62 @@ */ async function main() { // [START bigquery_storage_quickstart] - const bqStorage = require('@google-cloud/bigquery-storage').v1beta1.BigQueryStorageClient; + const bqStorage = require('@google-cloud/bigquery-storage').v1beta1 + .BigQueryStorageClient; const client = new bqStorage(); - const myProjectId = 'my-project-id' - + const myProjectId = 'mastodon-dataset'; // 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 projectId = 'bigquery-public-data'; + const datasetId = 'usa_names'; + const tableId = 'usa_1910_current'; const tableReference = { projectId, datasetId, - tableId + tableId, + }; + + const parent = `projects/${myProjectId}`; + + const readOptions = { + selectedFields: ['name', 'number', 'state'], + rowRestriction: 'state = "WA"' } - - const parent = `projects/${myProjectId}` + let tableModifiers = null + + let snapshotSeconds = Math.floor(Date.now()/1000) + + if (snapshotSeconds > 0) { + tableModifiers = { snapshotTime: { seconds: snapshotSeconds} } + } + + console.log(tableModifiers) const request = { tableReference, parent, + readOptions, + tableModifiers, + /* Format enum values: + * DATA_FORMAT_UNSPECIFIED = 0, + * AVRO = 1, + * ARROW = 3 + */ + // format: 3, + // shardingStrategy: 1 + }; + + const [session] = await client.createReadSession(request); + console.log(session) + + const readRowsRequest = { + readPosition: {stream: session.streams[0]} } - await client.createReadSession(request) + // const reader = client.readRows(readRowsRequest) // [END bigquery_storage_quickstart] } diff --git a/samples/test/quickstart.js b/samples/test/quickstart.js index bae5de4c..87e20eab 100644 --- a/samples/test/quickstart.js +++ b/samples/test/quickstart.js @@ -30,4 +30,4 @@ describe('Quickstart', () => { it('should run quickstart', async () => { const stdout = execSync(`node ../samples/quickstart.js`, {cwd}); }); -}); \ No newline at end of file +}); diff --git a/src/v1beta1/big_query_storage_client.ts b/src/v1beta1/big_query_storage_client.ts index 1088b7e9..251628ba 100644 --- a/src/v1beta1/big_query_storage_client.ts +++ b/src/v1beta1/big_query_storage_client.ts @@ -41,6 +41,7 @@ const version = require('../../../package.json').version; 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}>; @@ -136,6 +137,18 @@ export class BigQueryStorageClient { 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 = { + streamPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/streams/{stream}' + ), + readSessionPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sessions/{session}' + ), + }; + // Some of the methods on this service provide streaming responses. // Provide descriptors for these. this._descriptors.stream = { @@ -371,6 +384,7 @@ export class BigQueryStorageClient { '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); } @@ -690,6 +704,111 @@ export class BigQueryStorageClient { return this._innerApiCalls.readRows(request, options); } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * 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; + } + + /** + * 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; + } + /** * Terminate the GRPC channel and close the client. * diff --git a/src/v1beta1/big_query_storage_proto_list.json b/src/v1beta1/big_query_storage_proto_list.json index d8525444..0b801075 100644 --- a/src/v1beta1/big_query_storage_proto_list.json +++ b/src/v1beta1/big_query_storage_proto_list.json @@ -1,7 +1,7 @@ [ "../../protos/google/cloud/bigquery/storage/v1beta1/arrow.proto", - "../../protos/google/cloud/bigquery/storage/v1beta1/table_reference.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/storage.proto", + "../../protos/google/cloud/bigquery/storage/v1beta1/table_reference.proto" ] diff --git a/synth.metadata b/synth.metadata index 53e8122a..72b8c708 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,12 +1,12 @@ { - "updateTime": "2020-01-14T20:03:58.287210Z", + "updateTime": "2020-02-04T00:23:51.191035Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "2fa8d48165cc48e35b0c62e6f7bdade12229326c", - "internalRef": "289619243" + "sha": "29d40b78e3dc1579b0b209463fbcb76e5767f72a", + "internalRef": "292979741" } }, { diff --git a/test/gapic-big_query_storage-v1beta1.ts b/test/gapic-big_query_storage-v1beta1.ts index a5dbad98..d71eafab 100644 --- a/test/gapic-big_query_storage-v1beta1.ts +++ b/test/gapic-big_query_storage-v1beta1.ts @@ -115,6 +115,8 @@ describe('v1beta1.BigQueryStorageClient', () => { 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 @@ -139,6 +141,8 @@ describe('v1beta1.BigQueryStorageClient', () => { 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 From 620d76bc9fc115d9448632bc3e802d7c070e8054 Mon Sep 17 00:00:00 2001 From: steffnay Date: Mon, 10 Feb 2020 23:47:07 -0800 Subject: [PATCH 05/12] regenerates library and adds quickstart --- linkinator.config.json | 3 +- samples/package.json | 4 +- samples/quickstart.js | 183 ++++++++++++++++-------- samples/test/quickstart.js | 10 +- src/v1beta1/big_query_storage_client.ts | 103 ++++++------- synth.metadata | 6 +- 6 files changed, 188 insertions(+), 121 deletions(-) diff --git a/linkinator.config.json b/linkinator.config.json index d780d6bf..b555215c 100644 --- a/linkinator.config.json +++ b/linkinator.config.json @@ -2,6 +2,7 @@ "recurse": true, "skip": [ "https://codecov.io/gh/googleapis/", - "www.googleapis.com" + "www.googleapis.com", + "img.shields.io" ] } diff --git a/samples/package.json b/samples/package.json index 706848af..4e86f2ed 100644 --- a/samples/package.json +++ b/samples/package.json @@ -13,7 +13,9 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^1.0.1" + "@google-cloud/bigquery-storage": "^1.0.1", + "avsc": "^5.4.18", + "snappy": "^6.2.3" }, "devDependencies": { "c8": "^5.0.1", diff --git a/samples/quickstart.js b/samples/quickstart.js index b5352e89..4ab71e44 100644 --- a/samples/quickstart.js +++ b/samples/quickstart.js @@ -1,5 +1,5 @@ /** - * 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. * You may obtain a copy of the License at @@ -15,72 +15,129 @@ 'use strict'; -/** - * DESCRIBE WHAT THIS SAMPLE DOES. - * @param {string} LIST EXPECTED ARGUMENTS. - */ async function main() { // [START bigquery_storage_quickstart] - const bqStorage = require('@google-cloud/bigquery-storage').v1beta1 - .BigQueryStorageClient; - const client = new bqStorage(); - - const myProjectId = 'mastodon-dataset'; - - // 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}`; - - const readOptions = { - selectedFields: ['name', 'number', 'state'], - rowRestriction: 'state = "WA"' - } - - let tableModifiers = null - - let snapshotSeconds = Math.floor(Date.now()/1000) - - if (snapshotSeconds > 0) { - tableModifiers = { snapshotTime: { seconds: snapshotSeconds} } - } - - console.log(tableModifiers) - - const request = { - tableReference, - parent, - readOptions, - tableModifiers, - /* Format enum values: - * DATA_FORMAT_UNSPECIFIED = 0, - * AVRO = 1, - * ARROW = 3 + async function bigqueryStorageQuickstart() { + // 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(); + + // 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). */ - // format: 3, - // shardingStrategy: 1 - }; - - const [session] = await client.createReadSession(request); - console.log(session) - - const readRowsRequest = { - readPosition: {stream: session.streams[0]} + 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}`); + }); } - - // const reader = client.readRows(readRowsRequest) // [END bigquery_storage_quickstart] + bigqueryStorageQuickstart(); } -main(...process.argv.slice(2)).catch(err => { - console.error(err); - process.exitCode = 1; -}); +main(...process.argv.slice(2)); diff --git a/samples/test/quickstart.js b/samples/test/quickstart.js index 87e20eab..44c15b1b 100644 --- a/samples/test/quickstart.js +++ b/samples/test/quickstart.js @@ -18,16 +18,16 @@ 'use strict'; -const path = require('path'); const {assert} = require('chai'); +const {describe, it} = require('mocha'); const cp = require('child_process'); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); -const cwd = path.join(__dirname, '..'); - describe('Quickstart', () => { - it('should run quickstart', async () => { - const stdout = execSync(`node ../samples/quickstart.js`, {cwd}); + 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/src/v1beta1/big_query_storage_client.ts b/src/v1beta1/big_query_storage_client.ts index 251628ba..5f41cbd9 100644 --- a/src/v1beta1/big_query_storage_client.ts +++ b/src/v1beta1/big_query_storage_client.ts @@ -141,12 +141,12 @@ export class BigQueryStorageClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - streamPathTemplate: new gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/streams/{stream}' - ), 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. @@ -701,6 +701,13 @@ export class BigQueryStorageClient { ): 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); } @@ -709,104 +716,104 @@ export class BigQueryStorageClient { // -------------------- /** - * Return a fully-qualified stream resource name string. + * Return a fully-qualified readSession resource name string. * * @param {string} project * @param {string} location - * @param {string} stream + * @param {string} session * @returns {string} Resource name string. */ - streamPath(project: string, location: string, stream: string) { - return this._pathTemplates.streamPathTemplate.render({ + readSessionPath(project: string, location: string, session: string) { + return this._pathTemplates.readSessionPathTemplate.render({ project, location, - stream, + session, }); } /** - * Parse the project from Stream resource. + * Parse the project from ReadSession resource. * - * @param {string} streamName - * A fully-qualified path representing Stream resource. + * @param {string} readSessionName + * A fully-qualified path representing ReadSession resource. * @returns {string} A string representing the project. */ - matchProjectFromStreamName(streamName: string) { - return this._pathTemplates.streamPathTemplate.match(streamName).project; + matchProjectFromReadSessionName(readSessionName: string) { + return this._pathTemplates.readSessionPathTemplate.match(readSessionName) + .project; } /** - * Parse the location from Stream resource. + * Parse the location from ReadSession resource. * - * @param {string} streamName - * A fully-qualified path representing Stream resource. + * @param {string} readSessionName + * A fully-qualified path representing ReadSession resource. * @returns {string} A string representing the location. */ - matchLocationFromStreamName(streamName: string) { - return this._pathTemplates.streamPathTemplate.match(streamName).location; + matchLocationFromReadSessionName(readSessionName: string) { + return this._pathTemplates.readSessionPathTemplate.match(readSessionName) + .location; } /** - * Parse the stream from Stream resource. + * Parse the session from ReadSession resource. * - * @param {string} streamName - * A fully-qualified path representing Stream resource. - * @returns {string} A string representing the stream. + * @param {string} readSessionName + * A fully-qualified path representing ReadSession resource. + * @returns {string} A string representing the session. */ - matchStreamFromStreamName(streamName: string) { - return this._pathTemplates.streamPathTemplate.match(streamName).stream; + matchSessionFromReadSessionName(readSessionName: string) { + return this._pathTemplates.readSessionPathTemplate.match(readSessionName) + .session; } /** - * Return a fully-qualified readSession resource name string. + * Return a fully-qualified stream resource name string. * * @param {string} project * @param {string} location - * @param {string} session + * @param {string} stream * @returns {string} Resource name string. */ - readSessionPath(project: string, location: string, session: string) { - return this._pathTemplates.readSessionPathTemplate.render({ + streamPath(project: string, location: string, stream: string) { + return this._pathTemplates.streamPathTemplate.render({ project, location, - session, + stream, }); } /** - * Parse the project from ReadSession resource. + * Parse the project from Stream resource. * - * @param {string} readSessionName - * A fully-qualified path representing ReadSession resource. + * @param {string} streamName + * A fully-qualified path representing Stream resource. * @returns {string} A string representing the project. */ - matchProjectFromReadSessionName(readSessionName: string) { - return this._pathTemplates.readSessionPathTemplate.match(readSessionName) - .project; + matchProjectFromStreamName(streamName: string) { + return this._pathTemplates.streamPathTemplate.match(streamName).project; } /** - * Parse the location from ReadSession resource. + * Parse the location from Stream resource. * - * @param {string} readSessionName - * A fully-qualified path representing ReadSession resource. + * @param {string} streamName + * A fully-qualified path representing Stream resource. * @returns {string} A string representing the location. */ - matchLocationFromReadSessionName(readSessionName: string) { - return this._pathTemplates.readSessionPathTemplate.match(readSessionName) - .location; + matchLocationFromStreamName(streamName: string) { + return this._pathTemplates.streamPathTemplate.match(streamName).location; } /** - * Parse the session from ReadSession resource. + * Parse the stream from Stream resource. * - * @param {string} readSessionName - * A fully-qualified path representing ReadSession resource. - * @returns {string} A string representing the session. + * @param {string} streamName + * A fully-qualified path representing Stream resource. + * @returns {string} A string representing the stream. */ - matchSessionFromReadSessionName(readSessionName: string) { - return this._pathTemplates.readSessionPathTemplate.match(readSessionName) - .session; + matchStreamFromStreamName(streamName: string) { + return this._pathTemplates.streamPathTemplate.match(streamName).stream; } /** diff --git a/synth.metadata b/synth.metadata index 72b8c708..82a46287 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,12 +1,12 @@ { - "updateTime": "2020-02-04T00:23:51.191035Z", + "updateTime": "2020-02-07T02:35:41.369440Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "29d40b78e3dc1579b0b209463fbcb76e5767f72a", - "internalRef": "292979741" + "sha": "e46f761cd6ec15a9e3d5ed4ff321a4bcba8e8585", + "internalRef": "293710856" } }, { From 12f9b5bdd27f723b449698c2a91afa2bf81100a4 Mon Sep 17 00:00:00 2001 From: steffnay Date: Tue, 11 Feb 2020 11:52:52 -0800 Subject: [PATCH 06/12] docs: updates README and samples/README --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .gitignore | 2 +- .mocharc.json | 5 + .repo-metadata.json | 12 ++ README.md | 229 ++++++++++++++++++++++++++++++- linkinator.config.json | 5 +- samples/README.md | 50 +++++++ synth.metadata | 6 +- 8 files changed, 303 insertions(+), 8 deletions(-) create mode 100644 .mocharc.json create mode 100644 .repo-metadata.json create mode 100644 samples/README.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index ff0961bf..19153139 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,5 @@ Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: -- [ ] Make sure to open an issue as a [bug/issue](https://github.com//issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea +- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/nodejs-bigquery-storage/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) diff --git a/.gitignore b/.gitignore index baab5550..5d32b237 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,4 @@ system-test/*key.json *.lock .DS_Store package-lock.json -__pycache__ \ No newline at end of file +__pycache__ diff --git a/.mocharc.json b/.mocharc.json new file mode 100644 index 00000000..670c5e2c --- /dev/null +++ b/.mocharc.json @@ -0,0 +1,5 @@ +{ + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} diff --git a/.repo-metadata.json b/.repo-metadata.json new file mode 100644 index 00000000..a605d718 --- /dev/null +++ b/.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 + } \ No newline at end of file diff --git a/README.md b/README.md index a966ebe8..e000349e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,227 @@ -# 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) + + + + +Storage client for Node.js + + + +* [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 + async function bigqueryStorageQuickstart() { + // 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(); + + // 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 | +| --------------------------- | --------------------------------- | ------ | +| 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/linkinator.config.json b/linkinator.config.json index b555215c..a4a25c7b 100644 --- a/linkinator.config.json +++ b/linkinator.config.json @@ -3,6 +3,9 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", - "img.shields.io" + "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/samples/README.md b/samples/README.md new file mode 100644 index 00000000..28d300dd --- /dev/null +++ b/samples/README.md @@ -0,0 +1,50 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google BigQuery 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) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/nodejs-bigquery-storage#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Quickstart + +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 samples/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigquery-storage&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/bigquery/docs/reference/storage diff --git a/synth.metadata b/synth.metadata index 82a46287..a3bac7c2 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,12 +1,12 @@ { - "updateTime": "2020-02-07T02:35:41.369440Z", + "updateTime": "2020-02-11T19:47:11.184130Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e46f761cd6ec15a9e3d5ed4ff321a4bcba8e8585", - "internalRef": "293710856" + "sha": "8a36b928873ff9c05b43859b9d4ea14cd205df57", + "internalRef": "294459768" } }, { From 3ad879a8e58b8ef6d42f8cfd98b9745a3c7b5f26 Mon Sep 17 00:00:00 2001 From: steffnay Date: Wed, 12 Feb 2020 07:48:16 -0800 Subject: [PATCH 07/12] docs: update metadata, dependencies, & quickstart --- .repo-metadata.json | 2 +- package.json | 40 ++++++++++---------- protos/protos.d.ts | 88 +++++++++++++++++++++---------------------- samples/quickstart.js | 52 +++++++++++++------------ 4 files changed, 93 insertions(+), 89 deletions(-) diff --git a/.repo-metadata.json b/.repo-metadata.json index a605d718..e417e6a9 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -9,4 +9,4 @@ "distribution_name": "@google-cloud/bigquery-storage", "api_id": "bigquerystorage.googleapis.com", "requires_billing": true - } \ No newline at end of file + } diff --git a/package.json b/package.json index ee7ae45f..758a674a 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "@google-cloud/bigquery-storage", "version": "0.1.0", - "description": "Storage client for Node.js", - "repository": "googleapis/nodejs-storage", + "description": "Client for the BigQuery Storage API", + "repository": "googleapis/nodejs-bigquery-storage", "license": "Apache-2.0", "author": "Google LLC", "files": [ @@ -25,29 +25,29 @@ "samples-test": "cd samples/ && npm link ../ && npm test && cd ../" }, "dependencies": { - "google-gax": "^1.12.0" + "google-gax": "^1.14.1" }, "devDependencies": { - "@types/mocha": "^5.2.5", - "@types/node": "^12.0.0", - "c8": "^6.0.0", - "gts": "^1.0.0", - "jsdoc": "^3.5.5", - "jsdoc-fresh": "^1.0.1", - "jsdoc-region-tag": "^1.0.2", - "linkinator": "^1.5.0", - "mocha": "^6.0.0", + "@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.6.4", - "webpack": "^4.41.2", - "webpack-cli": "^3.3.10", - "eslint": "^6.0.0", - "eslint-config-prettier": "^6.0.0", - "eslint-plugin-node": "^10.0.0", - "eslint-plugin-prettier": "^3.0.1", - "prettier": "^1.17.0" + "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/protos/protos.d.ts b/protos/protos.d.ts index de6c3d8e..a0b708af 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -33,7 +33,7 @@ export namespace google { interface IArrowSchema { /** ArrowSchema serializedSchema */ - serializedSchema?: (Uint8Array|null); + serializedSchema?: (Uint8Array|string|null); } /** Represents an ArrowSchema. */ @@ -46,7 +46,7 @@ export namespace google { constructor(properties?: google.cloud.bigquery.storage.v1beta1.IArrowSchema); /** ArrowSchema serializedSchema. */ - public serializedSchema: Uint8Array; + public serializedSchema: (Uint8Array|string); /** * Creates a new ArrowSchema instance using the specified properties. @@ -123,10 +123,10 @@ export namespace google { interface IArrowRecordBatch { /** ArrowRecordBatch serializedRecordBatch */ - serializedRecordBatch?: (Uint8Array|null); + serializedRecordBatch?: (Uint8Array|string|null); /** ArrowRecordBatch rowCount */ - rowCount?: (number|Long|null); + rowCount?: (number|Long|string|null); } /** Represents an ArrowRecordBatch. */ @@ -139,10 +139,10 @@ export namespace google { constructor(properties?: google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch); /** ArrowRecordBatch serializedRecordBatch. */ - public serializedRecordBatch: Uint8Array; + public serializedRecordBatch: (Uint8Array|string); /** ArrowRecordBatch rowCount. */ - public rowCount: (number|Long); + public rowCount: (number|Long|string); /** * Creates a new ArrowRecordBatch instance using the specified properties. @@ -309,10 +309,10 @@ export namespace google { interface IAvroRows { /** AvroRows serializedBinaryRows */ - serializedBinaryRows?: (Uint8Array|null); + serializedBinaryRows?: (Uint8Array|string|null); /** AvroRows rowCount */ - rowCount?: (number|Long|null); + rowCount?: (number|Long|string|null); } /** Represents an AvroRows. */ @@ -325,10 +325,10 @@ export namespace google { constructor(properties?: google.cloud.bigquery.storage.v1beta1.IAvroRows); /** AvroRows serializedBinaryRows. */ - public serializedBinaryRows: Uint8Array; + public serializedBinaryRows: (Uint8Array|string); /** AvroRows rowCount. */ - public rowCount: (number|Long); + public rowCount: (number|Long|string); /** * Creates a new AvroRows instance using the specified properties. @@ -723,7 +723,7 @@ export namespace google { stream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); /** StreamPosition offset */ - offset?: (number|Long|null); + offset?: (number|Long|string|null); } /** Represents a StreamPosition. */ @@ -739,7 +739,7 @@ export namespace google { public stream?: (google.cloud.bigquery.storage.v1beta1.IStream|null); /** StreamPosition offset. */ - public offset: (number|Long); + public offset: (number|Long|string); /** * Creates a new StreamPosition instance using the specified properties. @@ -837,7 +837,7 @@ export namespace google { tableModifiers?: (google.cloud.bigquery.storage.v1beta1.ITableModifiers|null); /** ReadSession shardingStrategy */ - shardingStrategy?: (google.cloud.bigquery.storage.v1beta1.ShardingStrategy|null); + shardingStrategy?: (google.cloud.bigquery.storage.v1beta1.ShardingStrategy|keyof typeof google.cloud.bigquery.storage.v1beta1.ShardingStrategy|null); } /** Represents a ReadSession. */ @@ -871,7 +871,7 @@ export namespace google { public tableModifiers?: (google.cloud.bigquery.storage.v1beta1.ITableModifiers|null); /** ReadSession shardingStrategy. */ - public shardingStrategy: google.cloud.bigquery.storage.v1beta1.ShardingStrategy; + public shardingStrategy: (google.cloud.bigquery.storage.v1beta1.ShardingStrategy|keyof typeof google.cloud.bigquery.storage.v1beta1.ShardingStrategy); /** ReadSession schema. */ public schema?: ("avroSchema"|"arrowSchema"); @@ -966,10 +966,10 @@ export namespace google { readOptions?: (google.cloud.bigquery.storage.v1beta1.ITableReadOptions|null); /** CreateReadSessionRequest format */ - format?: (google.cloud.bigquery.storage.v1beta1.DataFormat|null); + 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|null); + shardingStrategy?: (google.cloud.bigquery.storage.v1beta1.ShardingStrategy|keyof typeof google.cloud.bigquery.storage.v1beta1.ShardingStrategy|null); } /** Represents a CreateReadSessionRequest. */ @@ -997,10 +997,10 @@ export namespace google { public readOptions?: (google.cloud.bigquery.storage.v1beta1.ITableReadOptions|null); /** CreateReadSessionRequest format. */ - public format: google.cloud.bigquery.storage.v1beta1.DataFormat; + 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; + 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. @@ -1181,7 +1181,7 @@ export namespace google { interface IStreamStatus { /** StreamStatus estimatedRowCount */ - estimatedRowCount?: (number|Long|null); + estimatedRowCount?: (number|Long|string|null); /** StreamStatus fractionConsumed */ fractionConsumed?: (number|null); @@ -1203,7 +1203,7 @@ export namespace google { constructor(properties?: google.cloud.bigquery.storage.v1beta1.IStreamStatus); /** StreamStatus estimatedRowCount. */ - public estimatedRowCount: (number|Long); + public estimatedRowCount: (number|Long|string); /** StreamStatus fractionConsumed. */ public fractionConsumed: number; @@ -1481,7 +1481,7 @@ export namespace google { arrowRecordBatch?: (google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch|null); /** ReadRowsResponse rowCount */ - rowCount?: (number|Long|null); + rowCount?: (number|Long|string|null); /** ReadRowsResponse status */ status?: (google.cloud.bigquery.storage.v1beta1.IStreamStatus|null); @@ -1506,7 +1506,7 @@ export namespace google { public arrowRecordBatch?: (google.cloud.bigquery.storage.v1beta1.IArrowRecordBatch|null); /** ReadRowsResponse rowCount. */ - public rowCount: (number|Long); + public rowCount: (number|Long|string); /** ReadRowsResponse status. */ public status?: (google.cloud.bigquery.storage.v1beta1.IStreamStatus|null); @@ -2617,7 +2617,7 @@ export namespace google { nameField?: (string|null); /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|null); + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); /** ResourceDescriptor plural */ plural?: (string|null); @@ -2645,7 +2645,7 @@ export namespace google { public nameField: string; /** ResourceDescriptor history. */ - public history: google.api.ResourceDescriptor.History; + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); /** ResourceDescriptor plural. */ public plural: string; @@ -3525,10 +3525,10 @@ export namespace google { number?: (number|null); /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|null); + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|null); + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); /** FieldDescriptorProto typeName */ typeName?: (string|null); @@ -3565,10 +3565,10 @@ export namespace google { public number: number; /** FieldDescriptorProto label. */ - public label: google.protobuf.FieldDescriptorProto.Label; + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); /** FieldDescriptorProto type. */ - public type: google.protobuf.FieldDescriptorProto.Type; + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); /** FieldDescriptorProto typeName. */ public typeName: string; @@ -4343,7 +4343,7 @@ export namespace google { javaStringCheckUtf8?: (boolean|null); /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|null); + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); /** FileOptions goPackage */ goPackage?: (string|null); @@ -4419,7 +4419,7 @@ export namespace google { public javaStringCheckUtf8: boolean; /** FileOptions optimizeFor. */ - public optimizeFor: google.protobuf.FileOptions.OptimizeMode; + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); /** FileOptions goPackage. */ public goPackage: string; @@ -4668,13 +4668,13 @@ export namespace google { interface IFieldOptions { /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|null); + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); /** FieldOptions packed */ packed?: (boolean|null); /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|null); + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); /** FieldOptions lazy */ lazy?: (boolean|null); @@ -4705,13 +4705,13 @@ export namespace google { constructor(properties?: google.protobuf.IFieldOptions); /** FieldOptions ctype. */ - public ctype: google.protobuf.FieldOptions.CType; + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); /** FieldOptions packed. */ public packed: boolean; /** FieldOptions jstype. */ - public jstype: google.protobuf.FieldOptions.JSType; + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); /** FieldOptions lazy. */ public lazy: boolean; @@ -5210,7 +5210,7 @@ export namespace google { deprecated?: (boolean|null); /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|null); + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); /** MethodOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); @@ -5235,7 +5235,7 @@ export namespace google { public deprecated: boolean; /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: google.protobuf.MethodOptions.IdempotencyLevel; + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); /** MethodOptions uninterpretedOption. */ public uninterpretedOption: google.protobuf.IUninterpretedOption[]; @@ -5331,16 +5331,16 @@ export namespace google { identifierValue?: (string|null); /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|null); + positiveIntValue?: (number|Long|string|null); /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|null); + negativeIntValue?: (number|Long|string|null); /** UninterpretedOption doubleValue */ doubleValue?: (number|null); /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|null); + stringValue?: (Uint8Array|string|null); /** UninterpretedOption aggregateValue */ aggregateValue?: (string|null); @@ -5362,16 +5362,16 @@ export namespace google { public identifierValue: string; /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long); + public positiveIntValue: (number|Long|string); /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long); + public negativeIntValue: (number|Long|string); /** UninterpretedOption doubleValue. */ public doubleValue: number; /** UninterpretedOption stringValue. */ - public stringValue: Uint8Array; + public stringValue: (Uint8Array|string); /** UninterpretedOption aggregateValue. */ public aggregateValue: string; @@ -5958,7 +5958,7 @@ export namespace google { interface ITimestamp { /** Timestamp seconds */ - seconds?: (number|Long|null); + seconds?: (number|Long|string|null); /** Timestamp nanos */ nanos?: (number|null); @@ -5974,7 +5974,7 @@ export namespace google { constructor(properties?: google.protobuf.ITimestamp); /** Timestamp seconds. */ - public seconds: (number|Long); + public seconds: (number|Long|string); /** Timestamp nanos. */ public nanos: number; diff --git a/samples/quickstart.js b/samples/quickstart.js index 4ab71e44..43054d2f 100644 --- a/samples/quickstart.js +++ b/samples/quickstart.js @@ -1,35 +1,39 @@ -/** - * Copyright 2020, Google LLC. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// 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] - async function bigqueryStorageQuickstart() { - // 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; + // 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(); + 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(); From 6152883ee18789d86f9d44ffc8433b55b7889118 Mon Sep 17 00:00:00 2001 From: steffnay Date: Tue, 18 Feb 2020 13:41:29 -0800 Subject: [PATCH 08/12] chore: rerun synthtool --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .kokoro/common.cfg | 4 ++-- .kokoro/continuous/node10/common.cfg | 4 ++-- .kokoro/continuous/node10/docs.cfg | 2 +- .kokoro/continuous/node10/lint.cfg | 2 +- .kokoro/continuous/node10/samples-test.cfg | 2 +- .kokoro/continuous/node10/system-test.cfg | 2 +- .kokoro/continuous/node12/common.cfg | 4 ++-- .kokoro/continuous/node8/common.cfg | 4 ++-- .kokoro/presubmit/node10/common.cfg | 4 ++-- .kokoro/presubmit/node10/docs.cfg | 2 +- .kokoro/presubmit/node10/lint.cfg | 2 +- .kokoro/presubmit/node10/samples-test.cfg | 2 +- .kokoro/presubmit/node10/system-test.cfg | 2 +- .kokoro/presubmit/node12/common.cfg | 4 ++-- .kokoro/presubmit/node8/common.cfg | 4 ++-- .kokoro/presubmit/windows/test.cfg | 2 +- .kokoro/release/docs.cfg | 4 ++-- .kokoro/release/publish.cfg | 4 ++-- README.md | 25 +++++++++++----------- samples/README.md | 8 ++++--- synth.metadata | 6 +++--- 22 files changed, 49 insertions(+), 46 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 2e31ed8d..5adacf45 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -10,7 +10,7 @@ Thanks for stopping by to let us know something could be better! Please run down the following list and make sure you've tried the usual "quick fixes": - - Search the issues already opened: https://github.com/googleapis/nodejs-storage/issues + - Search the issues already opened: https://github.com/googleapis/nodejs-bigquery-storage/issues - Search the issues on our "catch-all" repository: https://github.com/googleapis/google-cloud-node - Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg index 9eca1bec..81699465 100644 --- a/.kokoro/common.cfg +++ b/.kokoro/common.cfg @@ -11,7 +11,7 @@ action { gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" # Use the trampoline script to run in docker. -build_file: "nodejs-storage/.kokoro/trampoline.sh" +build_file: "nodejs-bigquery-storage/.kokoro/trampoline.sh" # Configure the docker image for kokoro-trampoline. env_vars: { @@ -20,5 +20,5 @@ env_vars: { } env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github/nodejs-storage/.kokoro/test.sh" + value: "github/nodejs-bigquery-storage/.kokoro/test.sh" } diff --git a/.kokoro/continuous/node10/common.cfg b/.kokoro/continuous/node10/common.cfg index 8ce0e4f1..e9656f0e 100644 --- a/.kokoro/continuous/node10/common.cfg +++ b/.kokoro/continuous/node10/common.cfg @@ -21,7 +21,7 @@ before_action { gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" # Use the trampoline script to run in docker. -build_file: "nodejs-storage/.kokoro/trampoline.sh" +build_file: "nodejs-bigquery-storage/.kokoro/trampoline.sh" # Configure the docker image for kokoro-trampoline. env_vars: { @@ -30,5 +30,5 @@ env_vars: { } env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github/nodejs-storage/.kokoro/test.sh" + value: "github/nodejs-bigquery-storage/.kokoro/test.sh" } diff --git a/.kokoro/continuous/node10/docs.cfg b/.kokoro/continuous/node10/docs.cfg index dd810b79..5972e5b3 100644 --- a/.kokoro/continuous/node10/docs.cfg +++ b/.kokoro/continuous/node10/docs.cfg @@ -1,4 +1,4 @@ env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github/nodejs-storage/.kokoro/docs.sh" + value: "github/nodejs-bigquery-storage/.kokoro/docs.sh" } diff --git a/.kokoro/continuous/node10/lint.cfg b/.kokoro/continuous/node10/lint.cfg index 72c4ad24..0a5d546b 100644 --- a/.kokoro/continuous/node10/lint.cfg +++ b/.kokoro/continuous/node10/lint.cfg @@ -1,4 +1,4 @@ env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github/nodejs-storage/.kokoro/lint.sh" + value: "github/nodejs-bigquery-storage/.kokoro/lint.sh" } diff --git a/.kokoro/continuous/node10/samples-test.cfg b/.kokoro/continuous/node10/samples-test.cfg index 7757bbb5..68b02101 100644 --- a/.kokoro/continuous/node10/samples-test.cfg +++ b/.kokoro/continuous/node10/samples-test.cfg @@ -3,5 +3,5 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github/nodejs-storage/.kokoro/samples-test.sh" + value: "github/nodejs-bigquery-storage/.kokoro/samples-test.sh" } diff --git a/.kokoro/continuous/node10/system-test.cfg b/.kokoro/continuous/node10/system-test.cfg index 57fbd1f3..3ccb29d6 100644 --- a/.kokoro/continuous/node10/system-test.cfg +++ b/.kokoro/continuous/node10/system-test.cfg @@ -3,5 +3,5 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github/nodejs-storage/.kokoro/system-test.sh" + value: "github/nodejs-bigquery-storage/.kokoro/system-test.sh" } diff --git a/.kokoro/continuous/node12/common.cfg b/.kokoro/continuous/node12/common.cfg index 8d874a0b..6df937a7 100644 --- a/.kokoro/continuous/node12/common.cfg +++ b/.kokoro/continuous/node12/common.cfg @@ -11,7 +11,7 @@ action { gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" # Use the trampoline script to run in docker. -build_file: "nodejs-storage/.kokoro/trampoline.sh" +build_file: "nodejs-bigquery-storage/.kokoro/trampoline.sh" # Configure the docker image for kokoro-trampoline. env_vars: { @@ -20,5 +20,5 @@ env_vars: { } env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github/nodejs-storage/.kokoro/test.sh" + value: "github/nodejs-bigquery-storage/.kokoro/test.sh" } diff --git a/.kokoro/continuous/node8/common.cfg b/.kokoro/continuous/node8/common.cfg index 6a5bb734..d9c4fb60 100644 --- a/.kokoro/continuous/node8/common.cfg +++ b/.kokoro/continuous/node8/common.cfg @@ -11,7 +11,7 @@ action { gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" # Use the trampoline script to run in docker. -build_file: "nodejs-storage/.kokoro/trampoline.sh" +build_file: "nodejs-bigquery-storage/.kokoro/trampoline.sh" # Configure the docker image for kokoro-trampoline. env_vars: { @@ -20,5 +20,5 @@ env_vars: { } env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github/nodejs-storage/.kokoro/test.sh" + value: "github/nodejs-bigquery-storage/.kokoro/test.sh" } diff --git a/.kokoro/presubmit/node10/common.cfg b/.kokoro/presubmit/node10/common.cfg index 8ce0e4f1..e9656f0e 100644 --- a/.kokoro/presubmit/node10/common.cfg +++ b/.kokoro/presubmit/node10/common.cfg @@ -21,7 +21,7 @@ before_action { gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" # Use the trampoline script to run in docker. -build_file: "nodejs-storage/.kokoro/trampoline.sh" +build_file: "nodejs-bigquery-storage/.kokoro/trampoline.sh" # Configure the docker image for kokoro-trampoline. env_vars: { @@ -30,5 +30,5 @@ env_vars: { } env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github/nodejs-storage/.kokoro/test.sh" + value: "github/nodejs-bigquery-storage/.kokoro/test.sh" } diff --git a/.kokoro/presubmit/node10/docs.cfg b/.kokoro/presubmit/node10/docs.cfg index dd810b79..5972e5b3 100644 --- a/.kokoro/presubmit/node10/docs.cfg +++ b/.kokoro/presubmit/node10/docs.cfg @@ -1,4 +1,4 @@ env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github/nodejs-storage/.kokoro/docs.sh" + value: "github/nodejs-bigquery-storage/.kokoro/docs.sh" } diff --git a/.kokoro/presubmit/node10/lint.cfg b/.kokoro/presubmit/node10/lint.cfg index 72c4ad24..0a5d546b 100644 --- a/.kokoro/presubmit/node10/lint.cfg +++ b/.kokoro/presubmit/node10/lint.cfg @@ -1,4 +1,4 @@ env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github/nodejs-storage/.kokoro/lint.sh" + value: "github/nodejs-bigquery-storage/.kokoro/lint.sh" } diff --git a/.kokoro/presubmit/node10/samples-test.cfg b/.kokoro/presubmit/node10/samples-test.cfg index 7757bbb5..68b02101 100644 --- a/.kokoro/presubmit/node10/samples-test.cfg +++ b/.kokoro/presubmit/node10/samples-test.cfg @@ -3,5 +3,5 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github/nodejs-storage/.kokoro/samples-test.sh" + value: "github/nodejs-bigquery-storage/.kokoro/samples-test.sh" } diff --git a/.kokoro/presubmit/node10/system-test.cfg b/.kokoro/presubmit/node10/system-test.cfg index 57fbd1f3..3ccb29d6 100644 --- a/.kokoro/presubmit/node10/system-test.cfg +++ b/.kokoro/presubmit/node10/system-test.cfg @@ -3,5 +3,5 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github/nodejs-storage/.kokoro/system-test.sh" + value: "github/nodejs-bigquery-storage/.kokoro/system-test.sh" } diff --git a/.kokoro/presubmit/node12/common.cfg b/.kokoro/presubmit/node12/common.cfg index 8d874a0b..6df937a7 100644 --- a/.kokoro/presubmit/node12/common.cfg +++ b/.kokoro/presubmit/node12/common.cfg @@ -11,7 +11,7 @@ action { gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" # Use the trampoline script to run in docker. -build_file: "nodejs-storage/.kokoro/trampoline.sh" +build_file: "nodejs-bigquery-storage/.kokoro/trampoline.sh" # Configure the docker image for kokoro-trampoline. env_vars: { @@ -20,5 +20,5 @@ env_vars: { } env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github/nodejs-storage/.kokoro/test.sh" + value: "github/nodejs-bigquery-storage/.kokoro/test.sh" } diff --git a/.kokoro/presubmit/node8/common.cfg b/.kokoro/presubmit/node8/common.cfg index 6a5bb734..d9c4fb60 100644 --- a/.kokoro/presubmit/node8/common.cfg +++ b/.kokoro/presubmit/node8/common.cfg @@ -11,7 +11,7 @@ action { gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" # Use the trampoline script to run in docker. -build_file: "nodejs-storage/.kokoro/trampoline.sh" +build_file: "nodejs-bigquery-storage/.kokoro/trampoline.sh" # Configure the docker image for kokoro-trampoline. env_vars: { @@ -20,5 +20,5 @@ env_vars: { } env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github/nodejs-storage/.kokoro/test.sh" + value: "github/nodejs-bigquery-storage/.kokoro/test.sh" } diff --git a/.kokoro/presubmit/windows/test.cfg b/.kokoro/presubmit/windows/test.cfg index 1ff4b4bf..83de067d 100644 --- a/.kokoro/presubmit/windows/test.cfg +++ b/.kokoro/presubmit/windows/test.cfg @@ -1,2 +1,2 @@ # Use the test file directly -build_file: "nodejs-storage/.kokoro/test.bat" +build_file: "nodejs-bigquery-storage/.kokoro/test.bat" diff --git a/.kokoro/release/docs.cfg b/.kokoro/release/docs.cfg index 16c16aa6..88eb54b1 100644 --- a/.kokoro/release/docs.cfg +++ b/.kokoro/release/docs.cfg @@ -18,9 +18,9 @@ env_vars: { gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" # Use the trampoline script to run in docker. -build_file: "nodejs-storage/.kokoro/trampoline.sh" +build_file: "nodejs-bigquery-storage/.kokoro/trampoline.sh" env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github/nodejs-storage/.kokoro/release/docs.sh" + value: "github/nodejs-bigquery-storage/.kokoro/release/docs.sh" } diff --git a/.kokoro/release/publish.cfg b/.kokoro/release/publish.cfg index 6e0e8847..5531834c 100644 --- a/.kokoro/release/publish.cfg +++ b/.kokoro/release/publish.cfg @@ -60,7 +60,7 @@ before_action { gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" # Use the trampoline script to run in docker. -build_file: "nodejs-storage/.kokoro/trampoline.sh" +build_file: "nodejs-bigquery-storage/.kokoro/trampoline.sh" # Configure the docker image for kokoro-trampoline. env_vars: { @@ -70,5 +70,5 @@ env_vars: { env_vars: { key: "TRAMPOLINE_BUILD_FILE" - value: "github/nodejs-storage/.kokoro/publish.sh" + value: "github/nodejs-bigquery-storage/.kokoro/publish.sh" } diff --git a/README.md b/README.md index e000349e..21c1c791 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ -Storage client for Node.js +Client for the BigQuery Storage API @@ -55,19 +55,20 @@ npm install @google-cloud/bigquery-storage ### Using the client library ```javascript - async function bigqueryStorageQuickstart() { - // 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; + // 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(); + 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(); @@ -186,7 +187,7 @@ has instructions for running the samples. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| 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/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) | diff --git a/samples/README.md b/samples/README.md index 28d300dd..27ca6db4 100644 --- a/samples/README.md +++ b/samples/README.md @@ -12,7 +12,7 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) - * [Quickstart](#quickstart) + * [BigQuery Storage Quickstart](#bigquery-storage-quickstart) ## Before you begin @@ -29,7 +29,9 @@ Before running the samples, make sure you've followed the steps outlined in -### Quickstart +### 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). @@ -38,7 +40,7 @@ View the [source code](https://github.com/googleapis/nodejs-bigquery-storage/blo __Usage:__ -`node samples/quickstart.js` +`node quickstart.js` diff --git a/synth.metadata b/synth.metadata index a3bac7c2..c270652e 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,12 +1,12 @@ { - "updateTime": "2020-02-11T19:47:11.184130Z", + "updateTime": "2020-02-18T21:38:09.539939Z", "sources": [ { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "8a36b928873ff9c05b43859b9d4ea14cd205df57", - "internalRef": "294459768" + "sha": "ab2685d8d3a0e191dc8aef83df36773c07cb3d06", + "internalRef": "295738415" } }, { From 8496944b75ebb9a3ece9a914f6a7eced4758e5f9 Mon Sep 17 00:00:00 2001 From: steffnay Date: Tue, 18 Feb 2020 14:58:52 -0800 Subject: [PATCH 09/12] chore: rerun synthtool --- .github/workflows/ci.yaml | 57 +++++++++++++++++++++++++++++++++++++++ .kokoro/test.bat | 14 +++++----- synth.metadata | 11 ++++++-- 3 files changed, 72 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..4d36c57b --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,57 @@ +on: + push: + branches: + - master + pull_request: +name: ci +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node: [8, 10, 12, 13] + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + - run: node --version + - run: npm install + - run: npm test + windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm install + - run: npm test + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm install + - run: npm run lint + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm install + - run: npm run docs-test + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm install + - run: npm test + - run: ./node_modules/.bin/c8 report --reporter=text-lcov | npx codecov@3 -t ${{ secrets.CODECOV_TOKEN }} --pipe diff --git a/.kokoro/test.bat b/.kokoro/test.bat index fddff757..ae59e59b 100644 --- a/.kokoro/test.bat +++ b/.kokoro/test.bat @@ -17,14 +17,12 @@ cd /d %~dp0 cd .. -@rem The image we're currently running has a broken version of Node.js enabled -@rem by nvm (v10.15.3), which has no npm bin. This hack uses the functional -@rem Node v8.9.1 to install npm@latest, it then uses this version of npm to -@rem install npm for v10.15.3. -call nvm use v8.9.1 || goto :error -call node C:\Users\kbuilder\AppData\Roaming\nvm-ps\versions\v8.9.1\node_modules\npm-bootstrap\bin\npm-cli.js i npm -g || goto :error -call nvm use v10.15.3 || goto :error -call node C:\Users\kbuilder\AppData\Roaming\nvm-ps\versions\v8.9.1\node_modules\npm\bin\npm-cli.js i npm -g || goto :error +@rem npm path is not currently set in our image, we should fix this next time +@rem we upgrade Node.js in the image: +SET PATH=%PATH%;/cygdrive/c/Program Files/nodejs/npm + +call nvm use v12.14.1 +call which node call npm install || goto :error call npm run test || goto :error diff --git a/synth.metadata b/synth.metadata index c270652e..ab38fb4b 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,6 +1,13 @@ { - "updateTime": "2020-02-18T21:38:09.539939Z", + "updateTime": "2020-02-18T22:56:39.544261Z", "sources": [ + { + "git": { + "name": ".", + "remote": "sso://user/steffanyb/nodejs-bigquery-storage", + "sha": "6152883ee18789d86f9d44ffc8433b55b7889118" + } + }, { "git": { "name": "googleapis", @@ -13,7 +20,7 @@ "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.10.17" + "version": "2020.2.4" } } ], From b2e1108d2ad9a5fa42a18d48b5da67895044a35f Mon Sep 17 00:00:00 2001 From: steffnay Date: Tue, 18 Feb 2020 15:57:44 -0800 Subject: [PATCH 10/12] test: updates tests --- test/gapic-big_query_storage-v1beta1.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/gapic-big_query_storage-v1beta1.ts b/test/gapic-big_query_storage-v1beta1.ts index d71eafab..eb9a7164 100644 --- a/test/gapic-big_query_storage-v1beta1.ts +++ b/test/gapic-big_query_storage-v1beta1.ts @@ -319,7 +319,9 @@ describe('v1beta1.BigQueryStorageClient', () => { projectId: 'bogus', }); // Mock request - const request = {}; + const request = { + readPosition: {stream: ''} + }; // Mock response const expectedResponse = {}; // Mock gRPC layer @@ -344,7 +346,9 @@ describe('v1beta1.BigQueryStorageClient', () => { projectId: 'bogus', }); // Mock request - const request = {}; + const request = { + readPosition: {stream: ''} + }; // Mock response const expectedResponse = {}; // Mock gRPC layer From 42cf4166a5f978c740a23d80def6c42f7e8de0a0 Mon Sep 17 00:00:00 2001 From: steffnay Date: Tue, 18 Feb 2020 16:04:56 -0800 Subject: [PATCH 11/12] test: linted --- test/gapic-big_query_storage-v1beta1.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/gapic-big_query_storage-v1beta1.ts b/test/gapic-big_query_storage-v1beta1.ts index eb9a7164..c087a51c 100644 --- a/test/gapic-big_query_storage-v1beta1.ts +++ b/test/gapic-big_query_storage-v1beta1.ts @@ -319,8 +319,8 @@ describe('v1beta1.BigQueryStorageClient', () => { projectId: 'bogus', }); // Mock request - const request = { - readPosition: {stream: ''} + const request = { + readPosition: {stream: ''}, }; // Mock response const expectedResponse = {}; @@ -347,7 +347,7 @@ describe('v1beta1.BigQueryStorageClient', () => { }); // Mock request const request = { - readPosition: {stream: ''} + readPosition: {stream: ''}, }; // Mock response const expectedResponse = {}; From 17c3755861515f154b72f01829d4ba87929830d1 Mon Sep 17 00:00:00 2001 From: bcoe Date: Wed, 19 Feb 2020 23:01:00 -0800 Subject: [PATCH 12/12] chore: does advice actually work --- package.json | 1 + samples/package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 758a674a..90fd02d8 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "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", diff --git a/samples/package.json b/samples/package.json index 4e86f2ed..3b4674c4 100644 --- a/samples/package.json +++ b/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-storage": "^1.0.1", + "@google-cloud/bigquery-storage": "^0.1.0", "avsc": "^5.4.18", "snappy": "^6.2.3" },